Reputation: 51
New to Tomcat. Downloaded and unpacked tomcat 8.0.9 to my CentOS web server. Placed files in /opt/tomcat.
/opt/tomcat/bin/setenv.sh contains:
JRE_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java CATALINA_PID="$CATALINA_BASE/tomcat.pid"
My environment variable for CATALINA_HOME is set to /opt/tomcat, double checked by using:
set | grep CATALINA_HOME
CATALINA_HOME=/opt/tomcat
Running /opt/tomcat/bin/startup.sh outputs:
/opt/tomcat/bin/startup.sh
Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar Using CATALINA_PID: /opt/tomcat/tomcat.pid Existing PID file found during start. Removing/clearing stale PID file. Tomcat started.
However, it doesn't really start. When I check netstat there is nothing listening on 8080:
netstat -tulpn
Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1303/sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 1065/master tcp 0 0 :::80 :::* LISTEN 1504/httpd tcp 0 0 :::22 :::* LISTEN 1303/sshd tcp 0 0 ::1:25 :::* LISTEN 1065/master tcp 0 0 :::443 :::* LISTEN 1504/httpd
and no process named tomcat
ps aux | grep "tomcat"
root 15193 0.0 0.0 103244 852 pts/0 S+ 08:40 0:00 grep tomcat
Finally, when I run the shutdown.sh script it confirms that there was no tomcat process running even though the .pid file was created.
/opt/tomcat/bin/shutdown.sh
Using CATALINA_BASE: /opt/tomcat Using CATALINA_HOME: /opt/tomcat Using CATALINA_TMPDIR: /opt/tomcat/temp Using JRE_HOME: /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar Using CATALINA_PID: /opt/tomcat/tomcat.pid PID file found but no matching process was found. Stop aborted.
Any help is greatly appreciated!!!!
Upvotes: 2
Views: 8737
Reputation: 51
JRE_HOME variable was incorrect. It was pointed to the actual java binary rather than the java folder.
JRE_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java
was replaced with:
JRE_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
in the $CATALINA_HOME/bin/setenv.sh file.
Discovered the problem after looking at the $CATALINA_HOME/logs/catalina.out file and seeing error messaging that the JRE_HOME variable was not a valid folder.
Upvotes: 1