Formatting code for TomcatNativeLibrary


show source only

{{parent page="Tomcat"}}

===Tomcat native library===
When I installed Tomcat 6 + JDK6 on my Linux machine, I get this error when Tomcat is started:
%%
May 25, 2007 6:10:26 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: /usr/java/jdk1.6.0_01/jre/lib/i386/client:/usr/java/jdk1.6.0_01/jre/lib/i386:/usr/java/jdk1.6.0_01/jre/../lib/i386:/oracle/10g/lib:/lib:/usr/lib:/usr/local/lib:/usr/java/packages/lib/i386:/lib:/usr/lib
%%

Out of curiosity, I go to $TOMCAT_HOME/bin and compiled tomcat_native-1.1.10-src.tar.gz. Before that, I also compiled [[http://apr.apache.org apr]] from source.
%%
cd $TOMCAT_HOME/bin
tar zxf tomcat_native-1.1.10-src.tar.gz
cd tomcat-native-1.1.10-src/jni/native
./configure --with-apr=/usr/local/apr --with-ssl=/usr
make && make install
%%

Afterwards, I started Tomcat with java.library.path modified
%%
export JAVA_OPTS="-Djava.library.path=/usr/local/apr/lib"
$TOMCAT_HOME/bin/startup.sh
%%

Walla, the error is gone, and is replaced by something that looks appealing. I tried the example pages, didn't notice much of a difference.... But I guess this may have something to do with NIO in Java6.
%%
May 26, 2007 1:21:14 AM org.apache.catalina.core.AprLifecycleListener init
INFO: Loaded Apache Tomcat Native library 1.1.10.
May 26, 2007 1:21:14 AM org.apache.catalina.core.AprLifecycleListener init
INFO: APR capabilities: IPv6 [true], endfile [true], accept filters [false], random [true].
%%

Once you have tomcat-native library enabled, the default https connector will no longer be serving encrypted contents. Tomcat now uses openssl-style key+certificate. You need to replace the whole connector block with the following:

%%
<Connector port="8443" maxHttpHeaderSize="8192"
maxThreads="150" minSpareThreads="25" maxSpareThreads="75"
enableLookups="false" disableUploadTimeout="true"
acceptCount="100" scheme="https" secure="true"
SSLEngine="on"
SSLCertificateFile="/certs/selfsign.crt"
SSLCertificateKeyFile="/certs/selfsign.pem" />
%%
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki