Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start

When start Apache web server or restart the HTTPD service on web host, the following warning message may appears on console or error log, even though Apache HTTP service can still startup and running fine without error.

[warn] NameVirtualHost *:80 has no VirtualHosts

where * can be asterisk itself (*), hostname or IP address.

Luckily the message is just a warning message and does not affect the functionality of web server, and hence the websites hosted on the server can still be served properly. The possible cause for this problem’s symptom is incorrect use of NameVirtualHost.

When the server, dedicated or virtual private server web host, has only one IP address, websites are hosted by Apache via name based virtual hosting. In this case, there should be only one NameVirtualHost been defined. For example,

NameVirtualHost *:80
<VirtualHost *:80>
servername host
serverPath /public_html/
DocumentRoot /public_html/
</VirtualHost>

The name of one or more virtual hosts (websites’ domain name) is defined by “servername” directive. So if you have more than one websites hosted on a single IP address, you will have one NameVirtualHost declaration and many VirtualHost sections to configure those domains.

Beside, try at best to use IPs or * for the NameVirtualHost and <VirtualHost> directives. In some cases, where the website is assigned a dedicated IP address where only one virtual host is declared, the NameVirtualHost can even be dropped.

For more example on how VirtualHost supposed to be setup, visit Apache 2.2 documentation or Apache 1.3 documentation (more common version of Apache used currently as most control panel such as cPanel comes with this, although it’s going to be upgraded in cPanel 11).


10 Responses to “Apache Warn NameVirtualHost *:80 Has No VirtualHosts Error When Start”

  1. Terry Rankine
    June 29th, 2009 10:02
    10

    debian lenny – just make sure there is ONLY one instance of
    NameVirtualHost *:80

    and you have receivers for it (ie virtual host entries)

    the definitive place to put NameVirtualHost is in ports.conf

  2. walter
    May 9th, 2009 23:58
    9

    Thanks, very useful for me.

  3. Mehmet
    April 29th, 2009 12:19
    8

    NameVirtualHost *:80 has no VirtualHosts 443 SSL port not yeap.

  4. prazetyo
    March 23rd, 2009 15:57
    7

    the message appear because ports.conf not configure.

    If you configure VirtualHost with ip ex.

    Then you must configure at ports.conf with same setting.
    ports.conf
    NameVirtualHost xxx.xxx.xxx.xxx:80
    Listen 80

    I also have same problem. But after I change this setting, that message dissapear.

    Good lUck

  5. Daniel B
    February 24th, 2009 18:18
    6

    Thanks.

    It was a great help. You would believe how many different opinions there are on which is the right syntax for VirtualHost in Apache.

    Thanks again.

  6. Alejandro
    February 16th, 2009 08:35
    5

    Thanks waveclaw.

  7. waveclaw
    January 18th, 2009 15:53
    4

    This warning will also be emitted if there are multiple NameVirtualHost entries.

    In the basic install of Apache 2 on Debian 5 (Lenny) I see the NameVirtualHost in:

    /etc/apache2/sites-enabled/000-default

    and

    /etc/apache2/ports.conf

    So at least this out-of-the-box install will emit this warning every time ‘/etc/init.d/apache2 reload’ is called to check the configuration files.

    If the warning bothers you, just comment out the entry in ports.conf and don’t add new ones; say, from an example site template pasted into a new configuration file.

  8. basil
    December 23rd, 2008 12:54
    3

    NameVirtualHost *:80 has no VirtualHosts

  9. ORNYX » Blog Archive » Apache warns that your NameVirtualHost has no VirtualHosts
    July 10th, 2008 19:05
    2

    [...] Still, now that I’m running my own VPS, I might as well get it fixed. So here’s it. [...]

  10. simplificator » Blog Archive » Ubuntu Administration: Hosting multiple Websites with Apache2
    August 20th, 2007 19:30
    1

    [...] people on the web say stuff like ‘change the *:80 to a _default_:80′ or similar – focusing on tricking [...]

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to comments feature has been disabled. To receive notification of latest comments posted, subscribe to My Digital Life Comments RSS feed or register to receive new comments in daily email digest.
Custom Search

New Articles

Incoming Search Terms for the Article

NameVirtualHost *:80 has no VirtualHosts - [warn] NameVirtualHost *:80 has no VirtualHosts - namevirtualhost 80 has no virtualhosts - NameVirtualHost *:80 has no VirtualHosts - namevirtualhost - NameVirtualHost has no VirtualHosts - apache NameVirtualHost - has no virtualhosts - [warn] NameVirtualHost has no VirtualHosts - NameVirtualHost has no VirtualHosts - [warn] NameVirtualHost has no VirtualHosts - namevirtualhost 80 has no virtualhosts apache - "has no VirtualHosts" - warn namevirtualhost 80 has no virtualhosts - [warn] NameVirtualHost :80 has no VirtualHosts - apache has no virtualhosts - apache namevirtualhost 80 has no virtualhosts - [warn] NameVirtualHost *:80 has no VirtualHosts - apache2 NameVirtualHost *:80 has no VirtualHosts - ubuntu NameVirtualHost - NameVirtualHost has no virtualhost - [warn] NameVirtualHost - namevirtualhost apache - namevirtualhost has no virtualhosts apache2 - apache NameVirtualHost *:80 has no VirtualHosts - apache2 NameVirtualHost - namevirtualhost has no virtual hosts - namevirtualhost 80 has no virtualhosts debian - 80 has no virtualhosts - NameVirtualHost :80 has no VirtualHosts - *:80 has no VirtualHosts - apache2 namevirtualhost 80 has no virtualhosts - debian nameVirtualHost *:80 has no VirtualHosts - apache NameVirtualHost has no VirtualHosts - has no virtual hosts - ubuntu NameVirtualHost *:80 has no VirtualHosts - namevirtualhost 80 has no virtualhosts apache2 - apache2 has no VirtualHosts - name virtual host has no virtual hosts - NameVirtualHost *:8080 has no VirtualHosts - namevirtualhost *:80 has no Virtualhost - warn namevirtualhost 80 has no virtualhosts ubuntu - NameVirtualHost has no - has no VirtualHosts - apache [warn] NameVirtualHost *:80 has no VirtualHosts - NameVirtualHost has no VirtualHosts - warn namevirtualhost 80 has no virtualhosts debian - no VirtualHosts - ubuntu apache namevirtualhost - has no virtualhost -