webserver

How do I resolve the Apache warning [warn] NameVirtualHost *:80 has no VirtualHosts?

If you encounter the Apache warning “[warn] NameVirtualHost *:80 has no VirtualHosts”, you can correct the problem by adjusting your VirtualHosts (or creating them if they don’t exist).

Your VirtualHost may look like this:


DocumentRoot /var/www/html
ServerName mysite.com


ScriptAlias /cgi-bin/ /var/www/html/cgi-bin/
ErrorLog logs/error_log
CustomLog logs/access_log combined

In order to use NamedVirtualHosts, you will need to specify port 80.


DocumentRoot /var/www/html
ServerName mysite.com


ScriptAlias /cgi-bin/ /var/www/html/cgi-bin/
ErrorLog logs/error_log
CustomLog logs/access_log combined

After doing so you can restart or reload Apache.

# service httpd (restart|reload)

Click to comment

Leave a Reply

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

To Top