南昌网站定制,企业网站方案设计,wordpress浮窗音乐,南京小程序建设公司需求前提#xff1a; 系统结束后#xff0c;需要部署到服务器上。 目前只可以映射到一个固定IP的非80端口。 而server端和web端都要暴露到外网。 所以配置两个context#xff0c;使得client应用不需要添加服务名#xff0c;直接使用IP即可访问#xff1b;server可以通过ht…需求前提 系统结束后需要部署到服务器上。 目前只可以映射到一个固定IP的非80端口。 而server端和web端都要暴露到外网。 所以配置两个context使得client应用不需要添加服务名直接使用IP即可访问server可以通过http://xxx/server进行访问。 见下文 ?xml version1.0 encodingutf-8?
!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements. See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the License); you may not use this file except in compliance withthe License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an AS IS BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.
--
!-- Note: A Server is not itself a Container, so you may notdefine subcomponents such as Valves at this level.Documentation at /docs/config/server.html--
Server port8005 shutdownSHUTDOWNListener classNameorg.apache.catalina.startup.VersionLoggerListener /!-- Security listener. Documentation at /docs/config/listeners.htmlListener classNameorg.apache.catalina.security.SecurityListener /--!--APR library loader. Documentation at /docs/apr.html --Listener classNameorg.apache.catalina.core.AprLifecycleListener SSLEngineon /!--Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html --Listener classNameorg.apache.catalina.core.JasperListener /!-- Prevent memory leaks due to use of particular java/javax APIs--Listener classNameorg.apache.catalina.core.JreMemoryLeakPreventionListener /Listener classNameorg.apache.catalina.mbeans.GlobalResourcesLifecycleListener /Listener classNameorg.apache.catalina.core.ThreadLocalLeakPreventionListener /!-- Global JNDI resourcesDocumentation at /docs/jndi-resources-howto.html--GlobalNamingResources!-- Editable user database that can also be used byUserDatabaseRealm to authenticate users--Resource nameUserDatabase authContainertypeorg.apache.catalina.UserDatabasedescriptionUser database that can be updated and savedfactoryorg.apache.catalina.users.MemoryUserDatabaseFactorypathnameconf/tomcat-users.xml //GlobalNamingResources!-- A Service is a collection of one or more Connectors that sharea single Container Note: A Service is not itself a Container,so you may not define subcomponents such as Valves at this level.Documentation at /docs/config/service.html--Service nameCatalina!--The connectors can use a shared executor, you can define one or more named thread pools--!--Executor nametomcatThreadPool namePrefixcatalina-exec-maxThreads150 minSpareThreads4/--!-- A Connector represents an endpoint by which requests are receivedand responses are returned. Documentation at :Java HTTP Connector: /docs/config/http.html (blocking non-blocking)Java AJP Connector: /docs/config/ajp.htmlAPR (HTTP/AJP) Connector: /docs/apr.htmlDefine a non-SSL HTTP/1.1 Connector on port 8080--Connector port8080 protocolHTTP/1.1connectionTimeout20000redirectPort8443 /!-- A Connector using the shared thread pool--!--Connector executortomcatThreadPoolport8080 protocolHTTP/1.1connectionTimeout20000redirectPort8443 /--!-- Define a SSL HTTP/1.1 Connector on port 8443This connector uses the BIO implementation that requires the JSSEstyle configuration. When using the APR/native implementation, theOpenSSL style configuration is required as described in the APR/nativedocumentation --!--Connector port8443 protocolorg.apache.coyote.http11.Http11ProtocolmaxThreads150 SSLEnabledtrue schemehttps securetrueclientAuthfalse sslProtocolTLS /--!-- Define an AJP 1.3 Connector on port 8009 --Connector port8009 protocolAJP/1.3 redirectPort8443 /!-- An Engine represents the entry point (within Catalina) that processesevery request. The Engine implementation for Tomcat stand aloneanalyzes the HTTP headers included with the request, and passes themon to the appropriate Host (virtual host).Documentation at /docs/config/engine.html --!-- You should set jvmRoute to support load-balancing via AJP ie :Engine nameCatalina defaultHostlocalhost jvmRoutejvm1--Engine nameCatalina defaultHostlocalhost!--For clustering, please take a look at documentation at:/docs/cluster-howto.html (simple how to)/docs/config/cluster.html (reference documentation) --!--Cluster classNameorg.apache.catalina.ha.tcp.SimpleTcpCluster/--!-- Use the LockOutRealm to prevent attempts to guess user passwordsvia a brute-force attack --Realm classNameorg.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. --Realm classNameorg.apache.catalina.realm.UserDatabaseRealmresourceNameUserDatabase//RealmHost namelocalhost appBasewebappsunpackWARstrue autoDeploytruexmlValidationfalse xmlNamespaceAwarefalseContext path docBaseclient reloadabletrue crossContexttrue / Context path/server docBaseserver reloadabletrue crossContexttrue / /Host/Engine/Service
/Server 以下是两个域名映射到Tomcat上的两个应用的server.xml的配置。 这种配置方案会存在以下问题 在webapps和webapps1中会自动生成名称为ROOT的应用代码就是自己指定的docBase的路径下对应的应用。 Host namewww.a.com appBasewebappsunpackWARstrue autoDeploytrueContext path docBaseE:/apache-tomcat-7.0.73/a /Valve classNameorg.apache.catalina.valves.AccessLogValve directorylogsprefixlocalhost_access_log. suffix.txtpattern%h %l %u %t quot;%rquot; %s %b //HostHost namewww.b.com appBasewebapps1unpackWARstrue autoDeploytrueContext path docBaseE:/apache-tomcat-7.0.73/b /Valve classNameorg.apache.catalina.valves.AccessLogValve directorylogsprefixlocalhost_access_log. suffix.txtpattern%h %l %u %t quot;%rquot; %s %b //Host 转载于:https://www.cnblogs.com/Candies/p/6913054.html