Tomcat Native Library (APR)– Installation on CentOS

Tomcat can use the Apache Portable Runtime to provide superior scalability, performance, and better integration with native server technologies.

You will see this info often on catalina.out if you dont have the tomcat native library not installed on servers.

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/local/jdk1.6.0_23/jre/lib/amd64/server:/usr/local/jdk1.6.0_23/jre/lib/amd64:/usr/local/jdk1.6.0_23/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib64:/lib64:/lib:/usr/lib

to get rid of this we need to install apr utilities and tomcat native library. Lets see how to install on CentOS 5.4-X86_64

yum install apr.x86_64 apr-devel.x86_64 -y

We installed apr utilities, now we need to install tomcat native libraries

# wget http://mirror.candidhosting.com/pub/apache//tomcat/tomcat-connectors/native/1.1.20/source/tomcat-native-1.1.20-src.tar.gz

# tar -zxvf tomcat-native-1.1.20-src.tar.gz

# cd tomcat-native-1.1.20-src/jni/native

# ./configure –with-apr=/usr/bin/apr-1-config

# make

# make install

# ln -s /usr/local/apr/lib/libtcnative-1.so.0.1.20 /usr/lib/libtcnative-1.so

All done now. Go ahead and restart tomcat and check catalina.out, you can find the APR information like this

INFO: Loaded APR based Apache Tomcat Native library 1.1.20.

2 thoughts on “Tomcat Native Library (APR)– Installation on CentOS”

Leave a Reply

Your email address will not be published. Required fields are marked *