Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Excerpt
  1. Download

    1. To find the latest version, go to the Tomcat downloads page: https://tomcat.apache.org/download-90.cgi
    2. Find the latest Binary Distributions section, then the Core sub-heading, and copy the tar.gz link.
    3. To download Tomcat, on the Linux server, go to the tmp directory. Use the curl command to download from the the tar.gz link.

      Code Block
      cd /tmp
      curl -O httphttps://mirror.ox.ac.uk/sites/rsync.downloads.apache.org/tomcat/tomcat-9/v9.0.3897/bin/apache-tomcat-9.0.3897.tar.gz


  2. Install
    1. Unpack the Tomcat tar.gz file into /opt/tomcat.

      Code Block
      sudo mkdir /opt/tomcat
      cd /opt/tomcat
      sudo tar xvf /tmp/apache-tomcat-9*tar.gz --strip-components=1


      This creates the tomcat folders (conf, logs, webapps etc.) directly under /opt/tomcat.
    2. Set the file ownership and permissions.

      Code Block
      cd /opt/tomcat
      sudo chown -R tomcat:tomcat webapps/ work/ temp/ logs/
      sudo chgrp -R tomcat .
      tomcat
      cd tomcat
      sudo chmod -R g+r conf
      sudo chmod g+x conf


...

  • The memory settings (-Xms and -Xmx) on the line for CATALINA_OPTS are set as needed (this example assumes you are allocating 8GB of memory to tomcat); see Tomcat Planning for  for details of estimating Tomcat's memory allocation
  • The location of the GC (Garbage Collection) log file, set in CATALINA_OPTS, is correct - in the examples below, this /opt/tomcat/logs

...