Forum Moderators: phranque

Message Too Old, No Replies

Virtual host Apache 2

         

fzx5v0

8:37 am on Jun 26, 2009 (gmt 0)

10+ Year Member



Hi
in apache httpd.conf I have created 2 virtual host as i only have 1 ipaddress for the server but only the first one works corectly and bothe domain names serve the pages from the same document root instead of different once.
can someone advise what I have done wrong
thanks
<VirtualHost *:80>
DocumentRoot /var/www/domain1
ServerName domain1
ServerAlias *.domain1.co.uk
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /var/www/domain2/
ServerName domain2
ServerAlias *.domain2.co.uk
</VirtualHost>

g1smd

8:39 am on Jun 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Did you restart the server? Does the new folder exist on the server, with correct name?

fzx5v0

8:47 am on Jun 26, 2009 (gmt 0)

10+ Year Member



Hi
yes i restarted apache and the folder exist with the correct path and name

thanks

fzx5v0

9:41 am on Jun 26, 2009 (gmt 0)

10+ Year Member



Hi
found the problem my fault i should of looked at my error logs first

httpd.comf did not have NameVirtualHost *:80 in it

thanks

g1smd

12:14 pm on Jun 26, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Error logs are often cryptic, but occasionally supply the clue you need.