I have been having a problem getting Virtual hosts to work. After reading RH 9 docs and many posts I thought I had it right but it still is not working as I expect.
Here is some background:
Linux Disto - Red Hat 9.0 on LAN with IP of 192.168.2.103
DNS - Zoneedit with DynDNS to manage Dynamic IP address
Router - Linksys Cable/DSL with port 80 forwarded
Registered Domain Name - www.compunerdsmedia.com
Current Dynamic IP address - 220.127.116.11
Goal - To be able to serve www.compunerdsmedia.com
and a sub-domain on the same Linux server.
First I added a new zone in zoneedit called webdev.compunerdsmedia.com and pionted it to 18.104.22.168.
Next I created a directory called webdev under /var/www/html and chmod 777
Then I modified the httpd.conf file with additional virtual host settings. The Virtual Host section follows:
### Section 3: Virtual Hosts
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
# Please see the documentation at
# for further details before you try to setup virtual hosts.
# You may use the command line option '-S' to verify your virtual host
# Use name-based virtual hosting.
# Where do we put the lock and pif files?
# Defaults for virtual hosts
# Virtual hosts
# Virtual host Default Virtual Host
DirectoryIndex index.php index.html index.htm index.shtml
# Virtual host www.webdev.compunerdsmedia.com
ServerAlias webdev.compunerdsmedia.com *.webdev.compunerdsmedia.com
# Virtual host www.compunerdsmedia.com
ServerAlias compunerdsmedia.com *.compunerdsmedia.com
I stopped and restarted httpd service, cranked up my IE 6.0 browser on my workstation and typed in www.compunerdsmedia.com.
The home page displayed correctly.
Next I typed www.webdev.compunerdsmedia.com
and the same home page displayed. What I expected to see was a form (index.html) display located in the /var/www/html/webdev directory.
Can anyone see any problem with my steps or with my httpd.conf settings?
Any help would be much appreciated.