I really wish threads weren't archived... or the original author could
re-open them. If I could post to this previous thread I apologize but
I could not find the reply link.
http://groups.google.com/group/alt.apache.configuration/browse_thread/...ead/5ea
I wanted to be able to use the virtual hosting capabilities of
apache. I wanted
http://woodstock.com to use vhost to use
woodstock.snoopy.com and snoopy.com to use the default vhost.
Floor was very helpful and told me to replace the order of the vhost
blocks and it worked perfectly. Unfortunately after adding a third
Vhost recently the solution did not work anymore. Any outside domains
were automatically directed to the first vhost block. I am just
posting the solution because I remember spending hours trying to find
the answer.
DNS is configured like...
Snoopy's settings:
@ xxx.xxx.xxx.xxx A
woodstock snoopy.com CNAME
Woodstock's settings:
@ woodstock.snoopy.com CNAME
Apache configuration 01_woodstock_vhost.conf on the machine that hosts
snoopy is
#Here is the key change... before I was using woodstock.snoopy.com
NameVirtualHost woodstock.com:80
<VirtualHost *:80>
DocumentRoot "/var/www/woodstock/"
ServerName "woodstock.snoopy.com"
</VirtualHost>
if you have the default vhost then you will be able to visit
snoopy.com and woodstock.com, and receive the proper vhosts without
changing the order around.