tomcat 配置文件

<?xml version='1.0' encoding='utf-8'?>
<!-- tomcat启动时运行的监听器 -->
<!-- 
1.客户端向服务器发送请求
2.连接器Connector,默认8080端口,连接器一般有http、ajp
3.连接器将请求发给引擎Engine
4.将访问的资源解析到虚拟主机host
5.匹配虚拟主机
6.通过maaping table找到相应的servlet
<!--The connectors can use a shared executor, you can define one or more named thread pools-->
<!--
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-"
    maxThreads="150" minSpareThreads="4"/>
-->


<!-- A "Connector" represents an endpoint by which requests are received
     and responses are returned. Documentation at :
     Java HTTP Connector: /docs/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
-->
<!-- tomcat启动后监听80端口;只处理http协议向80端口发请求;20000毫秒等待时间;-->
<!-- <Connector port="80" protocol="HTTP/1.1" -->
           <!-- connectionTimeout="20000" -->
           <!-- redirectPort="8443" /> -->
 <!-- 现有配置参数 -->
 <Connector port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           URIEncoding="UTF-8"
           minSpareThreads="250"
           maxSpareThreads="500"
           enableLookups="false"
           disableUploadTimeout="true"
           acceptCount="500"
           maxThreads="500"
           maxProcessors="1000"
           minProcessors="5"
           useURIValidationHack="false"
           compression="on"
           compressionMinSize="2048"
           redirectPort="8443" />
<!-- A "Connector" using the shared thread pool-->
<!--
<Connector executor="tomcatThreadPool"
           port="8080" protocol="HTTP/1.1"
           connectionTimeout="20000"
           redirectPort="8443" />
-->
<!-- Define an SSL HTTP/1.1 Connector on port 8443
     This connector uses the BIO implementation that requires the JSSE
     style configuration. When using the APR/native implementation, the
     OpenSSL style configuration is required as described in the APR/native
     documentation -->
<!--
开启https请求支持
<Connector port="8443" protocol="org.apache.coyote.http11.Http11Protocol"
           maxThreads="150" SSLEnabled="true" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" />
-->

<!-- Define an AJP 1.3 Connector on port 8009 -->
<!--
<Connector protocol="AJP/1.3"
           address="::1"
           port="8009"
           redirectPort="8443" />
-->

<!-- 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 request, 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="Catalina" defaultHost="localhost" jvmRoute="jvm1">
-->
<!-- 服务下的一个引擎 -->
<Engine name="Catalina" defaultHost="localhost">

  <!--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 passwords
       via a brute-force attack -->
  <Realm className="org.apache.catalina.realm.LockOutRealm">
    <!-- This Realm uses the UserDatabase configured in the global JNDI
         resources under the key "UserDatabase".  Any edits
         that are performed against this UserDatabase are immediately
         available for use by the Realm.  -->
    <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
           resourceName="UserDatabase"/>
  </Realm>

  <!-- 引擎下的多个虚拟机 -->
  <Host name="localhost"  appBase="webapps"
        unpackWARs="true" autoDeploy="true">
		
    <!-- SingleSignOn valve, share authentication between web applications
         Documentation at: /docs/config/valve.html -->
    <!--
    <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
    -->

    <!-- Access log processes all example.
         Documentation at: /docs/config/valve.html
         Note: The pattern used is equivalent to using pattern="common" -->
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
           prefix="localhost_access_log." suffix=".txt"
           pattern="%h %l %u %t &quot;%r&quot; %s %b" />

  </Host>
  
  <!-- 修改此配置文件需要重新启动tomcat -->
  <Host name="www.puhome.com"  appBase="与webapps同级的目录文件夹"
        unpackWARs="true" autoDeploy="true">
		<!-- 应用程序 -->
		<Context path="/m" docBase="站点路径"></Context>
		<Context path="/pc" docBase="站点路径"></Context>
   </Host>
   <!-- 现有配置项 -->
   <Host name="xxx.xxx.test.com"  appBase="/data/xxx/xxx"
        unpackWARs="true" autoDeploy="true">
    <Context path="/list1" docBase="list1" debug="99" reloadable="true" />
    <Context path="/list2" docBase="list2" debug="99" reloadable="true" />
    <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
           prefix="test.com_access_log" suffix=".txt"
           pattern="%h %l %u %t &quot;%r&quot; %s %b" />
  </Host>
</Engine>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值