linux本地检测如何tomcat是否启动成功?
解决方法:
1.curl 127.0.0.1:8080
第一可以知道本地是否可以访问tomcat,返回页面代码
2.tail -f ./catalina.out
查看tomcat的logs目录下的catalina.out文件,看到末尾有
22-Jun-2018 12:39:50.343 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 240280 ms,说明启动成功。
3.ps -ef|grep tomcat
如果返回一大串东西,说明tomcat启动成功。root 4479 1 0 12:35 pts/0 00:00:05 /usr/local/java/jdk1.8.0_162/bin/java -Djava.util.logging.config.file=/usr/local/apache-tomcat-8.5.31/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -classpath /usr/local/apache-tomcat-8.5.31/bin/bootstrap.jar:/usr/local/apache-tomcat-8.5.31/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/apache-tomcat-8.5.31 -Dcatalina.home=/usr/local/apache-tomcat-8.5.31 -Djava.io.tmpdir=/usr/local/apache-tomcat-8.5.31/temp org.apache.catalina.startup.Bootstrap start
4.jps -v 结果中21702 Bootstrap代表有java程序的pid是21702
[root@VM_0_4_centos bin]# jps -v
21718 Jps -Denv.class.path=.:/usr/local/java/jdk1.8.0_192/lib:/usr/local/java/jdk1.8.0_192/jre/lib -Dapplication.home=/usr/local/java/jdk1.8.0_192 -Xms8m
21702 Bootstrap -Djava.util.logging.config.file=/usr/local/java/tomcat8/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -Dorg.apache.catalina.security.SecurityListener.UMASK=0027 -Dignore.endorsed.dirs= -Dcatalina.base=/usr/local/java/tomcat8 -Dcatalina.home=/usr/local/java/tomcat8 -Djava.io.tmpdir=/usr/local/java/tomcat8/temp
本文地址:http://www.yayihouse.com/yayishuwu/chapter/1310