我在RHEL 7.2服务器上安装了Apache Httpd 2.4.6和Tomcat 7.0.54,并配置了AJP连接器并配置了SSL并启用了SELinux。
当我启动Tomcat服务器时,一切都很顺利,Web应用程序也正常工作。但是,如果您运行# service tomcat status
或systemctl status tomcat
,我会得到以下输出。
[root@ip-xxx-xxx-xxx-xxx logs]# service tomcat status
Redirecting to /bin/systemctl status tomcat.service
● tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2016-03-24 15:34:30 UTC; 1h 38min ago
Process: 5929 ExecStop=/usr/libexec/tomcat/server stop (code=exited, status=0/SUCCESS)
Main PID: 5973 (java)
CGroup: /system.slice/tomcat.service
└─5973 /usr/lib/jvm/jre/bin/java -Xms512m -Xmx3072m -classpath /usr/share/tomcat/bin/bootstrap.jar:/usr/share/tomcat/bin/tomcat-juli.jar:/usr/share/java/commons-daemon.jar -Dcata...
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1040)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:607)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:314)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
Mar 24 16:44:09 ip-xxx-xxx-xxx-xxx.eu-west-1.compute.internal server[5973]: at java.lang.Thread.run(Thread.java:745)
我没有在Tomcat日志上看到任何错误。将SELinux设置为允许不能解决问题。 我如何诊断问题是什么并修复它?
答案 0 :(得分:3)
systemctl status tomcat
的问题在于它只会显示来自服务的最新日志条目
journalctl -x -u tomcat
将显示上次日记帐轮次的日志条目。