最近新找到了一篇关于APR提高性能的安装部署
下载 从网址:http://apr.apache.org/download.cgi
http://mirror.bjtu.edu.cn/apache/apr/
http://archive.apache.org/dist/apr/
tomcat-native.tar.gz 可以在tomcat/bin目录下找到
安装步骤如下:
安装 apr
tar zxvf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure
make
make install
完毕,默认安装路径在/usr/local/apr下
安装apr-util
tar zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --with-apr=/usr/local/apr
make
make install
安装tomcat-native
cd /usr/local/tomcat-6.0.18/bin
tar zxvf tomcat-native.tar.gz
cd tomcat-native-1.1.20-src/jni/native
./configure --with-apr=/usr/local/apr --with-java-home=/usr/local/jdk1.6.0_23
make
make install
设置 apr 的环境变量:
vi /etc/profile
// 后面添加以下内容
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib
//退出vi,运行下面命令生效
source /etc/profile
重启tomcat,查看日志里有如下信息:
信息: Loaded APR based Apache Tomcat Native library 1.1.20
就表示成功了!
备注:
bio
centos 7
安装OpenSSL 1.0.2
由于centos 7 当前的yum 库只有1.0.1 的OpenSSL,所以我们需要手工安装1.0.2
# cd /usr/local/src
# wget https://www.openssl.org/source/openssl-1.0.2-latest.tar.gz
# tar -xzxf openssl-1.0.2-latest.tar.gz
# cd openssl-1.0.2g
# ./config --prefix=/usr/local/openssl -fPIC
// 注意这里需要加入 -fPIC参数,否则后面在安装tomcat native 组件会出错
// 注意:不要按照提示去运行 make depend
# make
# make install
# mv /usr/bin/openssl ~
# ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
# openssl version
// 确认版本信息是1.0.2
重新安装 tomcat-native组件
# cd $CATALINA_HOME/bin
# tar -xzvf tomcat-native.tar.gz
# cd tomcat-native-1.2.7-src/native
# ./configure --with-apr=/usr/local/apr --with-ssl=/usr/local/openssl
# make
# make install