安装apr来提高tomcat 的可伸缩性和性能
1
|
cd /usr/local/ |
1 下载apr 和 apr-util最新版
1
2
3
|
wget http: //apache.fayea.com/apache-mirror//apr/apr-1.5.0.tar.gz
wget http: //apache.fayea.com/apache-mirror//apr/apr-util-1.5.3.tar.gz
|
2 解压文件
1
2
3
|
tar -zxvf apr- 1.5 . 0 .tar.gz
tar -zxvf aor-util- 1.5 . 3 .tar.gz
|
3 安装apr和apr-util
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
cd apr- 1.5 . 0
./configure --prefix=/usr/local/apr make make install cd .. cd apr-util- 1.5 . 3
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr make make insatll |
4 安装 tomcat-native
1
2
3
4
5
6
|
cd /usr/local/tomcat/bin tar -zxvf tomcat- native .tar.gz
cd tomcat- native - 1.1 . 29 -src/jni/ native
./configure --with-apr=/usr/local/apr --with-java- home=/usr/java/jdk1. 7 .0_25
make make install |
5 设置 apr 的环境变量
1
2
3
4
5
6
7
8
9
|
vi /etc/profile #在文本的最后面添加以下内容 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib #使profile生效, source /etc/profile |
6 启动tomcat并查看catalina.out
1
2
3
|
./startup.sh cat catalina.out |
出现 :org.apache.catalina.core.AprLifecycleListener.init Loaded APR based Apache Tomcat Native library 1.1.29 using APR version 1.5.0.
则apr安装成功