Tomcat 10.1.x on Amazon Linux

This document provides step-by-step instructions for installing and configuring the OvalEdge application on Amazon Linux using Apache Tomcat 10.1.x. It covers user creation, Java and Tomcat setup, database and Elasticsearch integration, and deployment of the OvalEdge application.

Prerequisites

  • User Access: Installer must have sudo privileges.

  • System: Amazon Linux VM with sufficient CPU, memory (≥8 GB), and disk space for two Tomcat instances.

  • Network: Internet access; required ports open: 8080 (UI), 8081 (Job), 3306 (MySQL), 9200 (Elasticsearch, if used).

  • Artifacts: ovaledge.war, external JARs, log4j.properties, and oasis.properties available in the user’s home directory.

  • Database & Elasticsearch: Target MySQL and Elasticsearch must be accessible with credentials for oasis.properties.

Steps Involved

  1. Create OvalEdge User

    • Create a new system user for OvalEdge:

      sudo adduser ovaledge
    • Set a password for the new user:

      sudo passwd ovaledge
    • Add the user to the wheel group for administrative privileges:

      sudo usermod -aG wheel ovaledge
    • Switch to the OvalEdge user account:

      sudo su - ovaledge

  1. Create Required Directories

    • Create the following directories under the OvalEdge user home directory or a mounted directory:

      mkdir -p ovaledge/extprop
      mkdir -p ovaledge/temp
      mkdir -p ovaledge/third_party_jars
    • Download all shared artifacts (.jars & .war) into the ovaledge folder under the user's home directory.

    • Download the log4j.properties and oasis.properties files into the ovaledge/extprop folder.

  2. Java Installation

    • Update system packages:

      sudo yum update
    • Install Java 17 (Amazon Corretto):

      sudo yum install java-17-amazon-corretto -y
    • Verify the Java installation:

      java -version

  1. Tomcat Setup

    • Tomcat UI Installation

      • Download Tomcat in the ovaledge directory:

        wget https://archive.apache.org/dist/tomcat/tomcat-10/v10.1.40/bin/apache-tomcat-10.1.40.tar.gz
      • Extract the downloaded archive:

        tar xvf apache-tomcat-10.1.40.tar.gz
      • Rename the extracted folder to tomcatui:

        mv apache-tomcat-10.1.40 tomcatui
      • Move the ovaledge.war file to the webapps folder:

        mv /home/<user>/ovaledge/ovaledge.war /home/<user>/ovaledge/tomcatui/webapps
      • Create setenv.sh in tomcatui/bin/ with the following parameters:

        export CATALINA_OPTS="-Duse.http=true \
        -DOVALEDGE_SECURITY_TYPE=db \
        -Dext.properties.dir=file:/home/<user>/ovaledge/extprop/ \
        -Xms7g -Xmx9g \
        -Dpod.type=ovaledge-ui-deployment \
        -Dlog4j.configuration=file:/home/<user>/ovaledge/extprop/log4j.properties"
        
    • Tomcat Job Installation

      • Copy tomcatui to create tomcatjob:

        cp -R tomcatui tomcatjob
      • Edit the server.xml file in tomcatjob/conf/ to update ports:

        • Change HTTP port from 80808081

        • Change shutdown port from 80058006

      • In tomcatjob/bin/, create setenv.sh with the following:

        export CATALINA_OPTS="-Duse.http=true \
        -DOVALEDGE_SECURITY_TYPE=db \
        -Dext.properties.dir=file:/home/<user>/ovaledge/extprop/ \
        -Xms7g -Xmx9g \
        -Dpod.type=ovaledge-job-deployment \
        -Dlog4j.configuration=file:/home/<user>/ovaledge/extprop/log4j.properties"

  2. Tomcat as a Service

    • Go to /etc/systemd/system and create service files:

      • Tomcat UI (tomcat1.service):

        [Unit]
        Description=Apache Tomcat Web Application Container
        After=network.target
        
        [Service]
        Type=forking
        ExecStart=/home/<user>/ovaledge/tomcatui/bin/startup.sh
        ExecStop=/home/<user>/ovaledge/tomcatui/bin/shutdown.sh
        User=<username_vm>
        Group=<username_vm>
        
        [Install]
        WantedBy=multi-user.target
      • Tomcat Job (tomcat2.service):

        [Unit]
        Description=Apache Tomcat Web Application Container
        After=network.target
        
        [Service]
        Type=forking
        ExecStart=/home/<user>/ovaledge/tomcatjob/bin/startup.sh
        ExecStop=/home/<user>/ovaledge/tomcatjob/bin/shutdown.sh
        User=<username_vm>
        Group=<username_vm>
        
        [Install]
        WantedBy=multi-user.target
    • Apply SELinux context for Tomcat directories:

      sudo semanage fcontext -a -t bin_t "/home/<user_name>/ovaledge/tomcatui(/.*)?"
      sudo semanage fcontext -a -t bin_t "/home/<user_name>/ovaledge/tomcatjob(/.*)?"
      sudo restorecon -Rv /home/<user_name>/ovaledge/tomcatui
      sudo restorecon -Rv /home/<user_name>/ovaledge/tomcatjob

  3. Set up Database

    • Navigate to extprop:

    cd /home/<user>/ovaledge/extprop/
    • Update oasis.properties with database details:

    url=jdbc:mysql://<vm_host or cloud_host>:3306/ovaledgedb?useUnicode=true&character_set_server=utf8mb4&useSSL=false&allowPublicKeyRetrieval=true

    ⚠️ After executing the OvalEdge Master database, change the default user password and update it in oasis.properties. Sample Reference Screenshot:

  4. Elasticsearch Integration

    • Edit oasis.properties in extprop to configure Elasticsearch variables (es.password, es.host, etc.). Sample Reference Screenshot:

  5. External Jars Path

    • In oasis.properties, update the path to the external JARs:

    /home/<username>/ovaledge/third_party_jars/

    Sample Reference Screenshot:

  6. Run OvalEdge

    • Reload systemd and enable services:

    sudo systemctl daemon-reload
    sudo systemctl enable tomcat1.service
    sudo systemctl enable tomcat2.service
    • Start the Tomcat services:

    sudo systemctl start tomcat1.service
    sudo systemctl start tomcat2.service
    • Check the status of both services:

    sudo systemctl status tomcat1.service
    sudo systemctl status tomcat2.service
    • Check Tomcat UI logs:

    tail -f /home/<user_name>/ovaledge/tomcatui/logs
    • Access the application at:

    http://<PublicIP>:8080/ovaledge/login
    • Apply the license provided by the OvalEdge CSM Team.

    • Log in with the one-time admin credentials and immediately change the default password.


Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.

Last updated

Was this helpful?