- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个在 DigitalOcean VPS 上运行的 tomcat 服务器。 server.xml
文件看起来像这样:
<?xml version="1.0" encoding="UTF-8"?>
<Server port="8005" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<GlobalNamingResources>
<Resource name="UserDatabase" auth="Container"
type="org.apache.catalina.UserDatabase"
description="User database that can be updated and saved"
factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
pathname="conf/tomcat-users.xml" />
</GlobalNamingResources>
<Service name="Catalina">
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443" />
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Engine name="Catalina" defaultHost="localhost">
<Realm className="org.apache.catalina.realm.LockOutRealm">
<Realm className="org.apache.catalina.realm.UserDatabaseRealm"
resourceName="UserDatabase"/>
</Realm>
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log" suffix=".txt"
pattern="%h %l %u %t "%r" %s %b" />
</Host>
</Engine>
</Service>
</Server>
我编辑了 <Connector>
使服务器在端口 80
上运行的部分而不是 8080
.在更改之前,我可以使用 IP:8080
访问服务器地址,但现在我根本无法访问它 - 无论我使用 IP:8080
或 IP:80
或 IP
.我使用 shutdown.sh
重新启动了我的 tomcat和 startup.sh
并使用 sudo reboot
重新启动我的液滴, 但它没有任何改变。
我使用 sudo ufw status verbose
检查了防火墙它给出了 inactive
状态。
编辑:
我尝试了 shutdown.sh
-> startup.sh
-> sudo reboot
再次路由,这里是 catalina.out
自 shutdown.sh
命令:
28-Oct-2018 11:40:10.377 INFO [main] org.apache.catalina.core.StandardServer.await A valid shutdown command was received via the shutdown port. Stopping the Server instance.
28-Oct-2018 11:40:10.378 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["http-nio-80"]
28-Oct-2018 11:40:10.380 INFO [main] org.apache.coyote.AbstractProtocol.pause Pausing ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:10.442 INFO [main] org.apache.catalina.core.StandardService.stopInternal Stopping service [Catalina]
28-Oct-2018 11:40:10.494 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:10.495 INFO [main] org.apache.coyote.AbstractProtocol.stop Stopping ProtocolHandler ["http-nio-80"]
28-Oct-2018 11:40:10.498 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["http-nio-80"]
28-Oct-2018 11:40:10.498 INFO [main] org.apache.coyote.AbstractProtocol.destroy Destroying ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:14.691 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.12
28-Oct-2018 11:40:14.697 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 4 2018 22:13:41 UTC
28-Oct-2018 11:40:14.698 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.12.0
28-Oct-2018 11:40:14.698 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
28-Oct-2018 11:40:14.698 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.4.0-138-generic
28-Oct-2018 11:40:14.698 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
28-Oct-2018 11:40:14.698 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
28-Oct-2018 11:40:14.706 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13
28-Oct-2018 11:40:14.706 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
28-Oct-2018 11:40:14.706 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/tomcat
28-Oct-2018 11:40:14.706 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/tomcat
28-Oct-2018 11:40:14.707 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
28-Oct-2018 11:40:14.707 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
28-Oct-2018 11:40:14.707 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
28-Oct-2018 11:40:14.708 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
28-Oct-2018 11:40:14.708 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
28-Oct-2018 11:40:14.708 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
28-Oct-2018 11:40:14.708 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
28-Oct-2018 11:40:14.709 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
28-Oct-2018 11:40:14.709 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
28-Oct-2018 11:40:14.709 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/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
28-Oct-2018 11:40:14.857 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"]
28-Oct-2018 11:40:14.887 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Oct-2018 11:40:14.900 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:14.907 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Oct-2018 11:40:14.908 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 896 ms
28-Oct-2018 11:40:14.958 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
28-Oct-2018 11:40:14.962 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.12
28-Oct-2018 11:40:14.980 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: /opt/tomcat/logs/manager.2018-10-28.log (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at org.apache.juli.FileHandler.openWriter(FileHandler.java:495)
at org.apache.juli.FileHandler.<init>(FileHandler.java:168)
at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:82)
at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:602)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:538)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:336)
at java.util.logging.LogManager$3.run(LogManager.java:399)
at java.util.logging.LogManager$3.run(LogManager.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
at java.util.logging.LogManager.access$800(LogManager.java:145)
at java.util.logging.LogManager$2.run(LogManager.java:345)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
at java.util.logging.LogManager.getLogManager(LogManager.java:378)
at java.util.logging.Logger.demandLogger(Logger.java:448)
at java.util.logging.Logger.getLogger(Logger.java:502)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:61)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:181)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:116)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:139)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:194)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:52)
java.util.logging.ErrorManager: 4
java.io.FileNotFoundException: /opt/tomcat/logs/host-manager.2018-10-28.log (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at org.apache.juli.FileHandler.openWriter(FileHandler.java:495)
at org.apache.juli.FileHandler.<init>(FileHandler.java:168)
at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:82)
at org.apache.juli.AsyncFileHandler.<init>(AsyncFileHandler.java:74)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:602)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:538)
at org.apache.juli.ClassLoaderLogManager.readConfiguration(ClassLoaderLogManager.java:336)
at java.util.logging.LogManager$3.run(LogManager.java:399)
at java.util.logging.LogManager$3.run(LogManager.java:396)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.readPrimordialConfiguration(LogManager.java:396)
at java.util.logging.LogManager.access$800(LogManager.java:145)
at java.util.logging.LogManager$2.run(LogManager.java:345)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.ensureLogManagerInitialized(LogManager.java:338)
at java.util.logging.LogManager.getLogManager(LogManager.java:378)
at java.util.logging.Logger.demandLogger(Logger.java:448)
at java.util.logging.Logger.getLogger(Logger.java:502)
at org.apache.juli.logging.DirectJDKLog.<init>(DirectJDKLog.java:61)
at org.apache.juli.logging.DirectJDKLog.getInstance(DirectJDKLog.java:181)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:116)
at org.apache.juli.logging.LogFactory.getInstance(LogFactory.java:139)
at org.apache.juli.logging.LogFactory.getLog(LogFactory.java:194)
at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:52)
28-Oct-2018 11:40:31.547 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server version: Apache Tomcat/9.0.12
28-Oct-2018 11:40:31.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server built: Sep 4 2018 22:13:41 UTC
28-Oct-2018 11:40:31.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Server number: 9.0.12.0
28-Oct-2018 11:40:31.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Name: Linux
28-Oct-2018 11:40:31.552 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log OS Version: 4.4.0-138-generic
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Architecture: amd64
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Java Home: /usr/lib/jvm/java-8-openjdk-amd64/jre
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Version: 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor: Oracle Corporation
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE: /opt/tomcat
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME: /opt/tomcat
28-Oct-2018 11:40:31.553 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.config.file=/opt/tomcat/conf/logging.properties
28-Oct-2018 11:40:31.559 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager
28-Oct-2018 11:40:31.559 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.awt.headless=true
28-Oct-2018 11:40:31.559 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.security.egd=file:/dev/./urandom
28-Oct-2018 11:40:31.560 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djdk.tls.ephemeralDHKeySize=2048
28-Oct-2018 11:40:31.560 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.protocol.handler.pkgs=org.apache.catalina.webresources
28-Oct-2018 11:40:31.560 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dorg.apache.catalina.security.SecurityListener.UMASK=0027
28-Oct-2018 11:40:31.561 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xms512M
28-Oct-2018 11:40:31.561 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Xmx600M
28-Oct-2018 11:40:31.561 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -XX:+UseParallelGC
28-Oct-2018 11:40:31.561 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dignore.endorsed.dirs=
28-Oct-2018 11:40:31.562 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.base=/opt/tomcat
28-Oct-2018 11:40:31.562 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Dcatalina.home=/opt/tomcat
28-Oct-2018 11:40:31.563 INFO [main] org.apache.catalina.startup.VersionLoggerListener.log Command line argument: -Djava.io.tmpdir=/opt/tomcat/temp
28-Oct-2018 11:40:31.563 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/amd64:/usr/lib/x86_64-linux-gnu/jni:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu:/usr/lib/jni:/lib:/usr/lib]
28-Oct-2018 11:40:31.727 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-80"]
28-Oct-2018 11:40:31.751 SEVERE [main] org.apache.catalina.util.LifecycleBase.handleSubClassException Failed to initialize component [Connector[HTTP/1.1-80]]
org.apache.catalina.LifecycleException: Protocol handler initialization failed
at org.apache.catalina.connector.Connector.initInternal(Connector.java:935)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardService.initInternal(StandardService.java:533)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.core.StandardServer.initInternal(StandardServer.java:852)
at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:136)
at org.apache.catalina.startup.Catalina.load(Catalina.java:633)
at org.apache.catalina.startup.Catalina.load(Catalina.java:656)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:306)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:491)
Caused by: java.net.SocketException: Permission denied
at sun.nio.ch.Net.bind0(Native Method)
at sun.nio.ch.Net.bind(Net.java:433)
at sun.nio.ch.Net.bind(Net.java:425)
at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)
at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)
at org.apache.tomcat.util.net.NioEndpoint.initServerSocket(NioEndpoint.java:236)
at org.apache.tomcat.util.net.NioEndpoint.bind(NioEndpoint.java:210)
at org.apache.tomcat.util.net.AbstractEndpoint.init(AbstractEndpoint.java:1044)
at org.apache.coyote.AbstractProtocol.init(AbstractProtocol.java:540)
at org.apache.coyote.http11.AbstractHttp11Protocol.init(AbstractHttp11Protocol.java:74)
at org.apache.catalina.connector.Connector.initInternal(Connector.java:932)
... 13 more
28-Oct-2018 11:40:31.753 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:31.765 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
28-Oct-2018 11:40:31.788 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 1791 ms
28-Oct-2018 11:40:31.843 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
28-Oct-2018 11:40:31.844 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.12
28-Oct-2018 11:40:31.852 SEVERE [main] org.apache.catalina.startup.HostConfig.beforeStart Unable to create directory for deployment: [/opt/tomcat/conf/Catalina/localhost]
28-Oct-2018 11:40:31.858 SEVERE [main] org.apache.catalina.valves.AccessLogValve.open Failed to open access log file [/opt/tomcat/logs/localhost_access_log.2018-10-28.txt]
java.io.FileNotFoundException: /opt/tomcat/logs/localhost_access_log.2018-10-28.txt (Permission denied)
at java.io.FileOutputStream.open0(Native Method)
at java.io.FileOutputStream.open(FileOutputStream.java:270)
at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
at org.apache.catalina.valves.AccessLogValve.open(AccessLogValve.java:651)
at org.apache.catalina.valves.AccessLogValve.startInternal(AccessLogValve.java:685)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardPipeline.startInternal(StandardPipeline.java:179)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:965)
at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:839)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1429)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1419)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.apache.tomcat.util.threads.InlineExecutorService.execute(InlineExecutorService.java:75)
at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:134)
at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:944)
at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:261)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardService.startInternal(StandardService.java:422)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:770)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
at org.apache.catalina.startup.Catalina.start(Catalina.java:682)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:350)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:492)
28-Oct-2018 11:40:31.863 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/docs]
28-Oct-2018 11:40:32.472 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/docs] has finished in [608] ms
28-Oct-2018 11:40:32.472 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/host-manager]
28-Oct-2018 11:40:32.543 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/host-manager] has finished in [70] ms
28-Oct-2018 11:40:32.544 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/manager]
28-Oct-2018 11:40:32.590 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/manager] has finished in [46] ms
28-Oct-2018 11:40:32.595 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/Test]
28-Oct-2018 11:40:32.644 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/Test] has finished in [50] ms
28-Oct-2018 11:40:32.645 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/RedditDesk]
28-Oct-2018 11:40:32.681 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/RedditDesk] has finished in [36] ms
28-Oct-2018 11:40:32.681 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/ROOT]
28-Oct-2018 11:40:32.723 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/ROOT] has finished in [42] ms
28-Oct-2018 11:40:32.724 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deploying web application directory [/opt/tomcat/webapps/examples]
28-Oct-2018 11:40:33.158 INFO [main] org.apache.catalina.startup.HostConfig.deployDirectory Deployment of web application directory [/opt/tomcat/webapps/examples] has finished in [434] ms
28-Oct-2018 11:40:33.165 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["ajp-nio-8009"]
28-Oct-2018 11:40:33.196 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 1408 ms
最佳答案
在@ernest_k 的帮助下,我设法找到了问题所在。问题是端口从未真正从 8080
更改为 80
。发生这种情况是因为虽然我是作为根用户连接到 VPS,但由于 /etc/systemd/,tomcat 自动切换到非根用户
文件:tomcat
系统/tomcat.service
[Unit]
Description=Apache Tomcat Web Application Container
After=network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINA_BASE=/opt/tomcat
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/opt/tomcat/bin/shutdown.sh
User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
所以我将 User=tomcat
更改为 User=root
,重新启动一切,现在一切正常!
关于java - Tomcat:将端口从 8080 更改为 80 不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53030886/
我希望在某些环境中使用用户名和密码保护某个角色,但在其他环境中甚至不需要提示。如果我在 tomcat web.xml 中有一个 auth-constraint,我可以创建一个具有“匿名”访问权限的角色
我正在使用 Tomcat jmxproxy 和状态来监视 Web 应用程序,但是 jmxproxy 页面中有很多无用的信息,并且其中没有任何信息,例如事件连接数。有谁知道如何过滤 jmxproxy 页
是否可以通过执行 JSP 来重启 Tomcat6? 这是因为我想通过使用网络服务器远程部署应用程序的更改。 部署脚本是用 bash 编写的,它从 svn 中 check out 最新版本,然后将其打包
我有一个包含 2 个子项目(后端和 ui)的 gradle 项目。 Ui由gradle tomcatRunWar完美启动.后端有我们在生产地点的配置描述符/conf/Catalina/localhos
发现 XAMPP 控件认为 tomcat 正在运行但无法停止它的问题。 在catalina下的tomcat logs目录下可以找到如下错误 “严重:无法联系 localhost:8005。Tomcat
PuppetLabs 在 PuppetForge 上有一个模块,用于部署 Tomcat 及其配置。 https://forge.puppet.com/puppetlabs/tomcat Tomcat
我有一个部署到 Tomcat 实例中的 Web 应用程序。我希望能够将 tomcat 配置为在 Tomcat 本身启动时不自动启动该应用程序。但是,我确实希望启动 Tomcat 管理器,以便我可以根据
操作系统:windows XP。 我已经安装了 Tomcat 7.0.25,文件夹“manager”位于 webapps 文件夹中。 我已阅读此处的文档:http://tomcat.apache.or
我们在 server.xml 文件中启用了以下访问日志模式 pattern="%h %H %l %u %t "%r" %s %b location: %{location}o"。 有人可以帮助理解模式
我最近开始使用 tomcat,我有一个关于 Tomcat 请求路由/映射的查询。 假设我在 tomcat 服务器中部署了四个应用程序 A、B、C 和 D,当有请求到来时,tomcat 如何知道要调用哪
我在我的计算机上使用 Tomcat,它可以通过端口 8080 访问。我想要的是我应该能够使用我的计算机的 IP 地址访问我的 Tomcat 服务器页面。我以前读过很多主题,但找不到一个可以帮助我的主题
我有一个 tomcat 7 服务器和一个 postgreSQL 9.0 数据库。我用它来为地理网络元数据编辑器设置开发环境。一切都是根据 geonetwork 网站教程设置的。我在将服务器与数据库连接
我的服务器有 物理 ip 和 虚拟 ip 由网络管理员设置。在我安装的服务器内部 Apache tomcat 7.0.29并创建一个网络应用程序。当我运行 wget http://:8080/xxx或
我有多个应用程序在不同的端口上运行(tomcat 实例) 都有相同的CATALINA_HOME 目前我必须在所有实例中部署和安装psi 探针,并在不同的窗口中分别监控每个端口。 我如何在一个单一的探测
based on this question 我尝试将 Tomcat 控制台输出重定向到一个文本文件,它对我的 Web 应用程序工作正常,但问题是,每次 Tomcat 启动时它都会被覆盖。我需要创
我需要阐明我的问题。问题是:有什么方法可以影响 Tomcat 为特定部署的应用程序分配多少堆内存?更多详细信息 - 我如何为已部署的应用程序设置特定的 Java 选项(考虑我想为每个应用程序设置特殊的
应用服务器内部的类加载机制是开发人员常见的困惑来源;这就是为什么我想问一个关于 tomcat 7 服务器中这个机制的问题:我有一个网络应用程序 sample.war,它依赖于 jgroups 库, 放
尝试将嵌入式 Tomcat 5 迁移到嵌入式 Tomcat 7。在启动过程中获取 NPE。 我扩展了 Embedded 类并按照正确的顺序执行所有建议的初始化。 NPE 发生在这里: Caused b
我可以使用随附的 start.sh 文件启动 tomcat,但是是否有任何参数可以用来执行以下操作: 在指定的根目录启动 Tomcat 服务 强制 Tomcat 在浏览器中拉出指定的主页 谢谢 最佳答
我在两台 diff 机器 tomcat 服务器上做一个简单的集群配置。每次我启动 tomcat 时,我都会收到一个错误,就像集群组中没有事件成员一样。我正在附加集群配置
我是一名优秀的程序员,十分优秀!