我在RHEL 7.2服务器上安装了Apache Http2.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设置为permissive并不能解决这个问题。我如何诊断问题并解决它?
2条答案
按热度按时间hk8txs481#
systemctl status tomcat
的问题是它只显示来自服务的最新日志条目其中
journalctl -x -u tomcat
将显示上次日志循环的日志条目。关于systemctl和journalctl的更多信息
okxuctiv2#
你好,我修复了这个问题,使用文件配置尝试我第一个tomcat.service,如果不工作,尝试另一个tomcat.service,维斯亦然
首个tomcat.service
第二个tomcat.service
如果第一个不工作,请替换为第二个,维斯亦然,请不要忘记使用sudo systemctl reload-daemon sudo systemctl start tomcat sudo systemctl enable tomcat sudo systemctl status tomcat