2012-08-03
這篇是快速配置 Tomcat7 的心得筆記。因為是快速配置,所以只寫重點部份,實務上如有其它需要,請自行查閱官方文件。
我的系統環境如下
set JAVA_HOME=C:\Java\jdk1.7.0_05
set JAVA_OPTS=-Xms64m -Xmx384m -XX:+UseParallelGC -Duser.timezone=Asia/Taipei
export JAVA_HOME="/usr/lib/jvm/java-7-sun-1.7.0_05"
export JAVA_OPTS="-Xms64m -Xmx384m -XX:+UseParallelGC -Duser.timezone=Asia/Taipei"
<!--
port : The TCP port number on which this Connector will create a server socket and await incoming connections.
protocol : Sets the protocol to handle incoming traffic.
connectionTimeout : The number of milliseconds this Connector will wait.
compression : The Connector may use HTTP/1.1 GZIP compression in an attempt to save server bandwidth.
compressionMinSize : It is used to specify the minimum amount of data before the output is compressed.
compressableMimeType : The value is a comma separated list of MIME types for which HTTP compression may be used.
-->
<Connector port="8080" protocol="HTTP/1.1"
connectionTimeout="20000"
redirectPort="8443"
compression="on"
compressionMinSize="2048"
compressableMimeType="text/html,text/xml,text/plain,text/javascript,text/css" />
<!--
port : The TCP port number on which this Connector will create a server socket and await incoming connections.
protocol : Sets the protocol to handle incoming traffic.
SSLEnabled : Use this attribute to enable SSL traffic on a connector.
keystoreFile : The pathname of the keystore file where you have stored the server certificate to be loaded.
keystorePass : The password used to access the specified keystore file.
-->
<Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
maxThreads="150" scheme="https" secure="true"
clientAuth="false" sslProtocol="TLS"
keystoreFile="${catalina.base}/conf/.keystore" keystorePass="keystore_password"/>
<mime-mapping>
<extension>pdf</extension>
<mime-type>application/pdf</mime-type>
</mime-mapping>