Linux上安装APR

参考文献

http://jmchung.github.io/blog/2013/09/06/centos-installing-apache-portable-runtime-apr-for-tomcat/

# cd $CATALINA_HOME/bin

# tar -zxvf tomcat-native.tar.gz

# cd tomcat-native-1.1.27-src/jni/native

# ./configure --with-apr=/usr/local/apr --with-java-home=/usr/local/jdk1.8.0_91

# make

# make install


The native libraries were installed in /usr/local/apr/lib

Integrate APR with Tomcat

There are two ways to set Tomcat integrate with APR. One is you can add the following parameter when start up the Tomcat in bin/catalina.sh:

CATALINA_OPTS="-Djava.library.path=/usr/local/apr/lib"

The other is to add a new environment variable LD_LIBRARY_PATH in /etc/profile:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/apr/lib

Then makes it effect via:

# source /etc/profile

After restarting the Tomcat service, we can get the following message in catalina.out log if APR was installed successfully.

Sep 06, 2013 2:10:09 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded APR based Apache Tomcat Native library 1.1.27 using APR version 1.4.8.
Sep 06, 2013 2:10:09 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].

Tomcat SSLEngine Error

SEVERE: Failed to initialize the SSLEngine.
org.apache.tomcat.jni.Error: 70023: This function has not been implemented on this platform
    at org.apache.tomcat.jni.SSL.initialize(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.core.AprLifecycleListener.initializeSSL(AprLifecycleListener.java:259)
    at org.apache.catalina.core.AprLifecycleListener.lifecycleEvent(AprLifecycleListener.java:110)
    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
    at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
    at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:402)
    at org.apache.catalina.util.LifecycleBase.init(LifecycleBase.java:99)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:640)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:665)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:281)
    at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:455)

If you got the SSLEngine error message and your site without SSL support, you can fix this error via turn this initialization off in conf/server.xml.

<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="off" />




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值