Installation de la bibliothèque tomcat-native

2008-05-05
Thomas Martin


J'ai eu récemment à installer la bibliothèque tomcat-native à la demande d'un client d'Evolix. N'étant pas expert Java/Tomcat je sais juste ce que la page officielle décrit : gain de performance, une meilleure génération des ID de sessions et certaines fonctionnalités de monitoring.

De plus cela fait disparaitre le message suivant au démarrage de Tomcat :

catalina_2008-04-18.log:INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/lib/jvm/java-1.5.0...

Voici une copie brute de mes notes d'installation sur un système Debian Etch :

$ cd $HOME/tmp
$ sudo aptitude install libapr1-dev autoconf
$ wget http://tomcat.heanet.ie/native/1.1.9/source/tomcat-native-1.1.9-src.tar.gz
$ tar zxvf tomcat-native-1.1.9-src.tar.gz
$ cd tomcat-native-1.1.9-src/jni/native/
$ apt-get source libapr1
$ sh buildconf --with-apr=./apr-1.2.7/
$ ./configure --with-apr=/usr/bin/apr-config --with-ssl=/usr/include/openssl --with-java-home=/usr/lib/jvm/java-1.5.0-sun
$ make
$ sudo cp .libs/libtcnative-1.so.0.1.3 /usr/lib/jvm/java-1.5.0-sun-1.5.0.14/jre/lib/i386/libtcnative-1.so
$ sudo /etc/init.d/tomcat5.5 restart

Note : l'installation d'une version <1.1.4 avec la version de Tomcat de Debian Etch provoque un message d'erreur.

Il ne me reste plus qu'à en faire un package afin de pouvoir installer ça proprement.