Install Apr
Get the latest APR installation package:
wget http://mirrors.hust.edu.cn/apache//apr/apr-1.5.2.tar.gz
Unpacking:
TAR-XZVF apr-1.5.2.tar.gz
To configure the installation path:
./configure--prefix=/opt/local/apr
Installation:
Make
Make install
----------------------------------
Installing Apr-util
Get the latest Apr-util
wget http://mirrors.hust.edu.cn/apache//apr/apr-util-1.5.4.tar.gz
Unpack
TAR-XZVF apr-util-1.5.4.tar.gz
Configure the installation path, related parameters (note that the--WITH-APR parameter matches the path of the previously installed APR):
./ Configure--prefix=/opt/local/apr-util --WITH-APR=/OPT/LOCAL/APR
Installation:
Make
Make install
----------------------------------
Installing Tomcat-native
The installation package can be found directly in the Tomcat directory
Cd/opt/local/tomcat/bin
TAR-XZVF tomcat-native.tar.gz
CD tomcat-native-1.1.30-src/jni/native
./configure--WITH-APR=/OPT/LOCAL/APR--with-java-home=/opt/local/jdk7
Then install:
Make
Make install
----------------------------------
Installing OpenSSL with Yum
Yum Install openssl*
----------------------------------
Edit the/etc/profile file to add APR to the environment variable
Add the following line:
export ld_library_path= $LD _library_path:/opt/local/apr/lib
Note the path is not wrong, be sure to use the correct path you installed Apr
after you exit the save, remember to use the Source/etc/profile command to make the new environment variable effective
----------------------------------
to modify the JVM parameters of Tomcat, add:
-djava.library.path=/opt/local/apr/lib
Modify the Tomcat Server.xml file to change the connector type to:
Org.apache.coyote.http11.Http11AprProtocol
Restart Tomcat
See the log appears: Info:starting protocolhandler ["http-apr-8080"]
indicates that APR is enabled.
Install APR for Tomcat in the Linux environment