Help!! Apache Virtual Host not working!

June 28, 2014 8.8k 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
1 Answer

change
ServerName xyz.om

to
ServerName xyz.com

Have another answer? Share your knowledge.