Title | Apache Portable Runtime (APR) based Native library for Tomcat Apache Portable Runtime (APR) based Native library for Tomcat | ||||||
Writer | 이지섭 | Write Date | Jan 16 2018 | Modify Date | Aug 30 2024 | View Count | 5664 |
Apache Portable Runtime (APR) based Native library for Tomcat Requirements:
./configure
When configuring you may be prompted to give the "--with-apr=..." options. If apr is not installed, you must install it manually before proceeding. You can obtain related programs at https://apr.apache.org/.
When installing APR, you may get a sock error during the make test phase.
This may be because the port is in use because APR is already installed.
If you shut down Tomcat with shutdown.sh and run make test, it should succeed.
Again, I'm going to go back and extract the tomcat-native.tar.gz file. /apache-tomcat-8.5.31/bin/tomcat-native-1.2.16-src/native/BUILDING See the above file for details on how to install it.
The following directory names above may vary depending on the downloaded file : apache-tomcat-8.5.31 tomcat-native-1.2.16-src
For example, the BUILDING file includes: 3. Build > configure --with-apr=apr_install_location --with-ssl=openssl_install_location This should produce a file named libtcnative-1.so Note: To build without SSL support use: > configure --disable-openssl --with-apr=apr_install_location
(example) $ ./configure --with-apr=/usr/local/apr-1.7.5 --with-ssl=/usr/local/ssl-3.3.0 --with-java-home=/usr/lib/jvm/java-21-openjdk-amd64
If installed successfully as above, Libraries have been installed in: /usr/local/apr/lib
You can see the above statement.
The APR library is not interlinked in this state. The message is as follows. INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
For the APR library to load, you need to add the "java,library.path" of the library to the JAVA environment from Tomcat.
# only set CATALINA_HOME if not already set
[ -z "$CATALINA_HOME" ] && CATALINA_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
# Copy CATALINA_BASE from CATALINA_HOME if not already set
[ -z "$CATALINA_BASE" ] && CATALINA_BASE="$CATALINA_HOME"
JAVA_OPTS="$JAVA_OPTS -Djava.library.path=/usr/local/apr/lib"
INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.16] using APR version [1.6.3]. INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR capabilities: IPv6 [true], sendfile [true], accept filters [false], random [true]. INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent APR/OpenSSL configuration: useAprConnector [false], useOpenSSL [true] INFO [main] org.apache.catalina.core.AprLifecycleListener.initializeSSL OpenSSL successfully initialized [OpenSSL 1.1.0g 2 Nov 2017]
[Web page referenced] https://tomcat.apache.org/tomcat-7.0-doc/apr.html https://stackoverflow.com/questions/14018817/how-to-add-a-native-library-in-tomcat | |||||||