Report this

What is the reason for this report?

Help!! Apache Virtual Host not working!

Posted on June 28, 2014

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


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

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.

change ServerName xyz.om

to ServerName xyz.com

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.