Install and configure APR and tomcat-native and centostomcatnative in CentOS

Source: Internet
Author: User
Tags openssl library

Install and configure APR and tomcat-native and centostomcatnative in CentOS

APR:Apache Portable Run-time libraries
In earlier versions of Apache, applications must be able to process details of various operating system platforms and call different processing functions for different platforms. With the further development of Apache, the Apache organization decided to separate these general functions and develop them into a new project. In this way, the development of APR is independent from Apache. Apache only uses APR.
Tomcat Native:This project allows Tomcat to use Apache's apr package to process file and network I/O operations to improve performance.
Official Website introduction:The Apache Tomcat Native Library is an optional component for use with Apache Tomcat that allows Tomcat to use certain native resources for performance, compatibility, etc. (it probably means Tomcat can use some native resources to improve performance and compatibility .)
Specifically, the Apache Tomcat Native Library gives Tomcat access to the Apache Portable Runtime (APR) library's network connection (socket) implementation and random-number generator. (specifically, the network connection implementation and random number generator in the APR library are used .)

Features of the APR connector:

  • Non-blocking I/O for Keep-Alive requests (between requests)
  • Uses OpenSSL for TLS/SSL capabilities (if supported by linked APR library)
  • FIPS 140-2 support for TLS/SSL (if supported by linked OpenSSL library)

In Linux, Tomcat requires three components to enable APR:
  • Apr
  • Apr-util
  • Tomcat-native.tar.gz (Tomcat comes with, under the bin directory)

1. Check whether apr and apr-util are installed.# Rpm-qa aprapr-1.4.8-3.el7.x86_64
# Rpm-qa apr-utilapr-util-1.5.2-6.el7.x86_64
2. Check whether the latest versions of apr and apr-util are available.# Yum list | grep aprapr. x86_64 1.4.8-3. el7 @ anacondaapr-util.x86_64 1.5.2-6. el7 @ anaconda
3. If not, use yum to install:# Yum install apr-devel apr-util

4. install tomcat-native:Search for the tomcat-native installation package: # yum list | grep tomcat-native
If it already exists, install: # yum install tomcat-native ...... Installing: tomcat-native-1.1.30-1.el7.x86_64 1/1 verification in: tomcat-native-1.1.30-1.el7.x86_64 1/1
Installed: tomcat-native.x86_64. 1.30-1. el7 finished!
Check if installation is successful: # rpm-qa tomcat-nativetomcat-native-1.1.30-1.el7.x86_64
Configure related global variables: # vi/etc/profile Add: export LD_LIBRARY_PATH = $ LD_LIBRARY_PATH:/usr/local/apr/lib # source/etc/profile
5. Restart Tomcat to see if APR can be used successfully.If everything is normal: APR startup:[Main] org. apache. coyote. AbstractProtocol. start Starting ProtocolHandler ["http-apr-18080"] [main] org. apache. catalina. startup. Catalina. start Server startup in 13617 MS It is faster than NIO (~ 15% ): NIO startup:[Main] org. apache. coyote. AbstractProtocol. start Starting ProtocolHandler ["http-nio-18080"] [main] org. apache. catalina. startup. Catalina. start Server startup in 15671 MS
If an exception log is found, for example, 14:46:04. 949 SEVERE [main] org. apache. catalina. core. aprLifecycleListener. init An incompatible version 1.1.30 of the APR based Apache Tomcat Native library is installed, while Tomcat requires version 1.1.32
The tomcat-native version is too low. Delete: # yum erase tomcat-native
Use yum to check whether the latest version is available: # yum update tomcat-native if yum cannot find the latest version, download it or unzip it from Tomcat/bin.
Decompress the tomcat-native.tar.gz file from the Tomcat/bindirectory:
# Tar-zxvf tomcat-native.tar.gz
Get the folder: tomcat-native-1.1.33-src # cd tomcat-native-1.1.33-src/jni/native /#. /configure -- with-apr =/usr/local/apr (other parameters in the examples on the official website are not required and will be found automatically) # make & make install
Refer:Http://tomcat.apache.org/native-doc/Tomcat Connector three operating modes (BIO, NIO, APR) Comparison and optimization: http://blog.csdn.net/clementad/article/details/47045673

(For Original Articles, please note

Related Article

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.