How to set apache virtualhost to work with ipv6?

Your apache config looks correct, but a little more complex than it needs to be if you want one site to be reachable over both IPv4 and IPv6 (dual stack).

Instead of

<VirtualHost ip.v4.address:80>
...
</VirtualHost>

<VirtualHost [ip.v6.address]:80>
...
</VirtualHost>

you can do

<VirtualHost ip.v4.address:80 [ip.v6.address]:80>
...
</VirtualHost>

That way the single virtual hosts listens on both IP addresses. It is a lot easier to maintain!

If you really want a different site on IPv6 then your configuration is correct of course.


This sounds like an IPv6 name resolution error rather than an Apache error. Check that the name resolves correctly to the address.


Does the name resolve to the correct IPv6 address? This seems to be problem in domain resolution.