centos6.2下,Tomcat运行模式apr安装过程,如下:

一、安装apr

[root@vmT227-m5 /]# cd /usr/local/
[root@vmT227-m5 local]# tar zxvf apr-1.4.2.tar.gz
[root@vmT227-m5 local]# ./configure --prefix=/usr/local/ap

如果报错误:rm: cannot remove `libtoolT': No such file or directory

解决方法:

[root@vmT227-m5 apr-1.4.2]# vi configure
将
RM='$RM'
改成:
RM='$RM -f'
[root@vmT227-m5 apr-1.4.2]# make && make install

二、安装apr-iconv

[root@vmT227-m5 local]# tar -zxvf apr-iconv-1.2.1.tar.gz
[root@vmT227-m5 local]# cd apr-iconv-1.2.1
[root@vmT227-m5 local]# ./configure --prefix=/usr/local/apr-iconv --with-apr=/usr/local/apr
[root@vmT227-m5 local]# make && make install

 

三、安装apr-util

[root@vmT227-m5 local]# tar zxvf apr-util-1.3.10.tar.gz
[root@vmT227-m5 local]# cd apr-util-1.3.10
[root@vmT227-m5 local]# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr --with-apr-iconv=/usr/local/apr-iconv/bin/apriconv
[root@vmT227-m5 local]# make && make install

四、安装tomcat-native

[root@vmT227-m5 local] cd /usr/local/tomcat-jiaoshiduan-app/bin/     #tomcat安装路径
[root@vmT227-m5 bin]# tar zxvf tomcat-native-1.1.33-src.tar.gz
[root@vmT227-m5 bin]# cd tomcat-native-1.1.33-src/jni/native
[root@vmT227-m5 bin]# ./configure --with-apr=/usr/local/apr --with-java-home=/usr/local/jdk1.7.0_75
[root@vmT227-m5 bin]# make && make install

五、配置tomcat apr模式

[root@vmT227-m5 local] vim /etc/profile
#apr
export LD_LIBRARY_PATH=/usr/local/apr/lib
[root@vmT227-m5 local] source /etc/profile

六、修改server.xml

将 <Connector port="28080" protocol="HTTP/1.1”中的protocol修改成org.apache.coyote.http11.Http11AprProtocol,然后重启Tomcat,看到以下内容,表示apr模式安装成功

org.apache.catalina.core.AprLifecycleListener init
  INFO: Loaded APR based Apache Tomcat Native library 1.1.20.

INFO: Starting ProtocolHandler ["http-apr-8080"]
INFO: Starting ProtocolHandler ["ajp-apr-8019"]

 相关安装软件下载地址,请点击这里

posted on 2017-06-25 15:58  猥琐丶欲为  阅读(2898)  评论(0编辑  收藏  举报