如何查看tomcat版本_tomcat修改端口号

2022-09-27 14:15:25 浏览数 (1)

大家好,又见面了,我是你们的朋友全栈君。

一、通过tomcat版本文件查看

  找到tomcat目录,进入”xxx/tomcat/bin” 目录,执行”sh version.sh”。如果没有设置JAVA_HOME和JRE_HOME环境变量则会报如下错误:

代码语言:javascript复制
[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环境变量:

代码语言:javascript复制
export JAVA_HOME=xxx/java/
export JRE_HOME=xxx/java/jre/

  执行”sh version.sh”返回当前tomcat版本信息:

代码语言:javascript复制
$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启动文件查看

  找到tomcat启动文件,本文是yyy/tomcat_stdout.log,搜索”Starting Servlet Engine”则可看到当前启动的容器版本。

代码语言:javascript复制
...
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
...

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/189616.html原文链接:https://javaforall.cn

0 人点赞