<Serverport="-1"shutdown="SHUTDOWN"><ListenerclassName="org.apache.catalina.startup.VersionLoggerListener"/><ListenerclassName="org.apache.catalina.core.AprLifecycleListener"SSLEngine="on"/><!-- Prevent memory leaks due to use of particular java/javax APIs--><ListenerclassName="org.apache.catalina.core.JreMemoryLeakPreventionListener"/><ListenerclassName="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener"/><ListenerclassName="org.apache.catalina.core.ThreadLocalLeakPreventionListener"/><GlobalNamingResources><!-- Editable user database that can also be used byUserDatabaseRealm to authenticate users--><Resourcename="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><Servicename="Catalina"><Connectorport="8080"protocol="HTTP/1.1"address="0.0.0.0"connectionTimeout="20000"redirectPort="8443"URIEncoding="UTF-8"/><Connectorport="8080"protocol="AJP/1.3"address="0.0.0.0"redirectPort="8443"URIEncoding="UTF-8"/><RealmclassName="org.apache.catalina.realm.LockOutRealm"><!-- This Realm uses the UserDatabase configured in the global JNDIresources under the key "UserDatabase". Any editsthat are performed against this UserDatabase are immediatelyavailable for use by the Realm. --><RealmclassName="org.apache.catalina.realm.UserDatabaseRealm"resourceName="UserDatabase"/></Realm><Hostname="121.5.227.176"appBase="webapps"unpackWARs="true"autoDeploy="true"><Contextpath=""docBase="C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\ROOT"reloadable="true"/><ValveclassName="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>
設置直接通過ip訪問(不需要端口號)
我先是在網站綁定當中刪除80端口 然后
<Connectorport="80"protocol="HTTP/1.1"address="0.0.0.0"connectionTimeout="20000"redirectPort="8443"URIEncoding="UTF-8"/><Connectorport="80"protocol="AJP/1.3"address="0.0.0.0"redirectPort="8443"URIEncoding="UTF-8"/><Enginename="Catalina"defaultHost="121.5.227.176"><!--For clustering, please take a look at documentation at:/docs/cluster-howto.html (simple how to)/docs/config/cluster.html (reference documentation) --><!--<Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/>--><!-- Use the LockOutRealm to prevent attempts to guess user passwordsvia a brute-force attack --><RealmclassName="org.apache.catalina.realm.LockOutRealm"><!-- This Realm uses the UserDatabase configured in the global JNDIresources under the key "UserDatabase". Any editsthat are performed against this UserDatabase are immediatelyavailable for use by the Realm. --><RealmclassName="org.apache.catalina.realm.UserDatabaseRealm"resourceName="UserDatabase"/></Realm><Hostname="121.5.227.176"appBase="webapps"unpackWARs="true"autoDeploy="true"><Contextpath=""docBase="C:\Program Files (x86)\Apache Software Foundation\Tomcat 9.0\webapps\ROOT"reloadable="true"/><!-- SingleSignOn valve, share authentication between web applicationsDocumentation at: /docs/config/valve.html --><!--<Valve className="org.apache.catalina.authenticator.SingleSignOn" />--><!-- Access log processes all example.Documentation at: /docs/config/valve.htmlNote: The pattern used is equivalent to using pattern="common" --><ValveclassName="org.apache.catalina.valves.AccessLogValve"directory="logs"prefix="localhost_access_log"suffix=".txt"pattern="%h %l %u %t "%r" %s %b"/></Host></Engine>