赞
踩
找到tomcat目录,进入”xxx/tomcat/bin” 目录,执行”sh version.sh”。如果没有设置JAVA_HOME和JRE_HOME环境变量则会报如下错误:
[jerry@host xxx/tomcat/bin]
$sh version.sh
Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
At least one of these environment variable is needed to run this program
设置JAVA_HOME和JRE_HOME环境变量:
export JAVA_HOME=xxx/java/
export JRE_HOME=xxx/java/jre/
执行”sh version.sh”返回当前tomcat版本信息:
$sh version.sh
Using CATALINA_BASE: xxx/tomcat
Using CATALINA_HOME: xxx/tomcat
Using CATALINA_TMPDIR: xxx/tomcat/temp
Using JRE_HOME: xxx/java/jre/
Using CLASSPATH: xxx/tomcat/bin/bootstrap.jar:xxx/tomcat/bin/tomcat-juli.jar
Using CATALINA_PID: xxx/tomcat/catalina.pid
Server version: Apache Tomcat/7.0.47
Server built: Jan 10 2014 01:31:08
Server number: 7.0.47.0
OS Name: Linux
OS Version: 3.10.0-327.2016.os7.x86_64
Architecture: amd64
JVM Version: 1.8.0_66-b60
JVM Vendor: "mmm"
找到tomcat启动文件,本文是yyy/tomcat_stdout.log,搜索”Starting Servlet Engine”则可看到当前启动的容器版本。
...
2018-07-31 19:06:27,446 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Dcatalina.home=xxx/tomcat
2018-07-31 19:06:27,447 org.apache.catalina.startup.VersionLoggerListener log
INFO: Command line argument: -Djava.io.tmpdir=/zzz/.default/temp
2018-07-31 19:06:27,571 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-7001"]
2018-07-31 19:06:27,586 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 842 ms
2018-07-31 19:06:27,628 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
2018-07-31 19:06:27,629 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.59.463
...
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。