what tomcat native library should I be using in production?

Viewed 49631

When I compile my spring mvc app, I get this in the output:

INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jdk1.6.0_17\bin;......

What exactly should I use in production that this is referring to?

6 Answers

Tomcat-native is a version of Tomcat that uses the highly optimized Apache Portable Runtime (APR), the same framework that powers the Apache HTTP server.

I found a post out there:

You can safely ignore this message if you want. Basically it is telling you that an optional shared library (dll on Windows) is not found. The APR is the Apache Portable Runtime. This is a native (non-java) library that can improve the performance of Tomcat in certain situations. On both Windows and Unix/Linux you will need a C compiler to build this library.

To get APR working on a Windows server:

  • install the APR native libs into the Tomcat bin directory (for 64 bit use the tcnative files in the x64 subfolder)

  • add the Tomcat bin folder to the Windows %path% (this adds openssl to your path)

Additional Notes:

You cannot use a Java keystore with the APR connector as it expects certificates in the normal Apache format. To convert a pfx certificate I used:

openssl pkcs12 -in domain.pfx -clcerts -nokeys -out domain.cer
openssl pkcs12 -in domain.pfx -nocerts -nodes  -out domain.key
openssl pkcs12 -in domain.pfx -out domain-ca.crt -nodes -nokeys -cacerts

You will then be able to uncomment / enable the example SSL using the APR connector in Tomcat's server.xml

Related