Fix: virtualhost overlap on port 80 the first has precedence

I had to virtual host conf files but only the first one was resolving

When I would restart Apache I would see this
 virtualhost overlap on port 80 the first has precedence


    ServerName localhost
    DocumentRoot /var/www/html/000




 and 


    ServerAdmin carla@localhost
    DocumentRoot /var/www/html/mysite.com
    ServerName mysite.com
    ServerAlias mysite.com
 This fixed it # NameVirtualhost is needed in httpd prior to v2.3.11 NameVirtualHost 192.168.0.1:80 
 NameVirtualhost *:80
    ServerName localhost
    DocumentRoot /var/www/html/000



I believe this NamedVirtualhost can be enabled in main config

Leave a Reply

Your email address will not be published. Required fields are marked *