https://issues.apache.org/bugzilla/show_bug.cgi?id=53583
Priority: P2 Bug ID: 53583 Assignee: dev@tomcat.apache.org Summary: Tomcat 7.0.27 ignores 'use IPv4' JAVA_OPTS in tomcat.conf, listens only @IPv6 localhost when separate IPv4/IPv6 sockets are specified Severity: major Classification: Unclassified OS: Linux Reporter: k9...@operamail.com Hardware: All Status: NEW Version: 7.0.27 Component: Catalina Product: Tomcat 7 I've installed rpm -qa | grep -i ^tomcat tomcat-lib-7.0.27-7.1.noarch tomcat-docs-webapp-7.0.27-7.1.noarch tomcat-javadoc-7.0.27-7.1.noarch tomcat-webapps-7.0.27-7.1.noarch tomcat-admin-webapps-7.0.27-7.1.noarch tomcat-servlet-3_0-api-7.0.27-7.1.noarch tomcat-7.0.27-7.1.noarch tomcat-el-2_2-api-7.0.27-7.1.noarch tomcat-jsp-2_2-api-7.0.27-7.1.noarch with update-alternatives --config java There are 2 choices for the alternative java (providing /usr/bin/java). Selection Path Priority Status ------------------------------------------------------------ 0 /usr/lib64/jvm/jre-1.7.0-openjdk/bin/java 17147 auto mode * 1 /usr/lib64/jvm/jre-1.7.0-openjdk/bin/java 17147 manual mode 2 /usr/lib64/jvm/jre-1.7.0-sun/bin/java 1700 manual mode on uname -a Linux svr 3.1.10-1.16-desktop #1 SMP PREEMPT Wed Jun 27 05:21:40 UTC 2012 (d016078) x86_64 x86_64 x86_64 GNU/Linux This server is configured for dual-stack, with separate sockets intenionally/necessarily specified for IPv6: grep bindv6only /etc/sysctl.conf net.ipv6.bindv6only = 1 as defined at: https://www.kernel.org/doc/man-pages/online/pages/man7/ipv6.7.html IPV6_V6ONLY (since Linux 2.4.21 and 2.6) If this flag is set to true (nonzero), then the socket is restricted to sending and receiving IPv6 packets only. In this case, an IPv4 and an IPv6 application can bind to a single port at the same time. If this flag is set to false (zero), then the socket can be used to send and receive packets to and from an IPv6 address or an IPv4-mapped IPv6 address. The argument is a pointer to a boolean value in an integer. The default value for this flag is defined by the contents of the file /proc/sys/net/ipv6/bindv6only. The default value for that file is 0 (false). I need Tomcat to listen/respond on IPv4 localhost @ 127.0.0.1. So, reading here - http://tomcat.10.n6.nabble.com/Tomcat-uses-IPv6-td2164369.html#a2164371 - and elsewhere, I set vi /etc/tomcat/tomcat.conf ... JAVA_OPTS="Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true" CATALINA_OPTS="Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true" ... now, @ tomcat start, ps ax | grep tomcat 6530 ? Sl 0:03 /etc/alternatives/jre/bin/java -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true -classpath :/usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcatalina.base=/usr/share/tomcat -Dcatalina.home=/usr/share/tomcat -Djava.endorsed.dirs= -Djava.io.tmpdir=/var/cache/tomcat/temp -Djava.util.logging.config.file=/usr/share/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager org.apache.catalina.startup.Bootstrap start but, Tomcat still listens only on IPv6 @ port 8080, sudo netstat -tlpn | grep java tcp 0 0 :::8080 :::* LISTEN 13005/java tcp 0 0 127.0.0.1:8795 :::* LISTEN 9388/java tcp 0 0 127.0.0.1:8005 :::* LISTEN 13005/java tcp 0 0 :::8009 :::* LISTEN 13005/java and is unavailable/unreachable @ 127.0.0.1 telnet 127.0.0.1 8080 Trying 127.0.0.1... telnet: connect to address 127.0.0.1: Connection refused telnet ::1 8080 Trying ::1... Connected to ::1. Escape character is '^]'. telnet> reading here on this issue: http://linux.derkeiler.com/Mailing-Lists/Debian/2009-12/msg01262.html " ... Thus you should report a bug against Tomcat. Also you can replace "net.ipv6.bindv6only=1" with "net.ipv6.bindv6only=0" in your /etc/sysctl.d/ as a temporary solution. ..." which, as per above, is not a viable/acceptable workaround. Fwiw, in this config, any/all other apps on the box (nginx, varnish, apache, bind, dhcp(6), firewall, etc) are easily configured to listen on IPv4 &/or IPv6 (non)localhost addresses. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org