gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-28 22:53:16 26 4
gpt4 key购买 nike

我刚刚开始为 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?昨晚我可以看到带有 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)

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

最佳答案

Tomcat 应该会在几秒钟内启动,尤其是当您刚刚下载并解压它时。

我建议先检查正在运行的 tomcat 进程并终止它们。从你的关机命令的输出来看,它看起来不像是干净地关机(注意“使用”反馈——使用 ./shutdown.sh./catalina.sh停止).

接下来,检查$CATALINA_HOME/conf/server.xml。看起来您可能一直在更改默认端口。 8080 是 Tomcat 的默认端口,不是 8088(并且 8005 是默认关闭端口,不是 8006)因此,请确保在启动服务器之前将这些设置为您想要的方式。

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

关于tomcat正在运行,但是没有页面显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33857675/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com