Tomcat homepage inaccessible
i.e. Host not found ... http://ec2-xx-yy-218-150.ap-southeast-1.compute.amazonaws.com:8080/
After execute Tomcat you might found that it cannot access via the browser; This is might because of your networks did not support IPv6 yet. So, We will do force the Tomcat to operate with IPv4 only.
Solution
- Shutdown the Tomcat
- Edit catalina.sh
Add java options JAVA_OPTS. See the code below:
...
#
# LOGGING_MANAGER (Optional) Override Tomcat's logging manager
# Example (all one line)
# LOGGING_MANAGER="-Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager"
# --------------------------------------------------------------------
JAVA_OPTS=" -Djava.net.preferIPv4Stack=true "
# OS specific support. $var _must_ be set to either true or false.
cygwin=false
darwin=false
...
- Startup Tomcat; It should be accessible now ;)
Command to check if Tomcat running(binding) with IPv6
$ netstat -ant
...
tcp6 0 0 :::8080 :::* LISTEN
...
After catalina.sh modification
$ netstat -ant
...
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
...