Install Tomcat native Library under Linux

Source: Internet
Author: User
Tags apache tomcat
Install Tomcat native Library under Linux

Note: Draw the network, collect the induction, in case of need.

Example one:

This problem often occurs after you install Tomcat 5, the Apache Tomcat Native Library which allows optimal performance in production environments is The found on the java.library.path:xxxxxxxxxx;xxxxxxxx always appears on the first line of logs.

To solve this problem, we need to install the native library, respectively, in Windows and Linux under the installation method to give a summary

It's a bit of a hassle under Linux, and I'm using Redhat.

1: First download and install Apr package. I'm using the apr-1.2.12.tar.gz download and run it sequentially./configure|make|make install three commands.

2: There is a binding native library package under bin in the installation directory of Tomcat. After decompression and then into the Build.xml directory, of course, you can also choose to download. Run./configure--with-apr= "/usr/local/apr/" (Apr's default installation path.) Of course you can also write your own installation path)

3: Run make | In the same directory Make install

4: When you are prompted to build successful, you need to set the environment variables. You can select any one of the prompts. I'm setting up export ld_library_path=/usr/local/apr/lib.

Then restart Tomcat, and the problem is solved.


Example two:
Tomcat can use APR to provide better scalability, performance, and integration into local server technology.

Before doing the following, first install Apr (/USR/PORTS/DEVEL/APR), Tomcat6 (/USR/PORTS/WWW/TOMCAT6) through ports.
and add tomcat60_enable= "YES" to the/etc/rc.conf.

Start Tomcat
#/USR/LOCAL/ETC/RC.D/TOMCAT6 Start

By default, Tomcat 6 is started, and the following log appears in the/usr/local/apache-tomcat6.0/logs/stdout.log:

Info:the Apache Tomcat Native Library which allows optimal performance in production environments is not found on the JA Va.library.path:/usr/local/diablo-jdk1.5.0/jre/lib/i386/client:/usr/local/diablo-jdk1.5.0/jre/lib/i386:/usr/ Local/diablo-jdk1.5.0/jre/.. /lib/i386:/usr/lib:/usr/local/lib

Here's how to install Tomcat-native,

# Cd/usr/local/apache-tomcat6.0/bin
# tar XVF tomcat-native.tar.gz
# CD./tomcat-native-1.1.10-src/jni/native/

# setenv java_home/usr/local/diablo-jdk1.5.0/
#./configure--with-apr=/usr/local
# make
# make Install

After the installation, there will be a prompt:
----------------------------------------------------------------------
Libraries have been installed in:
/usr/local/apr/lib

If you are ever happen to want to link against installed libraries
In a given directory, Libdir, your must either use Libtool, and
Specify the full pathname of the library, or use the '-llibdir '
Flag during linking and do at least one of the following:
-Add Libdir to the ' Ld_library_path ' environment variable
During execution
-Add Libdir to the ' Ld_run_path ' environment variable
During linking
-Use the '-WL,--RPATH-WL,LIBDIR ' linker flag

Operating system documentation about shared libraries for
More information, such as the LD (1) and ld.so (8) manual pages.
----------------------------------------------------------------------


One more directory after installation/USR/LOCAL/APR
Then the installation of the above prompts to operate a bit, I use this link in the way:
# ln-s/usr/local/apr/lib/libtcnative-1.so/usr/local/diablo-jdk1.5.0/jre/lib/i386/libtcnative-1.so


Restart Tomcat again,
#/usr/local/etc/rc.d/tomcat6 Restart

Look at Tomcat's log again:
# Cat/usr/local/apache-tomcat6.0/logs/stdout.log

Aug 6, 2007 11:40:01 PM Org.apache.catalina.core.AprLifecycleListener Init
info:loaded Apache Tomcat Native library 1.1.10.
Aug 6, 2007 11:40:01 PM Org.apache.catalina.core.AprLifecycleListener Init
......

Explain how Windows is installed:

Submit Tcnative.dll files to the%java_hom%/bin/directory

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.