<?XML version= ' 1.0 ' encoding= ' utf-8 '?><ServerPort= "8005"shutdown= "SHUTDOWN"> <ListenerClassName= "Org.apache.catalina.startup.VersionLoggerListener" /> <ListenerClassName= "Org.apache.catalina.core.AprLifecycleListener"Sslengine= "On" /> <ListenerClassName= "Org.apache.catalina.core.JasperListener" /> <ListenerClassName= "Org.apache.catalina.core.JreMemoryLeakPreventionListener" /> <ListenerClassName= "Org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" /> <ListenerClassName= "Org.apache.catalina.core.ThreadLocalLeakPreventionListener" /> <globalnamingresources> <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= " the"Protocol= "http/1.1"ConnectionTimeout= "20000"Redirectport= "443" /> <!--<connector port= "8443" protocol= "Org.apache.coyote.http11.Http11Protocol" maxthreads= "Sslena" Bled= "true" scheme= "https" secure= "true" Clientauth= "false" sslprotocol= "TLS"/> - <!--Define an AJP 1.3 Connector on port 8009 - <ConnectorPort= "8019"Protocol= "ajp/1.3"Redirectport= "443" /> <Enginename= "Catalina"Defaulthost= "Myhost"> <RealmClassName= "Org.apache.catalina.realm.LockOutRealm"> <RealmClassName= "Org.apache.catalina.realm.UserDatabaseRealm"resourcename= "Userdatabase"/> </Realm> <Hostname= "Myhost"AppBase= "D:/WEBAPPS2"Unpackwars= "true"Autodeploy= "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> <Servicename= "Catalina_service"> <ConnectorPort= "8080"Protocol= "http/1.1"ConnectionTimeout= "20000"Redirectport= "8443" />
<connector port= "8081" protocol= "http/1.1" connectiontimeout= "20000" redirectport= "8443"/>
<!--<connector port= "8443" protocol= "Org.apache.coyote.http11.Http11Protocol" maxthreads= "Sslena" Bled= "true" scheme= "https" secure= "true" Clientauth= "false" sslprotocol= "TLS"/> - <!--Define an AJP 1.3 Connector on port 8009 - <ConnectorPort= "8009"Protocol= "ajp/1.3"Redirectport= "8443" /> <Enginename= "Catalina_engine"Defaulthost= "localhost"> <RealmClassName= "Org.apache.catalina.realm.LockOutRealm"> <RealmClassName= "Org.apache.catalina.realm.UserDatabaseRealm"resourcename= "Userdatabase"/> </Realm> <Hostname= "localhost"AppBase= "WebApps"Unpackwars= "true"Autodeploy= "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>
1, a server can be configured with multiple service (as above configuration, Catalina and Catalina_engine)
2, a service can be equipped with multiple connector (as above configuration, catalina_service in a 8080 and a 8081)
Both ports are available when accessing an app, such as: http://localhost:8080/http://localhost:8081/
3, a service can only be equipped with an engine, such as the configuration of more than the last configuration of the whichever.
4. The AppBase attribute in the host element specifies that a directory is the application deployment directory, and all subdirectories in that directory default to Web apps.
For example: Under Catalina service name is Myhost host element, set APPBASE=D:/WEBAPPS2, then all directories under WEBAPPS2 default to Web App
5, a eigine can only set a host, pro-test
6, Telnet localhost 8005, enter shutdown, close the Tomcat service.
Tomcat configuration file Server.xml detailed