Tomcat Server.Xml配置示例

<Server port="8005" shutdown="SHUTDOWN">
<!-- Define the Tomcat Stand-Alone Service -->
<Service name="Catalina">
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="8080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="GBK"/>
<!-- Define the top level container in our container hierarchy -->
<Engine name="Catalina" defaultHost="localhost">
<!-- Define the default virtual host
Note: XML Schema validation will not work with Xerces 2.2.
-->
<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- 修改默认启动应用程序-->
<Context path="" docBase="test" debug="0"/>
<Context path="test2" docBase="test2" debug="0"/>
</Host>
<Host name="netoss" appBase="d:\wwwroot"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">
<!-- 设置默认启动应用程序-->
<Context path="" docBase="d:\netoss" debug="0"/>
</Host>
</Engine>
</Service>
<Service name="Tomcat-Second">
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<Connector port="9080" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" redirectPort="8443" acceptCount="100"
connectionTimeout="20000" disableUploadTimeout="true" URIEncoding="GBK"/>
<!-- Define the top level container in our container hierarchy -->
<Engine name="Second" debug="0">
<Host name="site1" appBase="d:\site1">
<Context path="" docBase="." debug="0"/>
</Host>
<Host name="site2" appBase="d:\site2">
<Context path="" docBase="." debug="0"/>
</Host>
</Engine>
</Service>
</Server>


如果给你带来帮助,欢迎微信或支付宝扫一扫,赞一下。