Tomcat uses Native Library in Linux

Source: Internet
Author: User

Tomcat uses Native Library in Linux

Recently, Tomcat is used. To improve performance, Native Library is used. This is used by default in Windows and has to be re-compiled in Linux.

Default CentOS Installation

Yum install apr

It doesn't seem to work. Must be installed by source code

Wget http://mirror.bit.edu.cn/apache//apr/apr-1.5.0.tar.gz


Tar-zxvf apr-1.5.0.tar.gz

Cd apr-1.5.0


./Configure

Make

Make install

Installed in/usr/local/apr by default

Enter the bin directory of tomcat

Tar-zxvf tomcat-native.tar.gz

Cd tomcat-native-1.1.20-src/

Cd jni/native

./Configure -- with-apr =/usr/local/apr -- with-java-home = "/usr/lib/jvm/java-1.7.0" -- with-ssl = yes

Make

Make install

Installed on

/Usr/local/apr/lib

Cd/usr/lib
Ln-s/usr/local/apr/lib/libapr-1.so.0.5.0 lib-apr-1.so
Ln-s/usr/local/apr/lib/libapr-1.so.0.5.0 lib-apr-1.so.0
Ln-s/usr/local/apr/lib/libtcnative-1.so.0.1.20 libtcnative-1.so
Ln-s/usr/local/apr/lib/libtcnative-1.so.0.1.20 libtcnative-1.so

Or create the setenv. sh file in the bin directory of tomcat installation:
LD_LIBRARY_PATH = $ LD_LIBRARY_PATH: $ CATALINA_HOME/lib
Export LD_LIBRARY_PATH
Check
In conf/server. xml, <Listener className = "org. apache. catalina. core. AprLifecycleListener" SSLEngine = "on"/> is enabled by default.

<Connector port = "8080" protocol = "org. apache. coyote. http11.Http11AprProtocol" maxThreads = "150" connectionTimeout = "20000" redirectPort = "8443">

If the configuration is successful, start tomcat and you will see the following information:

Org. apache. coyote. http11.Http11AprProtocol init

For details about Tomcat Native, click here
Tomcat Native: click here

This article permanently updates the link address:

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.