Difference between revisions of "Tomcat native libraries"
(Created page with '{{TOCright}} __TOC__ These instructions are related to installing and running Tomcat 7 as a service, which means that will be launched at system boot and will be closed properly…') |
|||
(6 intermediate revisions by one other user not shown) | |||
Line 1: | Line 1: | ||
− | + | 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 | + | 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 | + | == 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 [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]] | ||
− |
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.