Skip to content

Phils Blog and Stuff

TELECOMS. VIRTUALIZATION. IT. CODING. and more…

Menu
  • Home
  • Resources
    • Subnet Mask Cheat Sheet
    • Easy Dmarc+Email
    • MX Tool Box
    • LOAD BALANCING & SRE
  • SHOP
  • SOLUTIONS
  • SERVICES
  • Contact Me
Menu

[warn] _default_ VirtualHost overlap on port 80, the first has precedence Apache

Posted on 04/04/201208/03/2023 by Phil

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

[warn] _default_ VirtualHost overlap on port 80, the first has precedence Apache
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.

POSTS

  • Home Assistant. Add water meter with PHP+MQTT+YML.
  • Automating your home with Home Assistant. Initial install and config (Hyper-V).
  • The importance of setting up email security correctly.
  • Automate Debian installations with Seed, DHCP and Nginx.
  • A simple link shortener.. Fun little project…

WORD CLOUD

3CX 3CX Phone System Apache Asterisk Cacti CentOS CRM DHCP DNS Email Fail over Failover File System Firewall FreeBSD FreeNAS FXO IAX install IP IP PBX Linux M0n0wall Nottingham Open Source PBX PFSense PHP Router Server SIP snom SSH TrixBox ubuntu VLAN Voice VoIP VPN vyatta WAN Website WiFi yealink ZFS

© 2025 Phils Blog and Stuff | Powered by Superbs Personal Blog theme