Question

Help!! Apache Virtual Host not working!

Posted June 28, 2014 11.7k views

I have Setup two websites on my Ubuntu 12.04 x32 VPS, say abc.com and xyz.com.

For some reason, since abc.com in first in the alphabetical order, even xyz.com redirects to abc.om

VirtualHosts File for abc.com:

<VirtualHost *:80>

        ServerAdmin webmaster@abc.com

        DocumentRoot /var/www/abc/
        ServerName abc.com
        ServerAlias abc.com

</VirtualHost>

VirtualHosts fle for xyz.com:

<VirtualHost *:80>

        ServerAdmin webmaster@xyz.com

        DocumentRoot /var/www/xyz/
        ServerName xyz.om
        ServerAlias xyz.com

</VirtualHost>

Here is this message I get each time I start apache:

* Restarting web server apache2
[Sat Jun 28 06:06:27 2014] [warn] _default_ VirtualHost overlap on port 80, the first has precedence
 ... waiting [Sat Jun 28 06:06:28 2014] _default_ VirtualHost overlap on port 80, the first has precedence

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
1 answer

change
ServerName xyz.om

to
ServerName xyz.com

Submit an Answer