tomcat6 优化初步
1 必须要配置环境变量 才可以使用 Apache Portable Runtime 技术
http://tomcat.apache.org/download-native.cgi
如果使用的是解压方式的tomcat
则需要自己将tcnative-1.dll拷贝到 %TOMCAT_HOME%\bin 目录下
同时设置环境变量
TOMCAT_HOMEC:\tomcat6.0
CATALINA_HOMEC:\tomcat6.0
CATALINA_BASEC:\tomcat6.0
PATH%TOMCAT_HOME%\bin
CLASSPATH %CATALINA_HOME%\common\lib\servlet.jar
2 为了提高安全性,一般情况下屏蔽 AJP
注释或者删除server.xml中的 Connector节点
<Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="5000" minSpareThreads="500"/> <Connector executor="tomcatThreadPool"port="88" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" />
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="5000" minSpareThreads="500"/> <Connector executor="tomcatThreadPool"port="88" protocol="HTTP/1.1" connectionTimeout="20000" enableLookups="false" redirectPort="8443" />
<Executor name="tomcatThreadPool" namePrefix="catalina-exec-" maxThreads="5000" minSpareThreads="500"/><Connector executor="tomcatThreadPool"port="88" protocol="HTTP/1.1" connectionTimeout="20000" URIEncoding="UTF-8"useBodyEncodingForURI="true"enableLookups="false" redirectPort="8443" />
<Context reloadable="true">
<Context path="/text" docBase="f:\text\11" debug="0" reloadable="true"/>
<Host name="www.huadepengye.com" appBase="D:\Myweb" unpackWARs="true" autoDeploy="true"> <Context path="" docBase="D:\Myweb\HDPYWeb"/> </Host>