shell > /usr/local/tomcat2/bin/shutdown.sh # 现在单独关闭任何一个 别的都不受影响
Using CATALINA_BASE: /usr/local/tomcat2
Using CATALINA_HOME: /usr/local/tomcat2
Using CATALINA_TMPDIR: /usr/local/tomcat2/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/tomcat2/bin/bootstrap.jar:/usr/local/tomcat2/bin/tomcat-juli.jar
shell > ps aux | grep java
root 1381 1.2 8.4 2270676 86572 pts/0 Sl 16:53 0:06 /usr/bin/java -Djava.util.logging.config.file=/usr/local/tomcat1/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/tomcat1/endorsed -classpath /usr/local/tomcat1/bin/bootstrap.jar:/usr/local/tomcat1/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat1 -Dcatalina.home=/usr/local/tomcat1 -Djava.io.tmpdir=/usr/local/tomcat1/temp org.apache.catalina.startup.Bootstrap start
root 1441 1.2 8.6 2270836 87804 pts/0 Sl 16:54 0:06 /usr/bin/java -Djava.util.logging.config.file=/usr/local/tomcat3/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/tomcat3/endorsed -classpath /usr/local/tomcat3/bin/bootstrap.jar:/usr/local/tomcat3/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat3 -Dcatalina.home=/usr/local/tomcat3 -Djava.io.tmpdir=/usr/local/tomcat3/temp org.apache.catalina.startup.Bootstrap start
root 1546 0.0 0.0 103248 864 pts/0 S+ 17:03 0:00 grep java
shell > netstat -anpt | grep java
tcp 0 0 :::8080 :::* LISTEN 1381/java
tcp 0 0 :::8082 :::* LISTEN 1441/java
tcp 0 0 :::8029 :::* LISTEN 1441/java
tcp 0 0 ::ffff:127.0.0.1:8005 :::* LISTEN 1381/java
tcp 0 0 ::ffff:127.0.0.1:8007 :::* LISTEN 1441/java
tcp 0 0 :::8009 :::* LISTEN 1381/java
## 可以启动、关闭任意 tomcat ,没有顺序之分。唯一注意的一点,就是启动有一个过程,需要稍微等等,不要急。
只需修改端口即可,无需按照网上所说,要设置变量、更改 catalina.sh 等文件(如有不对的地方,还请各位指正)
更多Tomcat相关教程见以下内容:
CentOS 6.6下安装配置Tomcat环境
RedHat Linux 5.5安装JDK+Tomcat并部署Java项目
Linux下使用Xshell查看Tomcat实时日志中文乱码解决方案