1.系統環境:
ubutu12.04
java: java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) Client VM (build 25.111-b14, mixed mode)
tomcat:apache-tomcat-9.0.0.M13
2.修改tomcat設定檔設定:
<Server port="8005" shutdown="SHUTDOWN">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
3.啟動設定檔:
1).啟動回傳訊息:
Using CATALINA_BASE: /usr/local/tomcat-8080
Using CATALINA_HOME: /usr/local/tomcat-8080
Using CATALINA_TMPDIR: /usr/local/cat -8080/temp
Using JRE_HOME: /usr/local/java/jdk1.8.0_111/jre
Using CLASSPATH: /usr/local/tomcat-8080/bin/bootstrap.jar:/usr/local/tomcat -8080/bin/tomcat-juli.jar
Tomcat started.
2)日誌回傳訊息:
15-Nov-2016 03:48:00.769 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.0.M13
15-Nov-2016 03:48:00.773 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Nov 3 2016 20:59:41 UTC
15-Nov-2016 03:48 00.774 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.0.0
15-Nov-2016 03:48:00.774 INFO [main] org.apache.catalina.startup.VersionLogsion. OS Name: Linux
15-Nov-2016 03:48:00.774 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 3.2.0-23-generic-pae
15-Nov -2016 03:48:00.774 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: i386
15-Nov-2016 03:48:00.774 INFO [main] org.startup.catalina. VersionLoggerListener.log Java Home: /usr/local/java/jdk1.8.0_111/jre
15-Nov-2016 03:48:00.774 INFO [main] org.apache.catalina.startup.VersionLoggerListenerenerlog JVM Version: 1.8.0_111-b14
15-Nov-2016 03:48:00.774 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
15-Nov-2016 03:48: 00.774 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /usr/local/tomcat-8080
15-Nov-2016 03:48:00.774 INFOapmainy] org.ache. .VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat-8080
15-Nov-2016 03:48:00.775 INFO [main] org.apache.catalina.startup.VersionLoggerList幫助.logging.config.file=/usr/local/tomcat-8080/conf/logging.properties
15-Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.startup.VersionLoggerListenerenerenerlog Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
15-Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.startup.VersionLoggerListenerenerenergument Commandline line : -Djdk.tls.ephemeralDHKeySize=2048
15-Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol. org.apache.catalina.webresources
15-Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/cattom -8080
15-Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/usr/local/tomcat-8080
15-Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/usr/local/tomcat-8080/temp
15 -Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production Tomcat Native library which allows optimal performance in production environments was javary. usr/java/packages/lib/i386:/lib:/usr/lib
15-Nov-2016 03:48:00.975 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio -8080"]
15-Nov-2016 03:48:00.997 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
15-Nov- 2016 03:48:01.001 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
15-Nov-2016 03:48:01.0002 IN .tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
15-Nov-2016 03:48:01.004 INFO [main] org.apache.catalina.startup.Catalina.startup. 865 ms
15-Nov-2016 03:48:01.035 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
15-Nov-2016 03:48:01.035 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.0.M13
15-Nov-2016 03:48:01.051 INFO [localhost-startStop-1] org.apache.catalina. startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat-8080/webapps/ROOT
15-Nov-2016 03:48:01.531 INFO [localhost-startStop-1] org. HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat-8080/webapps/ROOT has finished in 480 ms
15-Nov-2016 03:48:01.5 catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat-8080/webapps/docs
15-Nov-2016 03:48:01.565 INFO [loaphost-Stopache-1] ? apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat-8080/webapps/examples
15-Nov-2016 03:48:01.922 INstartF. catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat-8080/webapps/examples has finished in 356 ms
15-Nov-2016 有org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat-8080/webapps/host-manager
15-Nov-2016 03:48:01.959 INFOFO org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat-8080/webapps/host-manager has finished in 37 ms
15-Novapps/host-manager has finished in 37 ms
15-Nov-2016 03248:003 localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat-8080/webapps/manager
15-Nov-2016 03:48:0202. startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat-8080/webapps/manager has finished in 83 ms
15-Nov-2016. INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler [http-nio-8080]
15-Nov-2016 03:48:02.063 INFO [main] org.apache.coyote.AbstractProtocol.dler [ajp-nio-8009]
15-Nov-2016 03:48:02.065 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1061 ms
4.使用瀏覽器在存取介面時候發現無法存取介面。 192.168.9.204:8080
5.查看tomcat進程發現:
ps -ef |grep 8080
root 2673 1 0 03:47 pts/0 00:00:10 /usr/local/java/jdk1.8.0_111/jre /bin/java -Djava.util.logging.config.file=/usr/local/tomcat-8080/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls. ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -classpath /usr/local/tomcat-8080/bin/bootstrap.jar:/usr/local/tomcat-8080/bin/tomcat-listrap.jar:/usr/local/tomcat-8080/bin/tomcat-listrap. .jar -Dcatalina.base=/usr/local/tomcat-8080 -Dcatalina.home=/usr/local/tomcat-8080 -Djava.io.tmpdir=/usr/local/tomcat-8080/temp org.apache.catalina .startup.Bootstrap start
root 2795 1312 0 05:42 pts/0 00:00:00 grep --color=auto 8080
連接埠狀態:
netstat -anltpu | grep 8080
tcp6 0 0 :::8080 :::* LISTEN 2673/java
發現埠是tcp6監聽的,將其kill掉。再次啟動發現還是無法連線。
eg:出現了一個現象,當我kill掉了,重啟可以訪問了,但是當我再次重啟之後有不能能夠訪問了,tomcat是不是很不穩定呀。
現在介面又不能存取了,我都要崩潰了。
請大神解釋一下這種現象。
认证0级讲师