tomcat中apr的配置

 

tomcat中apr的配置

 

 

安装APR

http://apr.apache.org/download.cgi下载apr,apr-util,apr-iconv.

传输完安装apr:

tar zxvf apr-1.5.1.tar.gz
cd apr-1.5.1
./configure --prefix=/usr/local/apr
make
make install

安装apr-iconv:

tar zxvf apr-iconv-1.2.1.tar.gz
cd apr-iconv-1.2.1
./configure --with-apr=/usr/local/apr
make
make install

安装apr-util:

tar zxvf apr-util-1.5.3.tar.gz
cd apr-util-1.5.3
./configure 
--with-apr=/usr/local/apr 
make  
make install

安装tomcat-native:首先到tomcat/bin目录下,找到对应的tar文件.

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/lib/jdk1.6.0_45 
--with-ssl=/usr/bin
make
make install

 

参数--with-ssl=/usr/bin 必须加上,服务器的ssl目录,否则启动tomcat会报错,SEVERE: Failed to initialize the SSLEngine.
org.apache.tomcat.jni.Error: 70023: This function has not been implemented on this platform

 

安装完成之后 会出现如下提示信息

Libraries have been installed in:
/usr/local/apr/lib

添加环境变量: vi /etc/profile在文件末尾处添加下面的变量

export LD_LIBRARY_PATH=/usr/local/apr/lib

然后执行下面命令,使环境变量即时生效

source /etc/profile

 

 

 启动tomcat,你看到如下的信息,表示apr生效

 

Sep 02, 2014 11:40:01 AM org.apache.catalina.core.AprLifecycleListener init

INFO: Loaded APR based Apache Tomcat Native library 1.1.30 using APR version 1.5.1.

Sep 02, 2014 11:40:01 AM org.apache.catalina.core.AprLifecycleListener init

INFO: APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true].

Sep 02, 2014 11:40:01 AM org.apache.catalina.core.AprLifecycleListener initializeSSL

INFO: OpenSSL successfully initialized (OpenSSL 1.0.1f 6 Jan 2014)

Sep 02, 2014 11:40:01 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["http-nio-8080"]

Sep 02, 2014 11:40:01 AM org.apache.tomcat.util.net.NioSelectorPool getSharedSelector

INFO: Using a shared selector for servlet write/read

Sep 02, 2014 11:40:01 AM org.apache.coyote.AbstractProtocol init

INFO: Initializing ProtocolHandler ["ajp-apr-8009"]

Sep 02, 2014 11:40:01 AM org.apache.catalina.startup.Catalina load

INFO: Initialization processed in 734 ms

Sep 02, 2014 11:40:02 AM org.apache.catalina.core.StandardService startInternal

INFO: Starting service Catalina

Sep 02, 2014 11:40:02 AM org.apache.catalina.core.StandardEngine startInternal

INFO: Starting Servlet Engine: Apache Tomcat/7.0.54

 

 

你可能感兴趣的:(tomcat)