Apache: [warn] default VirtualHost overlap on port 80, the first has precedence Error and Solution

Apache: [warn] default VirtualHost overlap on port 80, the first has precedence Error and Solution

The "VirtualHost overlap" error in Apache HTTP Server occurs when two or more virtual host definitions have the same address and port combination. When this happens, Apache will only use the first virtual host definition and ignore the others, which can cause unexpected behavior.

To fix this error, you need to ensure that each virtual host definition has a unique address and port combination.

To do this, you can either specify a unique IP address for each virtual host, or use a different port for one of the virtual hosts.

For example, if you have two virtual hosts defined for *:80, you can either specify a unique IP address for each virtual host, like this:

<VirtualHost 192.168.1.100:80>
    ServerName www.example.com
    DocumentRoot /var/www/example
</VirtualHost>

<VirtualHost 192.168.1.101:80>
    ServerName www.example.org
    DocumentRoot /var/www/exampleorg
</VirtualHost>
So‮ru‬ce:www.lautturi.com

Or you can use a different port for one of the virtual hosts, like this:

<VirtualHost *:80>
    ServerName www.example.com
    DocumentRoot /var/www/example
</VirtualHost>

<VirtualHost *:8080>
    ServerName www.example.org
    DocumentRoot /var/www/exampleorg
</VirtualHost>

Once you have made the necessary changes to your virtual host definitions, save the configuration file and restart the Apache HTTP Server for the changes to take effect.

You can find more information about virtual hosts in the Apache HTTP Server documentation by visiting the Apache HTTP Server website.

Created Time:2017-10-27 14:56:33  Author:lautturi