yum install -y apr-devel openssl-devel gcc
安装native
cd /lxyy/tomcat7/bin
tar zxvf tomcat-native.tar.gz
cd tomcat-native-1.1.-src/jni/native
./configure --with-apr=/usr/bin/apr-1-config --with-java-home=/usr/local/jdk --prefix=/usr/local/tomcat7/
make
make install
--with-apr=/usr/bin/apr--config #这里是刚才安装apr lib的开发工具
--with-java-home=/lxyy/jdk #这里配置JAVA_HOME
--with-ssl=yes \ #这里设置是否启用ssl安全连接
--prefix=/lxyy/tomcat7 #这里是设置tomcat所在目录
此时编译出的lib放在tomcat/lib下,需要cp到/usr/lib下
[root@apr tomcat7]# cd /usr/local/tomcat7/lib/
[root@apr lib]# cp libtcnative-* /usr/lib
启动tomcat测试一下
将tomcat/config/service.xml 的protocol 改为
protocol="org.apache.coyote.http11.Http11AprProtocol"