I have an Ubuntu 12.04 server with a number of IPv4 addresses and a /64 of IPv6 addresses. I have it responding to its IPv6 addresses with ping6. I'd like the domains hosted on the server to go dual-stack, so IPv6-enabled visitors will be able to access its sites over IPv6, and everyone else will use IPv4.
Here's the relevant parts of my Apache config as it stands now:
ports.conf:
NameVirtualHost 199.192.201.82:80
Listen 199.192.201.82:80
Listen [2607:ff50:0:21::2]:80
httpd.conf:
<VirtualHost 199.192.201.82:80>
ServerName cdc.nexussl.net
DirectoryIndex index.php
DocumentRoot /var/www
LogLevel warn
ErrorLog /var/www/error.log
CustomLog /var/www/access.log combined
</VirtualHost>
<VirtualHost 199.192.201.82:80>
ServerName ipv6.nexussl.net
DirectoryIndex index.php
DocumentRoot /var/www
LogLevel warn
ErrorLog /var/www/error.log
CustomLog /var/www/access.log combined
</VirtualHost>
<VirtualHost 199.192.201.82:80>
ServerName dual.nexussl.net
DirectoryIndex index.php
DocumentRoot /var/www
LogLevel warn
ErrorLog /var/www/error.log
CustomLog /var/www/access.log combined
</VirtualHost>
cdc.nexussl.net has an A record pointing to 199.192.201.82, ipv6.nexussl.net has a AAAA record pointing to 2607:ff50:0:21::2, and dual.nexussl.net has both an A and a AAAA record.
With that setup, IPv4 works fine (They should all display a "You look lost" page), but visiting ipv6.nexussl.net or dual.nexussl.net from an IPv6-capable machine returns
Not Found
The requested URL / was not found on this server.
Apache/2.2.22 (Ubuntu) Server at ipv6.nexussl.net Port 80
dual.nexussl.net works correctly on an IPv4-only connection. Ultimately, I'd like all sites to be set up in DNS like dual.nexussl.net, with both A and AAAA records.
In Apache's config, I can't just use Listen 80, because other applications on that server use port 80 on other IPs. Apache should only use 199.192.201.82 as far as IPv4 goes.
As far as IPv6, should I give each site its own IPv6 address, and they'll just share one IPv4? I feel like that could get messy listing an IPv6 address in ports.conf for every site. Even if I'm having them all share an IPv6 address, how do I get Apache to serve sites correctly over IPv6?