在安装好jdk与tomcat之后,会在tomcat启动log信息里提示:
27-Aug-2018 08:59:49.191 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib]
tar.gz版本的tomcat不会安装好apr,需要单独编译安装。
去这里下载
丢到服务器上面去
解压,安装
tar -zxvf apr-1.6.3.tar.gz
进入解压后的目录
./configure && make && make install
去tomcat的bin目录下,解压tomcat-native.tar.gz
tar -zxvf tomcat-native.tar.gz
去刚才解压好的目录下的native中
cd apache-tomcat-8.5.33/bin/tomcat-native-1.2.17-src/native/
./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME
make && make install
修改环境变量
vim /etc/profile
在最后增加
export LD_LIBRARY_PATH=/usr/local/apr/lib
最后输入以下命令使刚才添加的内容生效
source /etc/profile
如果没有配置SSL相关参数,并且开启了SSL,启动时会发生org.apache.tomcat.jni.Error: 70023: This function has not been implemented on this platform异常:
如果不想启用SSL,将server.xml中apr模式下ssl关闭即可:
将SSLEngine的值从on改成off即可: