PDA

View Full Version : vhost problems


Stormfire
26th May 2007, 05:41
been trying to set up a vhost for 2 domains to 1 computer, one of the domains use the correct vhost, but the second uses the default, can't to see what is wrong.

This is an example of what the config is setup like

NameVirtualHost *:80

<VirtualHost *:80>
ServerName localhost
ServerAdmin andrew@test.com
DocumentRoot /srv/www/htdocs
</VirtualHost>

<VirtualHost *:80>
ServerName www.example.com
ServerAlias www.example.com *.example.com
ServerAdmin andrew@test.com
DocumentRoot /srv/www/htdocs/example
</VirtualHost>

<VirtualHost *:80>
ServerName www.andrew.test.com
ServerAlias www.andrew.test.com *.andrew.test.com
ServerAdmin andrew@test.com
DocumentRoot /srv/www/htdocs/test
</VirtualHost>

the example one will go to the correct dir, where the test one always goes to the default dir, any indea on what is wrong I'm using open suse 10.2 with the apache that is installed in it, all of the L.A.M.P is install. :confused:

falko
26th May 2007, 21:07
Are you really using www.andrew.test.com in your browser's address bar? If you type in something else which the server doesn't know, it will show you the default site.
Or is the server's default name www.andrew.test.com? In that case it would override your vhost.

Stormfire
27th May 2007, 03:26
the default is set to local host, these are a example only but almost a direct copy of the real site.

Stormfire
27th May 2007, 14:41
Problem solved, using port instead of ip,