We've got a webserver running Ubuntu 12.04 LTS, Tomcat 7 and Oracle Java. So far, we have been serving a web app on IPv4 address on ports 80 and 443 (80 redirects to 443).
I'm trying to make the tomcat serve same app on same ports also via IPv6. OS is configured for IPv6 correctly, it has its own IPv6 addresses with scope global.
What doesn't work is Tomcat/Java not listening on IPv6. Here is the output of netstat -tlpn:
tcp 0 0 0.0.0.0:2222 0.0.0.0:* LISTEN 957/sshd tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 2686/java tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 1058/postgres tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1243/master tcp 0 0 0.0.0.0:443 0.0.0.0:* LISTEN 2686/java tcp 0 0 127.0.0.1:8005 0.0.0.0:* LISTEN 2686/java tcp6 0 0 :::2222 :::* LISTEN 957/sshd tcp6 0 0 :::5432 :::* LISTEN 1058/postgres tcp6 0 0 ::1:25 :::* LISTEN 1243/master
As you can see, Java is listening only on tcp connections, while postgres and ssh accept also tcp6 connections on same ports as they do with IPv4.
I've found a property java.net.preferIPv4Stack=true in Tomcat startup script, but when I set this to false, tomcat started listening ONLY on tcp6 local, port 8005. I need it to also listen on :::443 and :::80. Also it disappeared from IPv4 connections, but i believe that ::: can bind both IP v4 and v6.
I should mention that I'm not a Java programmer, my responsibility is only the server itself. Also i don't want to do much experimenting, since this is a production server.
Any help is greatly appreciated! Cheers