APR and tomcat-native provide better scalability, performance, and integration to local server technologies.
If the APR technology is not available, the following prompt is displayed when Tomcat is started:
- Information: The APR based Apache Tomcat native library which allows optimal performance in production environments was not found on the java. library. path:/usr/Java/jdk1.6.0 _ 06/JRE/lib/i386/client:/usr/Java/jdk1.6.0 _ 06/JRE/lib/i386: /usr/Java/jdk1.6.0 _ 06/JRE /.. /lib/i386:/usr/Java/packages/lib/i386:/lib:/usr/lib
Information: The APR based Apache Tomcat native library which allows optimal performance in production environments was not found on the java. library. path:/usr/Java/jdk1.6.0 _ 06/JRE/lib/i386/client:/usr/Java/jdk1.6.0 _ 06/JRE/lib/i386: /usr/Java/jdk1.6.0 _ 06/JRE /.. /lib/i386:/usr/Java/packages/lib/i386:/lib:/usr/lib
According to official instructions:
- APR Library
- OpenSSL Libraries
OpenSSL can be installed using Yum install OpenSSL-devel, or *. GZ downloaded from Apr.
Apr-1.3.2.tar.gz
Apr-util-1.3.2.tar.gz
Two can be found in the http://apache.mirror.phpchina.com/apr.
The tomcat-native.tar.gz can be found in the tomcat/bin directory.
Install 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
# 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 is installed in/usr/local/APR by default.
Install 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
# 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
Install Tomcat-native
- # Cd, USR, local, tomcat, 6.0.18, and bin
- # Tar zxvf tomcat-native.tar.gz
- # Cd tomcat-native-1.1.14-src/JNI/native
- #./Configure -- With-Apr =/usr/local/APR -- With-Java-home =/usr/Java/jdk1.6.0 _ 11
- # Make
- # Make install
# cd /usr/local/tomcat-6.0.18/bin# tar zxvf tomcat-native.tar.gz# cd tomcat-native-1.1.14-src/jni/native# ./configure --with-apr=/usr/local/apr --with-java-home=/usr/java/jdk1.6.0_11# make# make install
Set APR environment variables:
- # Vi/etc/profile
- // Add the following content
- Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/local/APR/lib
- // Make the profile take effect,
- # Source/etc/profile
# Add the following content after VI/etc/profile //: Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/local/APR/lib/to make the profile take effect. # source/etc/profile
After Tomcat is started, check the log:
- # Bin/startup. Sh
- # Head logs/Catalina. Out
- // You can see the following results:
- Information: loaded APR based Apache Tomcat native library 1.1.14.
- 2009-1-13 11:12:51 org. Apache. Catalina. Core. aprlifecyclelistener init
- Information: Apr capabilities: ipv6 [True], sendfile [True], accept filters [false], random [True].
# Bin/startup. sh # Head logs/Catalina. out // the following result is displayed: loaded APR based Apache Tomcat native library 1.1.14.2009-1-13 11:12:51 org. apache. catalina. core. aprlifecyclelistener init information: Apr capabilities: ipv6 [True], sendfile [True], accept filters [false], random [True].
Okay, you can run it, but you have not tested its performance submission.