|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
Name based web hosting with DNS
Hi All!
I am trying to setup apache2 to do name based vhosting. There is **LOTS** of info on how to do this, but everyone says 'add entry to dns' well it sounds simple.. How then, with bind9, do I add an entry to dns? (please don't say 'with vi' because I might throw up - it would be funny tho') If someone can toss me some examples, I'll owe them beer. *****LOTS OF IT***** My setup: Debian 3 Linux 2.4.21 Bind9 Apache2 php4 MySQL server name is trillian.mydomain.ca located at /www/trillian/ new website is URL and ftp.danimal.ca located at /www/dainmal/ from httpd.conf <VirtualHost *> ServerAdmin URL DocumentRoot /www/danimal/ ServerName danimal.ca </VirtualHost> <VirtualHost *> ServerAdmin URL DocumentRoot /www/trillian/ ServerName trillian.mydomain.ca </VirtualHost> |
|
#2
|
|||
|
|||
|
Quote:
The problem is that there is 100 ways to setup dns depending on your network topography and software used, so describing dns setup in the apache manual would be a little bit off-topic and double its number of pages. Adding the entry itself is really simple. What you want is called an "A record". It will point "www2.mydomain.com" to "1.2.3.4". (your new hostname to your IP) There probably is already at least one A record, "www.mydomain.com". For bind9, you have to edit your zone file. Either with a texteditor or with a graphical frontend. vi is a text editor. If you donīt like it, you have to find a (working) gui. I am using RH7.2 at work, iirc it comes with a kde gui for bind. If you decide to use the text editor, it will be as simple as: there is an entry "www IN A 1.2.3.4" or similar. Add "www2 IN A 1.2.3.4" (using the same IP address) just below that line. Then restart bind with "service named reload" ("service bind reload"?, "ndc reload"? not sure what debian is using)
__________________
-- Manuel Hirsch - Linux, FreeBSD, programming, administration articles, tutorials and more. |
|
#3
|
||||
|
||||
|
trillian.mydomain.ca
www.danimal.ca In the first domain you said you are hosting, you say you already have setup in your DNS? Well, it would be setup in your DNS under the zone "mydomain.ca". The zone file is named for "mydomain.ca" in the named.conf as well as points to the file which contains information on that zone. So to add www.danimal.ca to the DNS, you need to name "danimal.ca" in the named.conf that points to a new file which contains all information on "danimal.ca" including "www.danimal.ca". |
|
#4
|
|||
|
|||
|
Its been awhile since I used Bind but you need to add
zone "YourDom.com" { type master; file "/var/named/YourDom.com.hosts"; }; to named.conf and then edit var/named/YourDom.com.hosts file and add entries for your hosts E.G. www.yourdom.com Sam Land http://www.dyndnsservices.com |
|
#5
|
|||
|
|||
|
Thanks, got it fixed...
biggest problem: named didn't have sufficient permissions to read the zone file. change ownership of the file, works perfectly. Thanks again |
![]() |
| Viewing: Dev Shed Forums > System Administration > DNS > Name based web hosting with DNS |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|