When restarting Apache (or httpd service) if you get the following Apache error: [warn] _default_ VirtualHost overlap on port 80, the first has precedence on Linux (CentOS, Ubuntu, Fedora, etc) chances are you are configuring vhosts or adding additional virtual hosts to your Apache config.
You are probably seeing an error similar to the following:
[root@server ads]# /etc/init.d/httpd restart Stopping httpd: [ OK ] Starting httpd: [Fri Mar 23 07:55:04 2012] [warn] VirtualHost 192.168.1.2:80 overlaps with VirtualHost 192.168.1.2:80, the first has precedence, perhaps you need a NameVirtualHost directive
Fix Apache Error: [warn] _default_ VirtualHost overlap on port 80, the first has precedence
To fix the Apache error message [warn] _default_ VirtualHost overlap on port 80, the first has precedence Apache you need to open the file httpd.conf file in Vi and add the following line:
vi /etc/httpd/conf/httpd.conf
Add the following:
NameVirtualHost *:80
You then need to configure your vhosts as follows:
ServerName linuxmoz.com ServerAlias *.linuxmoz.com ServerAdmin webmaster@blah.com ErrorLog /var/log/httpd/linuxmoz.com-example.err CustomLog /var/log/httpd/linuxmoz.com.log combined DocumentRoot /var/www/linuxmoz Order allow,deny Allow from all
**note the *:80 – this means it will run on any IP address configure on your server.
If you need to run the vhost on a specific IP address use the following:
NameVirtualHost 192.168.1.2:80
Obvious replace the IP with your servers IP address, you also need to reconfigure your vhost files to use the IP address.
If you restart Apache / Httpd you should now see:
Stopping httpd: [ OK ] Starting httpd: [ OK ]
Your formatting may differ the above was taken from a CentOS Apache restart, your may fine this Centos install Apache guide useful.
The Apache error message [warn] _default_ VirtualHost overlap on port 80, the first has precedence should now be sucsessfully fixed.