Apache, vHosts and IPv6.

I'm trying to get my website working with ipv6, however failing miserably for the past couple of days tinkering. I've setup a page here to test 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]/ successfully viewing the apache default page.

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

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

@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.

It's using a 6to4 IP address. Clients typically prioritize IPv4 over 6to4, since 6to4 is just IPv4 only with overhead and bad routing. If you were using an HE tunnel, or London had native IPv6 (soon!), clients would prefer IPv6 over IPv4.

Is the accidentally missing from the copy/paste, or is it not there in the original? I could see omitting the closing tags causing this sort of thing to perhaps happen.

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>

@hoopycat i only pasted the relevant info from the VirtualHost which is the first couple of lines, the rest of it is just php and logging configurations etc.

However i believe what mnordhoff is correct as i have accessed the page via. lynx and confirms it is accessible via. ipv6.

mnordhoff has it.

http://social.technet.microsoft.com/For … e5d7d9704f">http://social.technet.microsoft.com/Forums/en/w7itpronetworking/thread/b4d504c8-2ae9-41f3-bf21-e2e5d7d9704f

"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)."

http://www.ietf.org/rfc/rfc3484.txt

I think that is your problem. It's working as intended, but not as desired in your use case. :)

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct