tomcat7.0.57的高级应用-apr1.5.2安装

一 windows下安装
直接拷贝tcnative-1.dll到TOMCAT_HOME/bin目录下,启动即可
下载地址 http://archive.apache.org/dist/tomcat/tomcat-connectors/native/

二 linux centos4.8或者ubuntu10.10 server安装
1.下载包
到http://apr.apache.org/下载下面3个包
http://apache.fayea.com/apr/apr-1.5.2.tar.gz
http://apache.fayea.com/apr/apr-util-1.5.4.tar.gz
http://apache.fayea.com/apr/apr-iconv-1.2.1.tar.gz
java版本jdk-7u71-linux-x64-rpm.bin
tomcat版本apache-tomcat-7.0.57.tar.gz

三 安装JDK,tomcat
安装JDK并设置环境变量
vi /etc/profile #在他文件末尾处添加下面的变量
# java
JAVA_HOME=/usr/lib/jdk1.7.0_71
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME
export PATH
export CLASSPATH
执行
source /etc/profile
此时环境变量生效果

apache-tomcat-7.0.57.tar.gz解压缩到/usr/local/下面

四 安装apr插件
1)安装apr
tar zxvf apr-1.5.2.tar
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make
make install

2)安装apr-iconv
程序代码
tar -zxvf apr-iconv-1.2.1.tar.gz
cd apr-iconv-1.2.1
./configure --prefix=/usr/local/apr-iconv --with-apr=/usr/local/apr
make
make install

3)安装apr-util
程序代码
tar zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr --with-apr-iconv=/usr/local/apr-iconv/bin/apriconv
make
make install

4)安装tomcat-native
http://archive.apache.org/dist/tomcat/tomcat-connectors/native/1.1.33/source/
程序代码
tar zxvf tomcat-native-1.1.33-src.tar.gz
cd tomcat-native-1.1.33-src/jni/native  
./configure --with-apr=/usr/local/apr --with-java-home=/usr/lib/jdk1.7.0_71
make
make install

5)添加环境变量
vi /etc/profile #在他文件末尾处添加下面的变量
# apr
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib:/haow/server/tomcat/apache-tomcat-7.0.57/lib

执行
source /etc/profile
此时环境变量生效果

启动tomcat
TOMCAT_HOME/bin/start.sh
more TOMCAT_HOME/logs/catalina.out

即可看到
Aug 29, 2010 3:47:32 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.5.2.
优化完成

tomcat优化
http://blog.csdn.net/super_marioli/article/details/27240639

你可能感兴趣的:(tomcat apr)