shell > /usr/local/tomcat2/bin/startup.sh # 启动 tomcat2
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
Tomcat started.
shell > /usr/local/tomcat3/bin/startup.sh # 启动 tomcat3
Using CATALINA_BASE: /usr/local/tomcat3
Using CATALINA_HOME: /usr/local/tomcat3
Using CATALINA_TMPDIR: /usr/local/tomcat3/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/local/tomcat3/bin/bootstrap.jar:/usr/local/tomcat3/bin/tomcat-juli.jar
Tomcat started.
shell > netstat -anpt | grep java # 这种情况是 tomcat 还没有完全启动,稍等即可
tcp 0 0 :::8080 :::* LISTEN 1381/java
tcp 0 0 :::8081 :::* LISTEN 1411/java
tcp 0 0 :::8082 :::* LISTEN 1441/java
tcp 0 0 :::8019 :::* LISTEN 1411/java
tcp 0 0 :::8029 :::* LISTEN 1441/java
tcp 0 0 :::8009 :::* LISTEN 1381/java
shell > tail /usr/local/tomcat3/logs/catalina.out # 日志中也没有出来服务启动成功的标志
31-Oct-2014 16:54:02.840 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
31-Oct-2014 16:54:03.619 INFO [main] org.apache.catalina.core.AprLifecycleListener.init The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib
31-Oct-2014 16:54:04.374 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8082"]
31-Oct-2014 16:54:04.431 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
31-Oct-2014 16:54:04.442 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8029"]
31-Oct-2014 16:54:04.457 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
31-Oct-2014 16:54:04.461 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1811 ms
31-Oct-2014 16:54:04.597 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
31-Oct-2014 16:54:04.601 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.14
31-Oct-2014 16:54:04.628 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat3/webapps/host-manager
shell > netstat -anpt | grep java # 现在 tomcat1/2/3 都已经全部启动
tcp 0 0 :::8080 :::* LISTEN 1381/java
tcp 0 0 :::8081 :::* LISTEN 1411/java
tcp 0 0 :::8082 :::* LISTEN 1441/java
tcp 0 0 :::8019 :::* LISTEN 1411/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:8006 :::* LISTEN 1411/java
tcp 0 0 ::ffff:127.0.0.1:8007 :::* LISTEN 1441/java
tcp 0 0 :::8009 :::* LISTEN 1381/java
shell > curl "http://192.168.1.80:8080" # 全部可以访问
welcome to tomcat1
shell > curl "http://192.168.1.80:8081"
welcome to tomcat2
shell > curl "http://192.168.1.80:8082"
welcome to tomcat3
shell > tail -1 /usr/local/tomcat1/logs/catalina.out # 可以看到启动时间有长有短
31-Oct-2014 16:55:11.536 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 74454 ms
shell > tail -1 /usr/local/tomcat2/logs/catalina.out
31-Oct-2014 16:58:30.971 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 269855 ms
shell > tail -1 /usr/local/tomcat3/logs/catalina.out
31-Oct-2014 16:56:10.965 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 126503 ms
shell > ps aux | grep java # 进程路径也都没有错
root 1381 1.3 8.4 2270676 86560 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 1411 1.3 8.5 2270808 87144 pts/0 Sl 16:53 0:06 /usr/bin/java -Djava.util.logging.config.file=/usr/local/tomcat2/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/usr/local/tomcat2/endorsed -classpath /usr/local/tomcat2/bin/bootstrap.jar:/usr/local/tomcat2/bin/tomcat-juli.jar -Dcatalina.base=/usr/local/tomcat2 -Dcatalina.home=/usr/local/tomcat2 -Djava.io.tmpdir=/usr/local/tomcat2/temp org.apache.catalina.startup.Bootstrap start
root 1441 1.4 8.6 2270836 87784 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