tomcat8启动异常:APR/native library which is not available

cetos7.0环境下启动tomcat8,报如下错误

Tomcat ans APR lib : requires the APR/native library which is not available

查看tomcat配置文件service.xml

 <Connector port="18702" protocol="org.apache.coyote.http11.Http11AprProtocol"
                 connectionTimeout="20000"
                 redirectPort="8443" 
                 maxThreads="500"
                 minSpareThreads="20"
                 acceptCount="100"
                 disableUploadTimeout="true"
                 enableLookups="false"
                 URIEncoding="UTF-8"/>

这是因为配置里面指定使用协议是org.apache.coyote.http11.Http11AprProtocol,即需要用APR运行模式,但这并不是tomcat默认的运行模式(此外还有bio和nio模式),需要额外安装apr和native的包才行。

需要安装以下几个包

  1. openssl-1.0.2(支持http2.0的话需要1.0.2以上版本,此处安装的openssl-1.0.2k
  2. apr
  3. apr-util
  4. tomcat-native(这个包在tomcat的bin目录下带的有)

安装过程

1、安装openssl

tar xzvf openssl-1.0.2k.tar.gz
 cd openssl-1.0.2k
./config --prefix=/usr/local/openssl --shared
 make
 make test 
 make install
mv /usr/bin/openssl /usr/bin/openssl.OFF  
mv /usr/include/openssl /usr/include/openssl.OFF  
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl  
ln -s /usr/local/openssl/include/openssl /usr/include/openssl  
echo "/usr/local/openssl/lib">>/etc/ld.so.conf  
ldconfig -v  
openssl version -a 

2、安装apr
tar -zxvf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure --prefix=/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
cd ******    #tomcat安装路径
tar -zxvf  tomcat-native.tar.gz
cd tomcat-native-1.2.10-src/native
./configure --with-apr=/usr/local/apr --with-java-home=/opt/jdk1.7.0_67 --with-ssl=/usr/local/openssl
make
make install

 

 

 

 

 

 

  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值