Skip to content

Building Apache Tomcat

aborkar-ibm edited this page Sep 14, 2023 · 86 revisions

Building Apache Tomcat

Below versions of Apache Tomcat are available in respective distributions at the time of creation of these build instructions:

  • RHEL (7.8, 7.9) have 7.0.76
  • RHEL (8.6, 8.8, 9.0, 9.2) have 9.0.62
  • SLES (12 SP5, 15 SP4) have 9.0.36
  • SLES 15 SP5 has 9.0.75
  • Ubuntu 20.04 has 9.0.31
  • Ubuntu 22.04 has 9.0.58
  • Ubuntu 23.04 has 10.1.6

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.
  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it.

Apache Tomcat binaries are available and can be downloaded from here. To use these binaries, different Java flavors can be installed on mentioned distributions.

Note: Apache Tomcat(v10.1.13) was verified at the time of creation of these instructions

1. Install Java

   export SOURCE_ROOT=/<source_root>/
  • RHEL (7.8, 7.9, 8.6, 8.8, 9.0, 9.2)

    • With OpenJDK11:

      sudo yum install -y java-11-openjdk-devel
    • With OpenJDK17 (Only for RHEL 8.x, 9.x):

      sudo yum install -y java-17-openjdk
    • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)

      • Download and install IBM Semeru Runtime (Java 11 or 17) from here.
    • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

      • Download and install Eclipse Adoptium Temurin Runtime (Java 11 or 17) from here.
  • SLES (12 SP5, 15 SP4, 15 SP5)

    • With OpenJDK11:

      sudo zypper install -y java-11-openjdk-devel
    • With OpenJDK17 (Only SLES 15 SP4 and SLES 15 SP5):

      sudo zypper install -y java-17-openjdk
    • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)

      • Download and install IBM Semeru Runtime (Java 11 or 17) from here.
    • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

      • Download and install Eclipse Adoptium Temurin Runtime (Java 11 or 17) from here.
  • Ubuntu (20.04, 22.04, 23.04)

    • With OpenJDK11:

      sudo apt-get update
      sudo apt-get install -y openjdk-11-jdk
    • With OpenJDK17:

      sudo apt-get update
      sudo apt-get install -y openjdk-17-jdk
    • With IBM Semeru Runtime (previously known as AdoptOpenJDK openj9)

      • Download and install IBM Semeru Runtime (Java 11 or 17) from here.
    • With Eclipse Adoptium Temurin Runtime (previously known as AdoptOpenJDK hotspot)

      • Download and install Eclipse Adoptium Temurin Runtime (Java 11 or 17) from here.

Note: At the time of creation of these build instructions, Apache Tomcat 10.1.13 was verified with OpenJDK 11 (build 11.0.19+7-LTS) and OpenJDK 17 (build build 17.0.7+7), OpenJDK Runtime Environment Temurin-11.0.19.7 (build 11.0.19+7) and OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7) and IBM Semeru Runtime Open Edition 11.0.19.7 (build 11.0.19+7) and IBM Semeru Runtime Open Edition 17.0.7.7 (build 17.0.7+7).

2. Set environment variables

export JAVA_HOME=<Path to Java>
export PATH=$JAVA_HOME/bin:$PATH

3. Start server

To start the server, extract the binary tar to /<source_root>/ and follow steps given below:

cd $SOURCE_ROOT/<apache_tomcat_binary_folder>/
bin/startup.sh

Open http://<ip_address>:8080/ in your browser to access Web UI.

References:

Clone this wiki locally