1、xml version=1.0 encoding=utf-8!- Lice sed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Ver
2、sion 2.0 (the License); you may not use this file except in compliance with the License. You may obtain a copy of the License at http:/www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an AS IS BASI
3、S, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.- Note: A Server is not itself a Container, so you may not define subcomponents such as Valves at this level. Documentation at
4、 /docs/config/server.html -Server port=8015 shutdown=SHUTDOWN Listener className=org.apache.catalina.core.AprLifecycleListener SSLEngine=on /-Initialize Jasper prior to webapps are loaded. Documentation at /docs/jasper-howto.html -org.apache.catalina.core.JasperListener- Prevent memory leaks due to
5、use of particular java/javax APIs-org.apache.catalina.core.JreMemoryLeakPreventionListener- JMX Support for the Tomcat server. Documentation at /docs/non-existent.html -org.apache.catalina.mbeans.ServerLifecycleListenerorg.apache.catalina.mbeans.GlobalResourcesLifecycleListener- Global JNDI resource
6、s Documentation at /docs/jndi-resources-howto.htmlGlobalNamingResources- Editable user database that can also be used by UserDatabaseRealm to authenticate usersResource name=UserDatabase auth= type=org.apache.catalina.UserDatabase description=User database that can be updated and saved factory=org.a
7、pache.catalina.users.MemoryUserDatabaseFactory pathname=conf/tomcat-users.xml/GlobalNamingResources- A Service is a collection of one or more Connectors that share a single Note:, so you may not define subcomponents such as Documentation at /docs/config/service.htmlService name=Catalina-The connecto
8、rs can use a shared executor, you can define one or more named thread pools-Executor name=tomcatThreadPool namePrefix=catalina-exec- maxThreads=150 minSpareThreads=4/Connector represents an endpoint by which requests are received and responses are returned. Documentation at : Java HTTP Connector: /d
9、ocs/config/http.html (blocking & non-blocking) Java AJP Connector: /docs/config/ajp.html APR (HTTP/AJP) Connector: /docs/apr.html Define a non-SSL HTTP/1.1 Connector on port 8080-下面是配置连接属性,如果不用连接池请删除 executor=属性 当然你可以对照原始server.xml文件删除连接中的多余属性,那些多余属性只是影响连接性能(是否保持最大最小线程数是否压缩等)-Connector port=8088 pro
10、tocol=HTTP/1.1 xecutor= onnectionTimeout=20000 redirectPort=8443 compression=no mpressionMinSize=2048 noCompressionUserAgents=gozilla,traviata compressableMimeType=text/html,text/xml,text/css,text/javascript,text/plain URIEncoding=utf-8 enableLookups=false using the shared thread pool- Connector exe
11、cutor= maxThreads=500 minSpareThreads=30 maxSpareThreads=50 maxIdleTime=60000 keepAliveTimeout=15000 maxKeepAliveTimeout=200- Define a SSL HTTP/1.1 Connector on port 8443 This connector uses the JSSE configuration, when using APR, the connector should be using the OpenSSL style configuration describ
12、ed in the APR documentation -下面配置安全访问协议https这不是必须的,你可以注释掉,当然倘若你注释了它,当浏览器访问安全协议网站时(https)就会出现问题,不过当你打算采用时,你需要配置个人加密安全证书mykey.keystore 配置该安全证书请XX搜索,或者参见注释4)- SSLEnabled=true2575 disableUploadTimeout= acceptCount=100 scheme=https secure= clientAuth= sslProtocol=TLS keystoreFile=conf/mykey.keystore keys
13、torePass=111111- Define an AJP 1.3 Connector on port 8009 -下面配置的连接用于apache控制器需要连接到该tomcat的地址-8008AJP/1.3 URIEncoding=- An Engine represents the entry point (within Catalina) that processes every request. The Engine implementation for Tomcat stand alone analyzes the HTTP headers included with the req
14、uest, and passes them on to the appropriate Host (virtual host). Documentation at /docs/config/engine.html - You should set jvmRoute to support load-balancing via AJP ie :Engine name= defaultHost=localhost jvmRoute=jvm1-下面这行是必须的注意jvmRoute 属性请填写我门拷贝改名的tomcat服务器文件夹-tomcat1-For clustering, please take
15、a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) -下面这行也是必须的用于集成服务,我们采用apache服务器的目的就是集成服务-Cluster className=org.apache.catalina.ha.tcp.SimpleTcpCluster- The request dumper valve dumps useful debugging information about the reques
16、t and response data received and sent by Tomcat. Documentation at: /docs/config/valve.html -Valve className=org.apache.catalina.valves.RequestDumperValve- This Realm uses the UserDatabase configured in the global JNDI resources under the key . Any edits that are performed against this UserDatabase a
17、re immediately available for use by the Realm. -下面这行请保持默认或者打开注释-Realm className=org.apache.catalina.realm.UserDatabaseRealm resourceName=- Define the default virtual host XML Schema validation will not work with Xerces 2.2.Host name= appBase=webapps unpackWARs= autoDeploy= xmlValidation= xmlNamespac
18、eAware=- SingleSignOn valve, share authentication between web applicationsorg.apache.catalina.authenticator.SingleSignOn- Access log processes all example.-下面这行必须的但是更改他可以提高tomcat日志效率-org.apache.catalina.valves.FastCommonAccessLogValve directory=logs prefix=localhost_access_log. suffix=.txt pattern=combined resolveHosts= fileDateFormat=yyyy-MM-dd.HH/Host/Engine/Service/Server注意:蓝色部分中的端口配置,tomcat1和tomcat2的配置不同,如果需要可以将本置拷贝到server.xml文件中拷贝时请删除中文注释。tomcat2onfserver.xml):就不再注释 Licensed to the Apache Software Foundation (ASF) under one or more9015org.apach
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1