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 email@example.com ServerName arcticdata.met.no DocumentRoot /metno/metamod/arcticdata/htdocs ... </VirtualHost>
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/ http://127.0.0.1:3011/ ProxyPassReverse /metamod/ http://127.0.0.1:3011/
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 126.96.36.199:80 overlaps with VirtualHost 188.8.131.52:80, 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.