Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

apache & multiple host-names 1

Status
Not open for further replies.

roeiboot

Technical User
Feb 10, 2002
241
US
hi,

i have purchased a domain name & want to use different "names" on 1 pc (running win 2000 adv. server)
like: ( <- main one) and
xxx.myname.com, i believe this should be possible but it's not working.. here's a piece of my httpd.conf:
<VirtualHost *>
ServerAdmin name@mail.com
DocumentRoot &quot;D:/homepages/dir1&quot;
ServerName </VirtualHost>

<VirtualHost *>
ServerAdmin name@mail.com
DocumentRoot &quot;D:\homepages\dir2&quot;
ServerName xxx.myname.com
</VirtualHost>

what am i doing wrong ??

--
thx in advance,
rb.
 
Hi,

The easiest way to check if its a dns problem is to put the canonical name <-> IP address mappings in your local HOSTS file and test on the box itself. If it works there then you've got Apache configured correctly and you would then need to amend the zone file for your domain to add the extra canonical names. On NT the HOSTS file lives at C:\WINNT\system32\drivers\etc\HOSTS (if its not present there is probably a sample file - HOSTS.sam). You just put some lines in there like :

127.0.0.1 localhost
127.0.0.1 127.0.0.1
etc..

Then try and .

From what I can see you are hosting your own dns so once you've got apache working OK with the virtual hosts you just need to edit your zone file for the roeiboot.com domain (& the reverse zone file too!) and restart the Bind daemon.

Regards
 
hi,

did the 1st part of your reply, and YES if i add those lines to the hosts file it works on the w2k pc.

zone-file for roeiboot.com, could suggestion.. with some luck i setup BIND for w2k, is it the file that is called db.roeiboot.com ? and the other one is probably the one that has my IP number.. i've been playing in that file but BIND keeps giving errors.

thx in advance.
rb.
 
Roeiboot, sounds like you did not purchase a sub-domain when you got your domain name. These are extra-cost items from your register. You will need to buy each sub-domain name, then configure your httpd.conf as indicated at top. You can't just make up sub-domains based on your registered domain name and have them resolve outside of your server.
 
That is not technically true...

If you have all request for a whateverhere.domain.com resolving to your IP address then you can just alter the httpd.conf to tell apache where to direct each request to.

I can set up as many subdomains as I want and do not need to alter anything outside apache on my local machine...

The way I currently do it is by running DNS2GO
You transfer your domain to their nameservers and they then point any requests for whatever.domain.com to your current IP address. This also updates for any change in your IP so it works just as well for a dynamic or static IP address. You just need to tell apache what to do with the requests.

Hope this helps Wullie

 
if i set it up 'locally' it works so the problem is not in apache @ all (took some time to figure that out but with the help of ifincham i established that much).. since i run my own & a friends name-server(s) i'm not sure if i need to use DNS2GO, i'm assuming it's a matter of setting up the name-server(s) correctly (which i'm trying & could use more help with :) ..as said i use BIND for Win.
 
Hi,





All you need is to get your BIND setup properly. For canonical name resolution DNS works from right to left. First you work out who is responsible for .com (the internet root dns servers!) then they tell you who is responsible for whatever.com and so on. It usually stops at that level but some companies/organisations might go to another level. For example the NS for whatever.com might point to further name servers for euro.whatever.com and us.whatever.com . This 'dig' output shows the resolution for the namservers for your domain :





; <<>> DiG 9.1.3 <<>> roeiboot.com NS


;; global options: printcmd


;; Got answer:


;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52900


;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 2





;; QUESTION SECTION:


;roeiboot.com. IN NS





;; ANSWER SECTION:


roeiboot.com. 172800 IN NS NS1.BRITNEYSPEARSNOW.com.


roeiboot.com. 172800 IN NS NS1.roeiboot.com.





;; ADDITIONAL SECTION:


NS1.BRITNEYSPEARSNOW.com. 172800 IN A 212.204.190.201


NS1.roeiboot.com. 172800 IN A 65.24.134.188





;; Query time: 111 msec


;; SERVER: 213.1.119.98#53(213.1.119.98)


;; WHEN: Tue Feb 12 20:20:32 2002


;; MSG SIZE rcvd: 115








If I ask for resolution on I get (output snipped for brevity) :





;; ANSWER SECTION:


86400 IN CNAME roeiboot.com.








This means that is a canonical name (alias) for roeiboot.com and has the same IP address (i.e. refer to that).





However, there is nothing for so it must be missing from the zone file on both nameservers (is the other - britney - yours ?) You just need a line in the zone file like :





IN A 65.24.134.188





or





IN A 65.24.134.188





(if you leave off the final period it adds the domain on the end)





What I'm not too sure of is where the files lie on win32 ...



You only need dns2go etc if you IP address is not fixed.



Regards
 
hmz.. for starters thanks for tracing stuff to come to some idea of where things are happening, i added the line you said to add but it still won't work. 'britney' is not mine, that's the name-server of a friend of mine.. BIND for win32 looks alot like the Linux version. perhaps i can email you the files i use ??

--
again; thx!
rb.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top