ubuntu - tomcat 访问问题
PHP中文网
PHP中文网 2017-04-24 09:10:32
0
0
773

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/tomcat-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.VersionLoggerListener.log 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.apache.catalina.startup.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.VersionLoggerListener.log 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 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /usr/local/tomcat-8080
15-Nov-2016 03:48:00.775 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/usr/local/tomcat-8080/conf/logging.properties
15-Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
15-Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
15-Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
15-Nov-2016 03:48:00.779 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/usr/local/tomcat-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 environments was not found on the java.library.path: /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.002 INFO [main] org.apache.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.load Initialization processed in 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.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat-8080/webapps/ROOT has finished in 480 ms
15-Nov-2016 03:48:01.532 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat-8080/webapps/docs
15-Nov-2016 03:48:01.565 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat-8080/webapps/docs has finished in 33 ms
15-Nov-2016 03:48:01.566 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat-8080/webapps/examples
15-Nov-2016 03:48:01.922 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat-8080/webapps/examples has finished in 356 ms
15-Nov-2016 03:48:01.923 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat-8080/webapps/host-manager
15-Nov-2016 03:48:01.959 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory /usr/local/tomcat-8080/webapps/host-manager has finished in 37 ms
15-Nov-2016 03:48:01.963 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /usr/local/tomcat-8080/webapps/manager
15-Nov-2016 03:48:02.047 INFO [localhost-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 03:48:02.052 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.start Starting ProtocolHandler [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-juli.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是不是很不稳定呀。

现在界面又不能访问了,我都要崩溃了。

求大神解释一下这种现象。

PHP中文网
PHP中文网

认证0级讲师

全部回复(0)
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板