Increase visibility into IT operations to detect and resolve technical issues before they impact your business.
Learn More
Go to Insights
Engage with our Red Hat Product Security team, access security updates, and ensure your environments are not exposed to any known security vulnerabilities.
Product Security Center
Keep your systems secure with Red Hat's specialized responses to security vulnerabilities.
View Responses
Expand section "2.2.2.1. Managing JBoss Web Server using a system daemon for .zip installations on Red Hat Enterprise Linux"
Collapse section "2.2.2.1. Managing JBoss Web Server using a system daemon for .zip installations on Red Hat Enterprise Linux"
In Java there are 2 properties that are used to configure IPv4 and IPv6. These are
java.net.preferIPv4Stack
and
java.net.preferIPv6Addresses
.
java.net.preferIPv4Stack (default: false)
If IPv6 is available then the underlying native socket, by default, is an IPv6 socket. This socket lets applications connect and accept connections from IPv4 and IPv6 hosts. If application use only IPv4 sockets, then set this property to
true
. However, it will not be possible for the application to communicate with IPv6 only hosts.
java.net.preferIPv6Addresses (default: false)
If a host has both IPv4 and IPv6 addresses, and IPv6 is available, then the default behavior is to use IPv4 addresses over IPv6. This allows backward compatibility. If applications that depend on an IPv4 address representation, for example: 192.168.1.1. Then, set this property to
true
to change the preference and use IPv6 addresses over IPv4 where possible.
To pass these properties to Tomcat, set
CATALINA_OPTS
in the
JWS_HOME
/tomcat/bin/setenv.*
file.
If the
JWS_HOME
/tomcat/bin/setenv.sh
or
JWS_HOME
/tomcat/bin/setenv.bat
file does not exist, then you need to create one.
On Linux:
export "CATALINA_OPTS=-Djava.net.preferIPv4Stack=
YOUR_VALUE
-Djava.net.preferIPv6Addresses=
YOUR_VALUE
"
On Windows:
set "CATALINA_OPTS=-Djava.net.preferIPv4Stack=
YOUR_VALUE
-Djava.net.preferIPv6Addresses=
YOUR_VALUE
"
The Tomcat bindings can be set in
JWS_HOME
/tomcat/conf/server.xml
with the IPv6 address:
Specify the Tomcat binding address:
<Server … address="
TOMCAT_BINDING_ADDRESS
">
Specify the HTTP connector address:
<Connector protocol="HTTP/1.1" … address="
HTTP_CONNECTOR_ADDRESS
">
Specify the AJP connector address:
<Connector protocol="AJP/1.3" … address="
AJP_CONNECTOR_ADDRESS
">