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模块导致的错误。
1.安装APR
wget http://apache.mirror.phpchina.com/apr/apr-1.3.2.tar.gz tar zxvf apr-1.3.2.tar.gz cd apr-1.3.2 ./configure make make install apr 默认安装在 /usr/local/apr
2.安装apr-util
wget http://apache.mirror.phpchina.com/apr/apr-util-1.3.2.tar.gz tar zxvf apr-util-1.3.2.tar.gz cd apr-util-1.3.2 ./configure --with-apr=/usr/local/apr make make install 安装 tomcat-native
3.安装tomcat-native
在tomcat/bin目录下已有安装包
cd /usr/local/tomcat/bin tar zxvf tomcat-native.tar.gz cd tomcat-native-1.2.7-src/native ./configure --with-apr=/usr/local/apr --with-java-home=/usr/local/java
make make install
-----------------------------------------------------------------------------------------------------------------------------------------------
在这里出现了安装错误
checking for gcc option to accept ISO C89... none needed checking for OpenSSL library... using openssl from /usr/lib and /usr/include checking OpenSSL library version >= 1.0.2... Found OPENSSL_VERSION_NUMBER 0x10000003 (OpenSSL 1.0.0 29 Mar 2010) Require OPENSSL_VERSION_NUMBER 0x1000200f or greater (1.0.2) configure: error: Your version of OpenSSL is not compatible with this version of tcnative
由错误可知openssl的版本过低
升级openssl
-----------------------------------------------------------------------------------------------------------------------------------------------
4.设置APR的环境变量
vi /etc/profile 后面添加 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib 使设置生效 source /etc/profile
时间: 2024-12-17 17:44:06