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).
Related Articles
- Request URL /server-status or 404 Page Not Found Apache Error
- cPanel WHM Failed to Receive Status Information From Apache Error
- winnt_accept: Asynchronous AcceptEx failed Error in Apache Log
- FreeBSD Apache HTTP Accept Filter Error
- Fix Internal Server Error When Accessing Easy Apache in cPanel WebHosting Manager
- Apache Status (whm-server-status) in cPanel WebHost Manager Returns Blank Page
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 4
- Improve Apache Web Server Security: Use ServerTokens and ServerSignature to Disable Header
- Fix Hotspot Shield Bandwidth Exceeded, TCP Connect Wait, Auth Failure or Daemon Start Error
- Starting Apache HTTPD Failed Due to Cannot Open or No Such mod_bwlimited, mod_log_bytes or mod_bandwidth Files










































June 29th, 2009 10:02
debian lenny – just make sure there is ONLY one instance of
NameVirtualHost *:80and you have receivers for it (ie virtual host entries)
the definitive place to put NameVirtualHost is in ports.conf
May 9th, 2009 23:58
Thanks, very useful for me.
April 29th, 2009 12:19
NameVirtualHost *:80 has no VirtualHosts 443 SSL port not yeap.
March 23rd, 2009 15:57
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
February 24th, 2009 18:18
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.
February 16th, 2009 08:35
Thanks waveclaw.
January 18th, 2009 15:53
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.
December 23rd, 2008 12:54
NameVirtualHost *:80 has no VirtualHosts
July 10th, 2008 19:05
[...] Still, now that I’m running my own VPS, I might as well get it fixed. So here’s it. [...]
August 20th, 2007 19:30
[...] people on the web say stuff like ‘change the *:80 to a _default_:80′ or similar – focusing on tricking [...]