APR and tomcat-native provide better scalability, performance, and integration to local servers

Source: Internet
Author: User
Tags install openssl sendfile apache tomcat

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:

  1. 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

  1. # Wget http://apache.mirror.phpchina.com/apr/apr-1.3.2.tar.gz
  2. # Tar zxvf apr-1.3.2.tar.gz
  3. # Cd apr-1.3.2
  4. #./Configure
  5. # Make
  6. # 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

  1. # Wget http://apache.mirror.phpchina.com/apr/apr-util-1.3.2.tar.gz
  2. # Tar zxvf apr-util-1.3.2.tar.gz
  3. # Cd apr-util-1.3.2
  4. #./Configure -- With-Apr =/usr/local/APR
  5. # Make
  6. # 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

  1. # Cd, USR, local, tomcat, 6.0.18, and bin
  2. # Tar zxvf tomcat-native.tar.gz
  3. # Cd tomcat-native-1.1.14-src/JNI/native
  4. #./Configure -- With-Apr =/usr/local/APR -- With-Java-home =/usr/Java/jdk1.6.0 _ 11
  5. # Make
  6. # 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:

  1. # Vi/etc/profile
  2. // Add the following content
  3. Export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/local/APR/lib
  4. // Make the profile take effect,
  5. # 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:

  1. # Bin/startup. Sh
  2. # Head logs/Catalina. Out
  3. // You can see the following results:
  4. Information: loaded APR based Apache Tomcat native library 1.1.14.
  5. 2009-1-13 11:12:51 org. Apache. Catalina. Core. aprlifecyclelistener init
  6. 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.