"NameVirtualHost *:80 has no VirtualHosts"

I have successfully set up two virtual servers on my Debian Squeeze Linode. My browser sees both sites, and both are operating normally. But when I restart Apache, I get this:

root@everything: /etc/init.d/apache2 reload

Reloading web server config: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName

[warn] NameVirtualHost *:80 has no VirtualHosts

Can anyone tell me why I get this warning?

Here is one of the two files, bookgenius.org, that's in the sites-available directory:

# # Admin email, Server Name (domain name) and any aliases

ServerAdmin morgan@bookgenius.org

ServerName bookgenius.org

ServerAlias www.bookgenius.org www.bookgenius.com bookgenius.com

Index file and Document Root (where the public files are located)

DirectoryIndex index.html

DocumentRoot /var/www/bookgenius.org/html/

CGI Directory

ScriptAlias /cgi-bin/ /var/www/bookgenius.org/cgi-bin/

Options +ExecCGI

AddHandler cgi-script .pl

Custom log file locations

LogLevel warn

ErrorLog /var/www/bookgenius.org/logs/error.log

CustomLog /var/www/bookgenius.org/logs/access.log combined

Thanks,

  • Chris

3 Replies

Somewhere in your config, you have "NameVirtualHost *:80" (a commonly sensible default), but you don't have "" anywhere. This is usually human error, but won't directly break things. Every distinct should (must?) have a corresponding NameVirtualHost $BLAH, and likewise, every NameVirtualHost $BLAH should have at least one .

("apache2ctl -S" could explain what it is trying to do better than I can.)

Many thanks – I'll check my config!

cpmorgan, if you use vim as your editor, you can open the apache config and type ? (question mark) then *:80 after Press enter.

Your command should look like ?\*:80

This should make your job easier :P

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct