启动tomcat问题日志:
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]
这是由于APR环境问题引起。解决方案如下:
安装编译工具:yum -y groupinstall Development tools 如果已安装忽略,./configure make make install命令需要
安装apr openssl:yum -y install apr-devel openssl-devel
进入tomcat目录:cd $CATALINA_HOME/bin
解压native:tar -xvf tomcat-native.tar.gz
依次执行以下命令:
cd tomcat-native-1.2.21-src/native
./configure --with-apr=/usr/bin/apr-1-config --with-java-home=/soft/jdk1.8.0_144/ --with-ssl=yes --prefix=/soft/apache-tomcat-8.5.40/
make && make install
参数解释:
--with-apr 安装的apr文件的路径
--with-java-home jdk的路径
--with-ssl=yes 配置ssl,或者路径
--prefix=tomcat路径
参考文档:http://tomcat.apache.org/native-doc/
遇到问题:
1.checking for APR... configure: error: the --with-apr parameter is incorrect. It must specify an install prefix, a build directory, or an apr-config file.
没有安装apr,就配置了路径
2.configure: error: C compiler cannot create executables
没有安装编译开发工具