I have a problem that's just come up, and is very urgent:

I upgraded from apache 2.0 to apache 2.2, and now all my virtual hosts are ignored. I'm running a debian server, and I completely upgraded to the new apache2 config file.

in sites-enabled i have all my links to sites-available, which worked perfectly fine before!

When I start the server I get:

Reloading web server config: apache2[Sat Oct 17 16:34:22 2009] [warn] NameVirtualHost *:80 has no VirtualHosts

One of the sites-enabled files:

<VirtualHost *:80>
    ServerName www.domain.com
    ServerAdmin hostmaster@domain.com
    DocumentRoot /document/root
    ErrorLog /document/root/error_log
    CustomLog /document/root/access_log combined
</VirtualHost>

Any ideas?? Thanks in advance.

link|improve this question
feedback

2 Answers

up vote 2 down vote accepted

Ok I found the problem:

Some of my sites-enabled/* files had only:

<VirtualHost *>

Without the port number... This caused all the other sites to stop working.

link|improve this answer
feedback

You should have added the

NameVirtualHost *:80

Directive above the virtualhost where you declared it - this would have allowed all your configs to work as expected.

The documentation is reasonably clear for this http://httpd.apache.org/docs/2.0/vhosts/examples.html

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.