Tomcat 8說它開始了,但是沒有在Linux / CentOS上運行。

[英]Tomcat 8 says it started but is not running on Linux / CentOS


New to Tomcat. Downloaded and unpacked tomcat 8.0.9 to my CentOS web server. Placed files in /opt/tomcat.

Tomcat。在我的CentOS web服務器上下載並打開tomcat 8.0.9。把文件放在/ opt / tomcat。

/opt/tomcat/bin/setenv.sh contains:

/ opt / tomcat / bin / setenv。sh包含:

JRE_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java CATALINA_PID="$CATALINA_BASE/tomcat.pid"

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:

我對CATALINA_HOME的環境變量設置為/opt/tomcat,使用:

set | grep CATALINA_HOME

集| grep CATALINA_HOME

CATALINA_HOME=/opt/tomcat

CATALINA_HOME = / opt / tomcat

Running /opt/tomcat/bin/startup.sh outputs:

運行/ opt / tomcat / bin /啟動。sh輸出:

/opt/tomcat/bin/startup.sh

/ 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.

使用CATALINA_BASE: /opt/tomcat使用CATALINA_HOME: /opt/tomcat使用CATALINA_TMPDIR: /opt/tomcat/temp使用JRE_HOME: /usr/lib/jvm/jre-1.7.0-openjdk。x86_64 / bin / java使用類路徑:/ opt / tomcat / bin / bootstrap.jar:/ opt / tomcat / bin / tomcat-juli。使用CATALINA_PID jar:/ opt / tomcat / tomcat。在開始時發現的pid的pid文件。刪除/清除陳舊的PID文件。Tomcat啟動。

However, it doesn't really start. When I check netstat there is nothing listening on 8080:

然而,它並沒有真正開始。當我檢查netstat的時候,沒有什么可以監聽8080:

netstat -tulpn

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

活躍的互聯網連接(只有服務器)原型Recv-Q Send-Q本地地址外國地址狀態PID /程序名tcp 0 0 0.0.0.0:22 0.0.0.0:* 1303(聽/ sshd tcp 0 0 127.0.0.1:25 0.0.0.0:* 1065 /聽大師tcp 0 0:::80:::* 1504聽/ httpd tcp 0 0:::22:::* 1303聽/ sshd tcp 0 0:1:25:::* 1065 /聽大師tcp 0 0:::443:::* 1504 / httpd聽

and no process named tomcat

沒有進程命名為tomcat。

ps aux | grep "tomcat"

pb0 grep "tomcat"

root 15193 0.0 0.0 103244 852 pts/0 S+ 08:40 0:00 grep tomcat

根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.

最后,當我運行關閉。sh腳本確認,即使創建了.pid文件,也沒有運行tomcat進程。

/opt/tomcat/bin/shutdown.sh

/ 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.

使用CATALINA_BASE: /opt/tomcat使用CATALINA_HOME: /opt/tomcat使用CATALINA_TMPDIR: /opt/tomcat/temp使用JRE_HOME: /usr/lib/jvm/jre-1.7.0-openjdk。x86_64 / bin / java使用類路徑:/ opt / tomcat / bin / bootstrap.jar:/ opt / tomcat / bin / tomcat-juli。使用CATALINA_PID jar:/ opt / tomcat / tomcat。發現了pid pid文件,但沒有找到匹配的過程。停止中止。

Any help is greatly appreciated!!!!

任何幫助都非常感謝!!!!

1 个解决方案

#1


1  

JRE_HOME variable was incorrect. It was pointed to the actual java binary rather than the java folder.

JRE_HOME變量是不正確的。它指向的是實際的java二進制文件,而不是java文件夾。

JRE_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java

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

JRE_HOME = / usr / lib / jvm / jre-1.7.0-openjdk.x86_64

in the $CATALINA_HOME/bin/setenv.sh file.

在CATALINA_HOME / bin / setenv美元。sh文件。

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.

發現了問題后,看了$CATALINA_HOME/logs/catalina。輸出文件和查看錯誤消息,JRE_HOME變量不是一個有效的文件夾。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:https://www.itdaan.com/blog/2014/08/02/72093f76f28f406256a71ed88662864c.html



 
粤ICP备14056181号  © 2014-2020 ITdaan.com