The APR based Apache Tomcat Native library which allows optimal performance in production environmen

ubuntu上面,重启电脑之后,tomcat启动报:


The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path:xxxx

首先。。我在网上找到答案说,这样是可以的。。

#sudo apt-get install libtcnative-1


结果。。安装好了之后还是报。。

An older version 1.1.22 of the APR based Apache Tomcat Native library is installed, while Tomcat rec


就直接卸载了之后安装好的1.1.22的


后来网上搜索到以下方法可以解决:

1. Install compilers
#sudo apt-get install make
#sudo apt-get install gcc

2. Install openssl and development libraries
#sudo apt-get install openssl
#sudo apt-get install libssl-dev

3. Install the APR package 

( apr Downloaded from http://apr.apache.org/     http://apr.apache.org/download.cgi)



#tar -xzf apr-1.4.6.tar.gz
#cd apr-1.4.6/
#sudo ./configure
#sudo make
#sudo make install

You should see the compiled file as
/usr/local/apr/lib/libapr-1.a

4. Download, compile and install Tomcat Native sourse package(http://pkgs.fedoraproject.org/repo/pkgs/tomcat-native/)
tomcat-native-1.1.27-src.tar.gz

Extract the archive into some folder

#tar -xzf tomcat-native-1.1.27-src.tar.gz
#cd tomcat-native-1.1.27-src/jni/native
#JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21/
#sudo ./configure --with-apr=/usr/local/apr --with-java-home=$JAVA_HOME
#sudo make
#sudo make install

Now I have compiled Tomcat Native library in /usr/local/apr/libtcnative-1.so.0.1.27 and symbolic link file /usr/local/apr/@libtcnative-1.so pointed to the library

5. Create or edit the $CATALINA_HOME/bin/setenv.sh file with following lines :
export LD_LIBRARY_PATH='$LD_LIBRARY_PATH:/usr/local/apr/lib'

6. Restart tomcat and see the desired result:

May 05, 2013 9:18:26 PM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.4.6.
May 05, 2013 9:18:26 PM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].
May 05, 2013 9:18:26 PM org.apache.catalina.core.AprLifecycleListener initializeSSL
INFO: OpenSSL successfully initialized (OpenSSL 1.0.1 14 Mar 2012)
May 05, 2013 9:18:27 PM org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-apr-8009"]


其中。。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值