linux下启动tomcat报错APR/native library which is not available的解决方案

2023-05-16

在linux上使用tomcat8配置支持http2.0的时候,server.xml的配置文件里面有这么一段配置:

	<Connector port="45501" protocol="org.apache.coyote.http11.Http11AprProtocol" 
               SSLEnabled="true"
               maxThreads="150"
               scheme="https" 
               secure="true"
               clientAuth="true"
               sslProtocol="TLS" 
               SSLCertificateFile="/export/apps/modelsafe/certificate/haier.net.pem"
               SSLCertificateKeyFile="/export/apps/modelsafe/certificate/haier.net.key.pem"
               truststoreFile="/export/apps/modelsafe/certificate/ags.trust.jks"
               truststorePass="haierags"/>

但是启动tomcat报错如下:

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

通过root用户执行如下命令即可:

 yum install apr-devel apr apr-util tomcat-native -y

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

linux下启动tomcat报错APR/native library which is not available的解决方案 的相关文章

随机推荐