Install Apache Tomcat Native

Steps to install apache tomcat native and its dependencies

If you are using Apache Tomcat in production then it would be good to install Apache Tomcat native library as it has some optimizations for production use. Below are the steps to install it. The steps were performed on an AWS EC2 instance (Amazon Linux), but should work on most of the linux systems.

  • If you are on an amazon box then login as root and change directory to /opt. This is where we will install the tomcat instance. For everyone else, use whatever user you want the tomcat to run as.
  • Download and Install Apache Tomcat

    Download apache tomcat. We will use using the 8.5.16 version. Extract it. The native source code is in the bin directory. Extract it as well.

  • The native library requires openssl and APR (Apache portable runtime). Lets install those. we will install them in a directory called /opt/softwares. You can install it in any directory that you like.

  • Install Java (JDK) [/h2]

  • Install the development tools for building the various libraries
  • Download and install openssl

  • Install APR (Apache Portable Runtime)

  • Install Tomcat Native

  • The last step is to set up the environment so that apache tomcat runtime can find the native libraries.
    Add the entries below into the setenv.sh file. A new file will be created if not present already.

    Lets start the bean and see how it looks

    If all goes well, you should be able to see this in the output

Leave a Reply

Your email address will not be published. Required fields are marked *