解决ubuntu下“找不到基于APR的Apache Tomcat本机库”
原因:
缺少apr相关lib,编译一份放到tomcat的bin目录下即可,当然不放也可以正常用。
先放一份编译好的 点此下载
#编译环境 ubuntu18.04.6_x64
#编译apr-lib
cd ~/Downloads
wget http://apache.mirror.anlx.net/apr/apr-1.7.0.tar.gz
tar -zxvf apr-1.7.0.tar.gz
cd apr-1.7.0
./configure --prefix=$(pwd)/out
make -j4
make install
#安装openssl
sudo apt install openssl libssl-dev
cd ~/Downloads
wget https://dlcdn.apache.org/tomcat/tomcat-connectors/native/1.2.31/source/tomcat-native-1.2.31-src.tar.gz
tar -zxvf tomcat-native-1.2.31-src.tar.gz
cd tomcat-native-1.2.31-src/native
#此处--with-apr替换为上边编译的apr-lib的绝对路径
./configure --prefix=$(pwd)/out --with-apr=/home/ubuntu/Downloads/apr-1.7.0/out --with-ssl=yes
make -j4
make install
#复制out目录下的文件到tomcat的bin目录下,重启即可在log中看到apr相关了
如有错漏,欢迎指正!谢绝转载。