Install Apache Tomcat 9 APR on Ubuntu 18

  • Download and install Tomcat (there are enough resources to read about this)
  • Install APR: sudo apt-get install libapr1 libapr1-dev
  • Go into the TOMCAT_HOME/bin directory and unpack the tomcat-native-xxx tarball
  • Edit /etc/environment and add this rule: JAVA_HOME=”/usr/lib/jvm/default-java”
  • Reload variables: source /etc/environment
  • Check if JAVA_HOME is set: echo $JAVA_HOME
  • Go into the tomcat-native-xxx/native directory and type:
  • ./configure –with-java-home=$JAVA_HOME
  • make
  • make install
  • You will need g++ for this:
    sudo apt-get install g++
  • Create or edit the $CATALINA_HOME/bin/setenv.sh file with following lines :
    export LD_LIBRARY_PATH=’$LD_LIBRARY_PATH:/usr/local/apr/lib’
  • restart Tomcat service
  • View catalina.out for:
    org.apache.catalina.core.AprLifecycleListener.lifecycleEvent Loaded APR based Apache Tomcat Native library [1.2.21] using APR version [1.6.3].

Leave a Comment:

* - required fields

This site uses Akismet to reduce spam. Learn how your comment data is processed.

© Keienberg Consultants