My ongoing experiences with Ubuntu, and later Mythbuntu, as a media center with MythTV. I'm also using the system for a virtual machine server, a mediawiki server and a general all around home infrastructure base.

Monday, November 3, 2008

NameVirtualHost *:80 has no VirtualHosts

After upgrading to 8.10 I saw the following error on an Apache reload:

# apache2ctl restart
[Sun Nov 16 13:36:23 2008] [warn] NameVirtualHost *:80 has no VirtualHosts

Updated Nov 16, 2008: My first solution (below) didn't work, correct solution now immediately follows...

Looks like the problem was I had to NameVirtualHost statements, one in /etc/apache2/ports.conf and one in /etc/apache2/sites-enabled/000-default.

To fix the problem, I simply commented on the declaration in /etc/apache2/ports.conf:

grep NameVirtualHost /etc/apache2/ports.conf
#NameVirtualHost *:80

Old solution I posted, that turned out, did not work.

To fix this, I added a ServerName directive, as follows:

<virtualhost *:80>
    ServerName hostname
    ServerAdmin webmaster@localhost
Post a Comment