Apache, vHosts and IPv6.
http://www.iwader.co.uk/ip.php
I have got apache listening on ipv6 and can be accessed through http://[2002:b24f:a6c3:1000::1]/
However when it comes viewing my domain, its only then accessed over ipv4, even though the relevant AAAA records are present on an nslookup.
My VirtualHost is listening on *:80. However the fact apache itself seems to be accessible via. ipv6, it leads me to believe this is a problem with my VirtualHost.
Heres the output of the nslookup:
C:\Users\Wade>nslookup
Default Server: disco.gogo6.com
Address: 2001:5c0:1000:
> set q=AAAA
> www.iwader.co.uk
Server: disco.gogo6.com
Address: 2001:5c0:1000:
Non-authoritative answer:
Name: www.iwader.co.uk
Address: 2002:b24f:a6c3:1000::1
I then have a VirtualHost for both IPv6 and IPv4 after defining both NameVirtualHost in the apache ports.conf.
NameVirtualHost 178.79.166.195
NameVirtualHost [2002:b24f:a6c3:1000::1]
Listen 178.79.166.195:80
Listen [2002:b24f:a6c3:1000::1]:80
<virtualhost 178.79.166.195="">DocumentRoot /var/www/iwader.co.uk/web
ServerName iwader.co.uk
ServerAlias *.iwader.co.uk
ServerAdmin webmaster@iwader.co.uk</virtualhost>
<virtualhost [2002:b24f:a6c3:1000::1]="">DocumentRoot /var/www/iwader.co.uk/web
ServerName iwader.co.uk
ServerAlias *.iwader.co.uk
ServerAdmin webmaster@iwader.co.uk</virtualhost>
6 Replies
<virtualhost 178.79.166.195="" [2002:b24f:a6c3:1000::1]="">DocumentRoot /var/www/iwader.co.uk/web
ServerName iwader.co.uk
ServerAlias *.iwader.co.uk
ServerAdmin webmaster@iwader.co.uk</virtualhost>
-James
@irgeek:
I haven't tested this yet, but I think you need to combine the VirtualHost sections when they have the same ServerName. The Apache docs don't seem to cover how to do dual-stack.
<virtualhost 178.79.166.195="" [2002:b24f:a6c3:1000::1]="">DocumentRoot /var/www/iwader.co.uk/web ServerName iwader.co.uk ServerAlias *.iwader.co.uk ServerAdmin webmaster@iwader.co.uk</virtualhost>
-James
Hmm still no avial, its only being accessed via. ipv4.
There is a strange side effect though that causes all my clients sites to be redirected to mine, however i can solve this problem by updating the sites vhost with the new NameVirtualHosts. I will do this once i can get my site online for ipv6 and update my clients.
In any case, everything looks fine from here:
rtucker@witte:~$ curl -4 iwader.co.uk | head
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
101 1628 101 1628 0 0 6150 0 --:--:-- --:--:-- --:--:-- 12149
<title>iWader - Ramblings of a web developer</title>
rtucker@witte:~$ curl -6 iwader.co.uk | head
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
101 1628 101 1628 0 0 4573 0 --:--:-- --:--:-- --:--:-- 11305
<title>iWader - Ramblings of a web developer</title>
rtucker@witte:~$ curl -4 www.iwader.co.uk | head
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
101 1628 101 1628 0 0 5394 0 --:--:-- --:--:-- --:--:-- 12149
<title>iWader - Ramblings of a web developer</title>
rtucker@witte:~$ curl -6 www.iwader.co.uk | head
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
101 1628 101 1628 0 0 5604 0 --:--:-- --:--:-- --:--:-- 13344
<title>iWader - Ramblings of a web developer</title>
However i believe what mnordhoff is correct as i have accessed the page via. lynx and confirms it is accessible via. ipv6.
"As per RFC3484 §2.1 default policy table, having a 6to4 enabled LAN will mean that 6to4 IPv6 will only be used to communicate to a server if the server is having a 6to4 adress too (ie: 2002: prefix on its address) or if there is no IPv4 address assigned to the server name (ie: no A but an AAAA)."
I think that is your problem. It's working as intended, but not as desired in your use case. :)