Forum Moderators: phranque

Message Too Old, No Replies

Name-based Virtual Hosts Not Working

         

hcblue

8:12 am on Apr 8, 2004 (gmt 0)

10+ Year Member



Hi all,

I'm trying to set up name-based virtual hosts. I've tried looking at the Apache documents and forums (including this one). I thought I set it up correctly, but since it's not working, I'm really doubting it :P

I have the server niche.example.net (66.***.135.63) and set up CNAME records for www.example.net, example.net, and hyper.example.net. An excerpt:


niche.example.net. IN A 66.***.135.63
www.example.net. IN CNAME niche.example.net.
example.net. IN CNAME niche.example.net.
hyper.example.net. IN CNAME niche.example.net.

The Apache is set up:


ServerName niche.example.net
ServerAdmin me@example.net
DocumentRoot "/var/www"
NameVirtualHost 66.***.135.63

Now if I try to access, www.example.net and example.net shows up correctly (it shows an index.php that displays phpinfo()):


<VirtualHost 66.***.135.63>
ServerName www.example.net
DocumentRoot "/home/example/www"
HostnameLookups Double
ServerSignature On
<Directory "/home/example/www">
Allow from All
Order allow,deny
HostnameLookups Double
</Directory>
</VirtualHost>

and


<VirtualHost 66.***.135.63>
DocumentRoot "/home/example"
ServerName hyper.example.net
HostnameLookups Double
</VirtualHost>

I'm really clueless why hyper.example.net = www.example.net. Do I need to throw away the HostnameLookupses? Does order matter?

Any hints would be very much appreciated!

~R

[edited by: jdMorgan at 4:00 pm (utc) on April 8, 2004]
[edit reason] Removed URLs per TOS [/edit]

webtraveler

5:44 pm on Apr 11, 2004 (gmt 0)



I know how to set up name based virtual hosts in the httpd.conf file in Linux. Are you interested in that?