SixXS::Sunset 2017-06-06

Apache: IPv6-only virtual host
[at] Shadow Hawkins on Monday, 27 July 2009 20:18:20
Hello, My webserver is reachable via IPv4 and newly also via IPv6. I have set:
NameVirtualHost *:80 Listen 80
(Debian lenny default). After that, I have tons of named based virtual hosts:
<VirtualHost *:80> ServerName ... ... </VirtualHost>
This setup is working quite well: All my virtual hosts are reachable with IPv4 and also IPv6. But now I want to have a single (named based!) virtual host which is only reachable via IPv6. So I have added:
<VirtualHost [2001:8b3:3cf:3::173]:80> HostName ... </VirtualHost>
But now all IPv6-queries are directed to this virtual host. But only should be directed here. And this should only happen on IPv6 requests. What I am doing wrong? Best regards, Niki
Apache: IPv6-only virtual host
[be] Shadow Hawkins on Tuesday, 28 July 2009 10:35:29
Hi Nikolaus, I've experienced similar problems with Apache resulting in the behaviour that you describe. The workaround I found is doing to following: Create a new virtualhost with a name starting with the letter a, e.g. It should look like this: <VirtualHost [ipv6-ip]:80> HostName ... </VirtualHost> The hostname doesn't need to exist as a real dns-entry, but it should take alphabetical preference over the This is because it seems Apache is loading the virtual servers in alphabetical order (at least on my system). After you've applied the new config, all IPv6 requests should go to the newly created VirtualHost, except those for the explicitly created one. This is probably quite the ugly workaround, there might be better ways, but this is the one I got working for me ;-). I've looked around on the web and no offered solutions there seemed to work for me (but my setup is a bit different from yours however, so that also might be a reason). Anyway, I hope this gets you going. Good luck! Regards, Gunther
Apache: IPv6-only virtual host
[at] Shadow Hawkins on Tuesday, 28 July 2009 13:45:47
Hello, And thank you for your reply! Strange, because the same behaviour works well with SSL enabled sites (*:443). However I would like to keep my Apache config as much as possible (Debian defaults). So finally I did
ip -6 addr add 2001:7b8:3cd:3::1731/64 dev eth0
, added the DNS records and made a "real" (i.e. non name-based) virtual host:
<VirtualHost [2001:7b8:3cd:3::1731]> ServerName DocumentRoot /srv/www/ </VirtualHost>
Regards, Niki

Please note Posting is only allowed when you are logged in.

Static Sunset Edition of SixXS
©2001-2017 SixXS - IPv6 Deployment & Tunnel Broker