Difference between revisions of "Tomcat native libraries"

From OpenKM Documentation
Jump to: navigation, search
m
 
(4 intermediate revisions by one other user not shown)
Line 4: Line 4:
  
 
== Install on Linux ==
 
== Install on Linux ==
* In your shell, switch to root:
+
To follow these steps you need to be root.
  $ sudo su -
 
  
 
* Install the APR itself, along with development packages that will be use by the build for the native wrappers:
 
* Install the APR itself, along with development packages that will be use by the build for the native wrappers:
  
** Ubuntu / Debian
+
'''Ubuntu / Debian'''
   $ aptitude install libapr1 libaprutil1 libapr1-dev libssl-dev make
+
   $ aptitude install build-essential libapr1 libaprutil1 libapr1-dev libssl-dev
  
** RedHat / CentOS
+
'''RedHat / CentOS'''
 
   $ yum install apr-devel openssl-devel make
 
   $ yum install apr-devel openssl-devel make
  
Line 25: Line 24:
 
   $ make install
 
   $ make install
  
* Ensure that the native library is in a location where Tomcat can find it:
+
* Modify $TOMCAT_HOME/bin/setenv.sh script to include this library path:
   $ ln -s /usr/local/apr/lib/libtcnative-1.so /usr/lib/libtcnative-1.so
+
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib/sigar:/usr/local/apr/lib
  
 
* Re-start Tomcat and then look in the log: you should see a message like:
 
* Re-start Tomcat and then look in the log: you should see a message like:
   INFO: Loaded APR based Apache Tomcat Native Library 1.1.120
+
   INFO: Loaded APR based Apache Tomcat Native Library 1.1.23
  
 
See also [http://tomcat.apache.org/tomcat-7.0-doc/apr.html Apache Portable Runtime (APR) based Native library for Tomcat].
 
See also [http://tomcat.apache.org/tomcat-7.0-doc/apr.html Apache Portable Runtime (APR) based Native library for Tomcat].
  
 
[[Category: Installation Guide]]
 
[[Category: Installation Guide]]
[[Category: OKM Network]]
 

Latest revision as of 16:53, 11 December 2012

Tomcat can use the Apache Portable Runtime to provide superior scalability, performance, and better integration with native server technologies. The Apache Portable Runtime is a highly portable library that is at the heart of Apache HTTP Server 2.x. APR has many uses, including access to advanced IO functionality (such as sendfile, epoll and OpenSSL), OS level functionality (random number generation, system status, etc), and native process handling (shared memory, NT pipes and Unix sockets).

These features allows making Tomcat a general purpose webserver, will enable much better integration with other native web technologies, and overall make Java much more viable as a full fledged webserver platform rather than simply a backend focused technology.

Install on Linux

To follow these steps you need to be root.

  • Install the APR itself, along with development packages that will be use by the build for the native wrappers:

Ubuntu / Debian

 $ aptitude install build-essential libapr1 libaprutil1 libapr1-dev libssl-dev

RedHat / CentOS

 $ yum install apr-devel openssl-devel make
  • Untar the native wrappers archive that's shipped with Tomcat:
 $ cd $TOMCAT_HOME/bin
 $ tar zxvf tomcat-native.tar.gz
  • Build and install the native wrappers:
 $ cd tomcat-native*/jni/native
 $ ./configure --with-apr=/usr/bin/apr-1-config --with-java-home=/usr/lib/jvm/java-6-sun
 $ make
 $ make install
  • Modify $TOMCAT_HOME/bin/setenv.sh script to include this library path:
 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$CATALINA_HOME/lib/sigar:/usr/local/apr/lib
  • Re-start Tomcat and then look in the log: you should see a message like:
 INFO: Loaded APR based Apache Tomcat Native Library 1.1.23

See also Apache Portable Runtime (APR) based Native library for Tomcat.