Tomcat安装APR
Ttomcat可以使用Apache的apr 【Apache portable Run-time libraries,Apache可移植运行库】,这样可以加速IO的访问和使用Openssl
安装步骤:
所需软件包:
-- apr.tar.gz
-- apr-util.tar.gz
-- tomcat-native.tar.gz //tomcat自带
1. 安装apr.tar.gz
# tar zxvf apr.tar.gz
# cd apr
# ./configure
# make
# make install
//apr被安装在/usr/local/apr下
2. 安装apr-util.tar.gz
# tar zxvf apr-util.tar.gz
# cd apr-util
# ./configure --with-apr=/usr/local/apr
// --with-apr=/usr/local/apr 指定APR安装路径
# make
# make install
3. 安装tomcat-native.tar.gz
# cd /usr/local/tomcat/bin
# tar zxvf tomcat-native.tar.gz
# cd tomcat-native-1.1.10-src/jni/native
# ./configure --with-apr=/usr/local/apr --with-java-home=/usr/local/jdk
4. 添加环境变量
# vi /etc/profile
添加:export LD_LIBRARY_PATH=/usr/local/apr/lib
5.修改conf/server.xml
<Connector protocol="HTTP/1.1"/>
改为:
<Connector protocol="org.apache.coyote.http11.Http11AprProtocol"/>
5. 重启tomcat查看结果
# vi /usr/local/tomcat/logs/catalina.out
原来为
org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
现在为
Apr 1, 2011 3:33:53 PM org.apache.coyote.http11.Http11AprProtocol start
INFO: Starting Coyote HTTP/1.1 on http-10004
Apr 1, 2011 3:33:53 PM org.apache.coyote.ajp.AjpAprProtocol start
INFO: Starting Coyote AJP/1.3 on ajp-10005
Apr 1, 2011 3:33:53 PM org.apache.catalina.startup.Catalina start