I have an ubuntu hardy server used as a web server with Apache 2.2. I am trying to set it up with named virtual hosts, and in my /etc/apache2/apache2.conf file I have the following lines:

NameVirtualHost *
Include /etc/apache2/sites-enabled/

I have two files in sites-enabled. One of them containing:

<VirtualHost *>
        ServerAdmin webmaster@met.no
        ServerName arcticdata.met.no
        DocumentRoot /metno/metamod/arcticdata/htdocs

The other is similar, but with another ServerName and DocumentRoot.

If I run apachectl configtest I get the following warning:

[warn] NameVirtualHost *:0 has no VirtualHosts

But anyway it seems the virtual host mechanism is working, since I get to an index.html file placed in DocumentRoot in both cases.

But I also use redirect to a catalyst process on the same server, and these redirects does not seem to work:

ProxyPass           /metamod/
ProxyPassReverse    /metamod/

Hovever, If I enter the IP address and port number in the -directive (in place of *), these redirects suddenly works. But then I have another problem. Now running apachectl configtest gives the following output:

[warn] VirtualHost overlaps with VirtualHost, the first has precedence, perhaps you need a NameVirtualHost directive
[warn] NameVirtualHost *:0 has no VirtualHosts

and only the first virtual host work.

I am also running a similar setup on a lucid box, and this works OK. Are there changes in how Apache 2.2 is configured between hardy and lucid? The hardy box has Apache 2.2.8 and the lucid box has Apache 2.2.14.

Any suggestions appreciated.


  • Not contributing to any solution: are you aware that hardy is very near to its End Of Life? – guntbert Mar 5 '13 at 17:37
  • I know, and the box will soon be upgraded. But I need it to work now. – Egil Støren Mar 6 '13 at 8:15

I would recommend that you use the address:port notation as specified in the apache manual:


Probably something has changed in the apache code, since it looks like it defaults to port 0 in hardy, but your websites default to port 80.

E.g. change it to:

NameVirtualHost *:80


<VirtualHost *:80>

If that doesn't work then use:




Correct your apache configuration so that the aprobiate ports are clear.

 NameVirtualHost *:80
 NameVirtualHost *:443


<VirtualHost *:80>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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