Configure A Tomcat Instance to Use A Specific Version of Tomcat

Configure A Tomcat Instance to Use A Specific Version of Tomcat

Configure A Tomcat Instance to Use A Specific Version of Tomcat

Objectives

    1. Configure a Tomcat instance to use a specific version of Tomcat.

Prerequisites

    1. Administrative privileges on the tomcat server that you would like to change.

Instructions

    1. Log into the tomcat server via ssh.

    2. Find the directory that contains the version of Tomcat that you would like to use:

        # ls -C1 /srv/tomcat/homes
        # TOMCAT_HOME="/srv/tomcat/homes/apache-tomcat-7.0.75"
        # echo ${TOMCAT_HOME}

    5. Find the basename of the directory that contains the version of Tomcat that you would like to use:

        # TOMCAT_BASE="$(basename ${TOMCAT_HOME})"
        # echo ${TOMCAT_BASE}

    3. Find the directory for the Tomcat instance that you would like to use a specific version of Tomcat:

        # ls -C1 /srv/tomcat/instances
        # TOMCAT_INSTANCE="/srv/tomcat/instances/POSWebApplication"
        # echo ${TOMCAT_INSTANCE}

    4. Find the name of the service for the Tomcat instance:

        # SERVICE_NAME="$(basename ${TOMCAT_INSTANCE})"
        # echo ${SERVICE_NAME}

    6. As the "root" user, edit the init script for this Tomcat instance:

        # vi /etc/init.d/${SERVICE_NAME}

    7. Set the CATALINA_HOME variable to the basename from step 5:

        :%s/export CATALINA_HOME="${BASE_DIR}/homes/tomcat7";/export CATALINA_HOME="${BASE_DIR}/homes/apache-tomcat-7.0.75";/g

    8. Save your changes and quit:

        :wq

    9. Restart the Tomcat instance:

        # service ${SERVICE_NAME} restart

   10. Confirm that the Tomcat instance is using the correct version Tomcat:

        # grep -h -n 'Server number:' ${TOMCAT_INSTANCE}/logs/catalina.log | tail -1

   11. Send an email with output from the following commands to the Systems team:

        # echo "Hostname:              ${HOSTNAME}"
        # echo "Tomcat home directory: ${TOMCAT_HOME}"
        # echo "Tomcat base directory: ${TOMCAT_BASE}"
        # echo "Tomcat instance:       ${TOMCAT_INSTANCE}"
        # echo "Tomcat service name:   ${SERVICE_NAME}"

 


    • Related Articles

    • Configure A Tomcat Instance to Use A Specific Version of the JDK

      Configure A Tomcat Instance to Use A Specific Version of the JDK Objectives Configure a Tomcat instance to use a specific version of the JDK. Prerequisites Administrative privileges on the tomcat server that you would like to change. Instructions 1. ...
    • Prometheus (Grafana) Metrics Tomcat Configuration

      FullCount's Tomcat application servers are configured to export certain JMX MBean values to a metrics file. The metrics in this file are then collected by Prometheus and displayed in dashboards through Grafana. To configure this monitoring, two files ...
    • How To Use Magic Wand on OS Image Version 7.5.0+

      How To Use Magic Wand on OS Image Version 7.5.0+ Objectives Update FullCount OS Images to newer versions via Magic Wand. Prerequisites 1. FullCount Device with OS Image 7.5.0+ 2. A new update available 3. Device Management configured to Allow OS ...
    • Quick Start Use nmtui to Configure Network Interfaces on OS Image 7.3.1+

      Quick Start Use nmtui to Configure Network Interfaces on OS Image 7.3.1+ Objectives Use Network Manager's text user interface to configure network interfaces. Prerequisites Device Keyboard Networking information Instructions 1. Switch to shell by ...
    • Cheatsheet for Terminal OS Image Version 5.0 and Newer

      Task Instructions Why am I doing this? Local Remote Switch to Shell: Connect USB keyboard to terminal. Press Control + Alt + F1. At the login: prompt, type root and press Enter. At the Password: prompt, type #FullCount#Support# and press Enter. ...