tomcat正在运行,但没有页面显示

时间:2015-11-22 17:14:59

标签: tomcat ubuntu

我刚开始为Ubuntu服务器设置tomcat。

我试图通过“catalina.sh run”运行tomcat,它会记录“

Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/java-7-openjdk-amd64
Using CLASSPATH:       /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
22-Nov-2015 08:54:04.211 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version:        Apache Tomcat/8.0.28
22-Nov-2015 08:54:04.218 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built:          Oct 7 2015 18:25:21 UTC
22-Nov-2015 08:54:04.218 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number:         8.0.28.0
22-Nov-2015 08:54:04.218 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name:               Linux
22-Nov-2015 08:54:04.219 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version:            4.2.0-16-generic
22-Nov-2015 08:54:04.219 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture:          amd64
22-Nov-2015 08:54:04.220 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home:             /usr/lib/jvm/java-7-openjdk-amd64/jre
22-Nov-2015 08:54:04.220 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           1.7.0_85-b01
22-Nov-2015 08:54:04.226 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            Oracle Corporation
22-Nov-2015 08:54:04.226 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         /opt/tomcat
22-Nov-2015 08:54:04.226 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         /opt/tomcat
22-Nov-2015 08:54:04.227 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
22-Nov-2015 08:54:04.228 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
22-Nov-2015 08:54:04.229 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.endorsed.dirs=/opt/tomcat/endorsed
22-Nov-2015 08:54:04.229 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
22-Nov-2015 08:54:04.230 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
22-Nov-2015 08:54:04.230 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
22-Nov-2015 08:54:04.231 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library 1.1.33 using APR version 1.5.2.
22-Nov-2015 08:54:04.231 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
22-Nov-2015 08:54:04.274 INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized (OpenSSL 1.0.1f 6 Jan 2014)
22-Nov-2015 08:54:04.521 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-apr-8088"]
22-Nov-2015 08:54:04.560 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-apr-8009"]
22-Nov-2015 08:54:04.567 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 2002 ms
22-Nov-2015 08:54:04.686 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service Catalina
22-Nov-2015 08:54:04.686 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/8.0.28
22-Nov-2015 08:54:04.735 INFO [localhost-startStop-1] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory /opt/tomcat/webapps/host-manager

我检查“ps -ef | grep tomcat”,它返回“

root     30577 30576  2 08:54 pts/0    00:00:04 /usr/lib/jvm/java-7-openjdk-amd64/bin/java -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djava.endorsed.dirs=/opt/tomcat/endorsed -classpath /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/opt/tomcat -Dcatalina.home=/opt/tomcat -Djava.io.tmpdir=/opt/tomcat/temp org.apache.catalina.startup.Bootstrap start
demo     30600 30491  0 08:57 pts/0    00:00:00 grep --color=auto tomcat

“netstat -ln | grep 8088”,它返回“ tcp6 0 0 ::: 8088 ::: *听听 “

这是否意味着tomcat正在运行?

如果是这样,为什么我不能用ip_address打开网址:8088? 昨晚我可以看到带有url ip_address:8088的tomcat页面。今天早上,我通过“shutdown.sh run”关闭tomcat,它返回“

Using CATALINABASE: /opt/tomcat
Using CATALINAHOME: /opt/tomcat
Using CATALINATMPDIR: /opt/tomcat/temp
Using JREHOME: /usr/lib/jvm/java-7-openjdk-amd64
Using CLASSPATH: /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop }

然后我通过“catalina.sh run”启动tomcat,与我上面发布的日志相同,当我尝试访问ip_address:8088时,页面保持运行,但没有显示出来。它已经2小时,页面标签仍在运行,没有显示出来。我昨晚看到tomcat页面出现后没有做任何事情。

然后我尝试用“shutdown.sh run”关闭tomcat,它返回“

Using CATALINA_BASE:   /opt/tomcat
Using CATALINA_HOME:   /opt/tomcat
Using CATALINA_TMPDIR: /opt/tomcat/temp
Using JRE_HOME:        /usr/lib/jvm/java-7-openjdk-amd64
Using CLASSPATH:       /opt/tomcat/bin/bootstrap.jar:/opt/tomcat/bin/tomcat-juli.jar
usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ]  { -help | start | stop }
Nov 22, 2015 11:07:39 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Could not contact localhost:8006. Tomcat may not be running.
Nov 22, 2015 11:07:39 AM org.apache.catalina.startup.Catalina stopServer
SEVERE: Catalina.stop:
java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at java.net.Socket.<init>(Socket.java:425)
        at java.net.Socket.<init>(Socket.java:208)
        at org.apache.catalina.startup.Catalina.stopServer(Catalina.java:450)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:400)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:487)

谁能告诉我为什么会这样?我该怎么办?

1 个答案:

答案 0 :(得分:1)

Tomcat应该会在几秒钟内启动,特别是如果您刚刚下载并解压缩它。

我建议先检查正在运行的tomcat进程并将其终止。从shutdown命令的输出来看,它看起来并不干净(请注意&#34;用法&#34;反馈 - 使用./shutdown.sh./catalina.sh stop。< / p>

接下来,检查$CATALINA_HOME/conf/server.xml。您似乎可能一直在更改默认端口。 8080是Tomcat的默认端口,而不是8088(并且8005是默认关闭端口,而不是8006)所以请确保您按照以前的方式设置这些端口你启动服务器。

我绝对建议您阅读文档http://tomcat.apache.org/tomcat-8.0-doc/RUNNING.txt