# Tomcat on Ubuntu 22.04

## Introduction

This document provides detailed steps to install and configure the OvalEdge Application on an Ubuntu 22.04 machine. It includes both single-instance and multi-instance (UI and Job) deployment options using Apache Tomcat.

### Prerequisites

* Ubuntu 22.04 system with internet access
* A user with sudo privileges
* Java 17 installed ([**Installation of JAVA on Ubuntu 22.04**](https://docs.ovaledge.com/~/changes/967/deployment-and-maintenance/installation/java-17.x-on-ubuntu-22.04+))
* MySQL (local VM [**Installation of MySQL on Ubuntu 22.04**](https://docs.ovaledge.com/~/changes/967/deployment-and-maintenance/installation/mysql-8.4.x-on-ubuntu-22.04+) or AWS RDS) installed and accessible
* Required configuration files and `.jar` packages provided by OvalEdge Support

### Single-Instance Deployment (Single Tomcat)

1. #### Create Required Directories
   * Log in to the application VM and create the following directories to store application configuration files and dependencies:

     ```bash
     mkdir ~/extprop ~/temp ~/third_party_jars
     ```

     \
     Sample Reference Screenshot:

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdvuvMw7QBLeqmv1C-8goggi7luRTVPWbWgo8-bSkd5W0fXHvDjWwJN69f3IGnbAPNsFZX4Nws4TjCwYItJkmH522NIpuYlSVCXoDwR6hL4kfLxppmm9HfJKINQX7FEi8S8SWsObw?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><ul><li>The <code>oasis.properties</code> and <code>log4j.properties</code> files will be provided by the OvalEdge Team. Place them in the <code>extprop</code> folder.</li><li>JAR files required for the application will also be provided. Place them in the <code>third_party_jars</code> folder.</li></ul></div>

2. Place Configuration Files
   * Download and place the following files into the respective folders (provided by OvalEdge Support):

     * `oasis.properties` → `~/extprop/`
     * `log4j.properties` → `~/extprop/`
     * Third-party JARs → `~/third_party_jars/`\ <br>

     \
     Sample Reference Screenshot:

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcA3aWNxXekef2Uw7a6uY8tIIPlwakqfE4aEMq-mMNFnxh8y_N2ArpkB9LC3wbrlj8ZNlkdxDYSXYrX7S_Ne_EBgZ7mS-CRcq-zZomRvd7bLR07-0TBBwzVIt7yxH6JkViIpHI4QQ?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

3. Download and Extract Tomcat
   * Download the required JAR file into the `third_party_jars` folder as shown below. The JAR files will be provided by the OvalEdge team.\
     \
     Sample Reference Screenshot:

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd6Pk75BEVeL0E93zUF8teJ7KCC-yyp7nOPIIeknWI0C2OCaTWTMExXnSx0zAKEAS4Q8jsDGUVNkQuDnHrkMmv1E12fH17hYp4ekgpzLzoFgNjA5xeXkxifjQRMR5CceAbxuyc5?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>
   * Now download the Tomcat using the URL below as shown.

     **Link:** [Tomcat Link](https://ovaledge.s3.us-west-1.amazonaws.com/scripts/hardened_tomcat/apache-tomcat-10.1.40.tar.gz)

     ```bash
     wget https://ovaledge.s3.us-west-1.amazonaws.com/scripts/hardened_tomcat/apache-tomcat-10.1.40.tar.gz
     tar -xvf apache-tomcat-10.1.40.tar.gz
     ```

     \
     Sample Reference Screenshot 01:

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdAMiargER88pMbsXzvBhy229zAQ9xotfTW1LIPfE9j7YzPjSxFWmjy_ACTSZMmidfCsrYPTMCK_6g_mvnDzbuzmEUgaZyM2jZ74ELlYck6clKDWXkCQJ5lT8GFrwKqRRlHPv3S?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>

     \
     Sample Reference Screenshot 02:

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfdIOSEhsFsruc2o_5HIrIVcWCChgs-bZQ3W954SpoWAqVsp3tMEOKwx1WhlyG4wgqv9Fu1e7f_26a81omKJgfGSxsZ9Jyv1ppO5bPPorBqTK0gINBt1vgrODtZAhTgcnA0Gs471A?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

4. Configure Environment Variables
   * Navigate to the Tomcat bin directory and create the `setenv.sh` file:

     ```bash
     vi apache-tomcat-10.1.40/bin/setenv.sh
     ```

     Add the following (replace `<client_input>` with the actual key):

     ```bash
     export CATALINA_OPTS="-Duse.http=true -DOVALEDGE_SECURITY_TYPE=db \
     -Dlog4j.configuration=file:/home/ovaledge/extprop/log4j.properties \
     -Dext.properties.dir=file:/home/ovaledge/extprop/ -Xms4g -Xmx7g \
     -DOVALEDGE_ENCRYPT_DECRYPT_KEY=<client_input> \
     --add-opens=jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED \
     --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED \
     --add-opens=java.base/java.net=ALL-UNNAMED"
     ```

     ✅ Ensure the path to `oasis.properties` and `log4j.properties` is correct.\
     \
     Sample Reference Screenshot:

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcTGb7h1xPeFcTnxLU_2ccjYAgp4WmV_Cn4lZMj_YNEcchspCHr-7QwFolPI--8Ki9D8smhBp91kECJCDKRdsEY4IiioESn1bfrErpqQFlxzKEmViuD4_-luhKI_unM2ZREJT0J?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

5. Deploy OvalEdge Application
   * Navigate to the webapps directory and copy or download the `ovaledge.war` file (provided by the OvalEdge Team):
     * Place the `ovaledge.war` file into the `webapps` directory.\
       \
       Sample Reference Screenshot:

       <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe9rzQIn1FUMmXYSseur_CwFx7pa_OLQojdEDU3AjTLLnBD7-D8spKdFZqfkYnfh_SA5OWQnwKoacouz3ABiczPVFYYJiSYbVnKXZIIfaoh_EnpK2LT_V3oF98zyXLzjSEMPm6Prw?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

6. Update Configuration Files

   * Edit `oasis.properties` in `extprop` folder\
     \
     Sample Reference Screenshot:

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd3uiJB-kQsQN4DIThP4TRBXo745rMAcg84M5hEZhGQVw4XlcXre476kFix1ZSe54CdSC3PrWqoyz-0eZ3XO2U5n3WFxgoAMHIDw8C5tgu3E9iEahCj_dIAXT_sskuuqFttNCU3?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

     * **Database Section:** Replace localhost, username, and password with your MySQL connection details.
     * **Elasticsearch Section:**\
       Sample Reference Screenshot:

       <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeJR4Ft8DitlvW5K4pbnhVqUdAReBoGMriEKlAlN25c1zvps6V21PvkDxfbHXYHppHdyEgc7MKywafIjM7WDbEyVesjVWcV5uxYCQRyCZgvBTdkHc5MThz3GSw6H2alKyNwTteX?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

       * Set `elasticsearch.enabled=true`
       * Set `es.host` and `es.password` with actual values
     * Update the JARs path to point to the `third_party_jars` folder:
       * `/home/ovaledge/third_party_jars`\
         \
         \
         \
         &#x20;\
         \
         Sample Reference Screenshot:

         <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfMr-hxrBJ_CuEnr_hswh8rWhk5w0mU2jK4JHdjCyCeoYv5UqqBPwAK8RK7Gh0gTWqitCOmP1wj54_0BIMnO3hOOJTDfImC1nijhNaRsOntOBkTlOh9O1IELuWXBRtbh2-ecnne5g?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>
   * Save the file after making changes.

7. Update `log4j.properties` Configuration

   * Edit the `log4j.properties` file in the `extprop` directory:
     * Uncomment the 1st line
     * Comment the 2nd line\
       \
       Sample Reference Screenshot:

       <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXf4SiwORH6uNt2IWbYEeGxPgZsv89uYpyBCh0uzZwtZ8LcnCINaYBc7ncC1oSp5F3jKYKtwGS5FQ-ICOowVAnEgZMG38_MokpwjmJffa_8tcv8sQq-TD3fw31gHzXS4owtJr2TbZA?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>
   * Save the file after editing.

8. Create Tomcat Service

   * Create a systemd service file to manage Tomcat as a Linux service:

     ```bash
     sudo vi /etc/systemd/system/tomcat.service
     ```
   * Paste the following content:

     ```ini
     [Unit]
     Description=Apache Tomcat for OvalEdge
     After=network.target

     [Service]
     Type=forking
     WorkingDirectory=/home/ovaledge/apache-tomcat-10.1.40/bin
     ExecStart=/bin/bash /home/ovaledge/apache-tomcat-10.1.40/bin/startup.sh
     ExecStop=/bin/bash/home/ovaledge/apache-tomcat-10.1.40/bin/shutdown.sh
     User=ovaledge
     Group=ovaledge

     [Install]
     WantedBy=multi-user.target
     ```

     \
     Sample Reference Screenshot:

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcFsvAgmDQhcgaPcg4gftHlK6kQckGLSmEJSUEIXQROzDVqUMu22UCjfFjA1Gv822XVbTQVW_F0cpeusBee-gUVmPgGLp8AIxH_8Dbc04bV6XXvIYQh8qvhYZT5dtjiy-5UX_9-XA?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>
   * Save and close the file.

9. Start and Enable Tomcat
   * Run the following commands to register and start the Tomcat service:

     ```bash
     sudo systemctl daemon-reload
     sudo systemctl enable tomcat
     sudo systemctl start tomcat
     ```

     Sample Reference Screenshot:

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcKvVCX0Wb_U0H8OvyOJaYj5IwTnI8ExHtSM1TfhbcClA7on7VVecu5JqSOvHhOn7yrmxs_yRrqRDeI5WrQ7zFt-VLJYxn0qf8dPm_wW3vhcfId4FnjquPd0ukw9dqWwb1OKLmW-A?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

10. Access the Application
    * After a few minutes, open a browser and go to:

      ```
      http://<VM-IP>:8080/ovaledge
      ```

      \
      Sample Reference Screenshot:

      <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe2ZLjIA6IWbi76KSdqeOLl_ggrhpbnf6dxV9CjLYFuYLONWVuVb__eW8fyXwl2glpsGOWy3e8JTgkyKBhv7MSShucVYkSFE3_ZaOGsWMnssnDPbAdAHcDwZfdB39UgqxWxbdaOjg?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

### Multi Tomcat Installation

1. Log in to Application VM

   ```bash
   ssh <user>@<application_vm_ip>
   ```

   \
   Sample Reference Screenshot:

   <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcOGOyfpVR2g_a7m5gtJQrE5HEf6YrpHsTtWDUEEM-a0ZEMFrxv1i8Bqrnr-9OcNkzo-Z_OjkuiO-hXmgdQn-kDn7EhIzFpTt1Tmaz4JO97VzRRvggpu-Eqx1lWn_-bPknQ4d-O?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

2. Create Required Directories
   * Create the following directories to store configuration files and external libraries:

     ```bash
     mkdir ~/extprop ~/temp ~/third_party_jars
     ```

     <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><ul><li><code>oasis.properties</code> and <code>log4j.properties</code> will be provided by the OvalEdge team. Place them in the <code>extprop</code> folder.</li><li>JAR files required for the application should be placed in the <code>third_party_jars</code> folder.</li></ul></div>

     \
     Sample Reference Screenshot:

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeVa_Uwrf4wLkwYnSqA8Y8N-Y2wxILxWxnA7QN-oOq6TP9z1HUD22gLoHlBxVV6slCNQXZNPb8-FrO8Xn_5gMYon9YmulnIJ8c7hwBUtNBOmqZgvHwKJxw9Y3Q2FAjgd-G7WxRaPA?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>

3. Download Required Files
   * Download the `oasis.properties` and `log4j.properties` files into the `extprop` folder. These files will be shared by the OvalEdge team.

     \
     Sample Reference Screenshot:

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfSH0ej1GSdZgwKmxJuJHm8u01DKHP-5sbgmjK6zBBv883ygv_ZZ_TOUzi8JhyBFpFl56MjG-IdGhtaxvRzNnsogB6lqbBVZB-0FtkLLQUNYpsOqPk_1oWg-pCo0gA1nJdbq3pX4A?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>
   * Download Tomcat: [Tomcat Link](https://ovaledge.s3.us-west-1.amazonaws.com/scripts/hardened_tomcat/apache-tomcat-10.1.40.tar.gz)

     ```bash
     wget https://ovaledge.s3.us-west-1.amazonaws.com/scripts/hardened_tomcat/apache-tomcat-10.1.40.tar.gz
     tar -xvf apache-tomcat-10.1.40.tar.gz
     ```

     \
     Sample Reference Screenshots:

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd-O8i4WP0c22BzIPctmsV5fkehTPpWkIqItGK7OU8v8SzvJPFB_r6giGU5GHDFNDpdnuFzHCEfnFAdhIdxzH7j9bOJlcTPlcZxRlfge953H95hkR_K8TyhMKhiX605_OwbHQJ2uA?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

     <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfzGbWjBp-UFl3O-iCwUSJvq7_kCImKy0krhTCSgx7mXmFjRYNjE8d_uzAxebP3kAeQkQr--ShCrMcsdEhFrBlW7Wi9HmJe120XDjAizDUdMYP51l9ItRbfJEhWcsS92bKP-G6G5w?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>

     <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXde1t5_yArPoR2nRl3sOYzf1qnJhEsdWrzc_UIFCwLb9M1RZr0vfTlqFgGiV2TGHwV1si64IE9pzyg13eLobKjfA-VlHrTkRylOFcf-f7w3qLLfiXuokj2w0eLhjAnBpieHxbSk5Q?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

4. Download WAR and Config Files
   * Place the following files (provided by OvalEdge):
     * `ovaledge.war` → to be placed in `webapps` of each Tomcat instance
     * `oasis.properties`, `log4j.properties` → `~/extprop`
     * Additional JARs → `~/third_party_jars`

### Tomcat UI Instance Setup

* Once the above steps are completed, rename the apache-tomcat-10.1.40 directory to tomcatui as shown below.

  ```bash
  mv apache-tomcat-10.1.40 tomcatui
  ```

  \
  Sample Reference Screenshot:

  <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdwIGLFH5xpomZshnvK9GJsNtcq-garnuEWleaW73t9RLWPJwDyOewmzdVXIvojt1dzGpD7pfA5eBTc36G-U2xAa-FTzVl_Qpw8ap0_nnNxnPHY9ujrETKIja8Qa2E5pL-Es4ywzQ?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

#### Deploy WAR File

* Navigate to the tomcatui/webapps folder and download the ovaledge.war file as shown below.

  ```bash
  cp ~/Downloads/ovaledge.war ~/tomcatui/webapps/
  ```

  \
  Sample Reference Screenshot:

  <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXefdftQ5NC2LPTB0U19HMY9-sxfSj-hcQ8MZpOKagMLwghIQ8US_YpxUbCs9f4ONCvr7GVDI9hJd_0NaacA5fj8-pgnlnqoaGQO-ekV0rfevh5y0htvopG5_zRWvEL6n7LmCw82AQ?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

  <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>The ovaledge.war file will be provided by the OvalEdge team.</p></div>

#### Configure Environment Variables

* Create and edit the setenv.sh file inside tomcatui/bin:

  ```bash
  vi ~/tomcatui/bin/setenv.sh
  ```
* Paste the following content (replace with the actual value shared by OvalEdge):

  ```bash
  export CATALINA_OPTS="-Duse.http=true \
  --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED \
  --add-opens=jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED \
  --add-opens=java.base/java.net=ALL-UNNAMED \
  -DOVALEDGE_SECURITY_TYPE=db \
  -Dext.properties.dir=file:/home/ovaledge/extprop/ \
  -DOVALEDGE_ENCRYPT_DECRYPT_KEY=<encrypt-decrypt> \
  -Dpod.type=ovaledge-ui-deployment \
  -Xms4g -Xmx8g"
  ```

  \
  Sample Reference Screenshot:

  <figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2F0bBJdTfa8DAPBatIIl9b%2Fimage.png?alt=media&#x26;token=445a9822-1a50-4eac-96e1-2121304768d7" alt=""><figcaption></figcaption></figure>
* Save and exit.

#### Tomcat Job Instance Setup

* Duplicate the UI Tomcat Instance.

  ```bash
  cp -R ~/tomcatui ~/tomcatjob
  ```

  \
  Sample Reference Screenshot:

  <div align="left"><figure><img src="https://1813356899-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FhTnkoJQml0pok9awFDhx%2Fuploads%2FFXtOenMB6dNj8dUaqusD%2Fimage.png?alt=media&#x26;token=715c9eff-8d1f-4680-9e87-d17884f71849" alt=""><figcaption></figcaption></figure></div>
* Update Job `setenv.sh`:

  ```bash
  vi ~/tomcatjob/bin/setenv.sh
  ```
* Replace the content with:

  ```bash
  export CATALINA_OPTS="-Duse.http=true \
  --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED \
  --add-opens=jdk.zipfs/jdk.nio.zipfs=ALL-UNNAMED \
  --add-opens=java.base/java.net=ALL-UNNAMED \
  -DOVALEDGE_SECURITY_TYPE=db \
  -Dext.properties.dir=file:/home/ovaledge/extprop/ \
  -DOVALEDGE_ENCRYPT_DECRYPT_KEY=<encrypt-decrypt> \
  -Dpod.type=ovaledge-job-deployment \
  -Xms4g -Xmx8g"
  ```

  \
  Sample Reference Screenshot:

  <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXe-wOXo633jZ1wOdyAODqcXZ5dbXKI8h44Bv3EUnxR-umSBnt8c8NS4CexGGkgBQVcAMdd0dvy2liJ1lNDhVNqlfQlwVaPgjuc31Iez030UhkLkmPwjkrRWIZibdW1Dy25xfIvL8g?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>
* Ensure that the -Dpod.type is set to ovaledge-job-deployment.
* Save and exit the file.

#### Update Ports in Job Instance

* Edit `server.xml`:

  ```bash
  vi ~/tomcatjob/conf/server.xml
  ```
* Change the following ports to avoid conflicts with the UI instance:

  * Default Port New Port for Job
  * Shutdown port: `8005 → 8006`
  * HTTP connector port: `8080 → 8081`

  Sample Reference Screenshot 01

  <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeUB2RrgGEYIXptKmNOPEsjg8M0klRwyH4UXbzwysB4QJ0x82BWi5R7l_YIwFpoH5r_BB-Uicbrns6sQFQDOwPWfQUsHNzeAkcF3O8IcNmi7wNlUlyTlSCoe5UIFTvbTC_GqfphBg?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>

  \
  Sample Reference Screenshot 02

  <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXeMFlP1xU0zNYDohv7kY-O3arQ73F6gK_iMjem_eI6ed0qXVYs7T33L8irQ-HVD436iyFZb9RloFjJ8rqKW02Xh3YMc0GaWfDFmRxWN6JniJI3LxWAB252v2jNu53kJk1Z_QyW-4w?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>
* Make sure all port references are updated correctly. Save and exit.

#### Expose Tomcat Instances as Systemd Services

To enable Tomcat UI and Job instances to start, stop, and restart as managed services on Linux, follow the steps below:

* Navigate to the Systemd Directory.

  ```bash
  cd /etc/systemd/system
  ```
* Create the tomcatui Service File.
  * Create a systemd service unit for the UI instance:

    ```bash
    sudo vim tomcatui.service
    ```
  * Paste the following configuration:

    ```ini
    [Unit]
    Description=Apache Tomcat Web Application Container for OvalEdge UI
    After=syslog.target network.target

    [Service]
    Type=forking
    WorkingDirectory=/home/ovaledge/tomcatui/bin
    ExecStart=/bin/bash /home/ovaledge/tomcatui/bin/startup.sh
    ExecStop=/bin/bash /home/ovaledge/tomcatui/bin/shutdown.sh
    User=ovaledge
    Group=ovaledge

    [Install]
    WantedBy=multi-user.target
    ```

    \
    Sample Reference Screenshot:

    <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXfqweMgq0ycKXFM5RQfrpl6siNr20u_TQUVLucaFIEMaWMW2sjC7Osjsq18V-xZSK-UXhmk1_DxMJjnidfy9CmzLe5F9I97O1rOrFjoXbLTDa8Q4CXoCrAMFJDIEeWDB4EUjhgJKg?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>
  * Save and exit the file.
* Create the Tomcat Job Service File.
  * Create the service file for the Job instance:

    ```bash
    sudo vim tomcatjob.service
    ```
  * Insert the following content:

    ```ini
    [Unit]
    Description=Apache Tomcat Web Application Container for OvalEdge Job
    After=syslog.target network.target

    [Service]
    Type=forking
    WorkingDirectory=/home/ovaledge/tomcatjob/bin
    ExecStart=/bin/bash /home/ovaledge/tomcatjob/bin/startup.sh
    ExecStop=/bin/bash /home/ovaledge/tomcatjob/bin/shutdown.sh
    User=ovaledge
    Group=ovaledge

    [Install]
    WantedBy=multi-user.target
    ```

    \
    Sample Reference Screenshot:

    <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXelgMfVXP3QiGAEiuh5xGJMvDEQUk4_n5hUAquxFGRPmVHxPDItVYTLi5zZ47ZRRJmS-flqcZWqs0gA-qarw7RA9bEZDom-IQTFip6QNEQo_6qMMcVArDjMenFKy72FjmeeMh-yWA?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>
  * Save and exit the file.
* Reload Systemd Services
  * Reload the systemd daemon to apply the newly created service units:

    ```bash
    sudo systemctl daemon-reload
    ```

#### Configure oasis.properties and log4j.properties Files

After completing the deployment steps, you must configure the application properties to reflect your environment. Follow the steps below:

* Edit oasis.properties File
  * Navigate to the extprop folder and open the oasis.properties file in a text editor:

    ```bash
    cd /home/ovaledge/extprop
    vi oasis.properties
    ```

#### Database Configuration

* Update the database-related properties:
  * Replace localhost with your MySQL endpoint.

    <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXereSdtSAvBjoHliLxN9fqE9KZxX1HZFPQ2oGyGDjA81Y8HDUR5IDW4dVNsOrlrgd0AQ5Q88oAJ7YI0y6EyHlntUXmK1h7mztYLEGZuDTL020sXEzjZZJD-xl8izDUmSuPTG7Wa?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>
  * Replace username and password with your actual MySQL credentials.&#x20;

    Example:

    ```properties
    db.url=jdbc:mysql://<your-mysql-endpoint>:3306/ovaledge
    db.username=<your-username>
    db.password=<your-password>
    ```

    \
    Sample Reference Screenshot:

    <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdkT4QSg7ChA6dVUKH6d-Vt4dJ3EOwZ48aUBSCp4UAMahBDv5_IcoZ6aecQjedDGdjSoTIJIjDUS01bh8x9TW5fTNI6OsuFlTRdANkk36C_QtRNkP3jF3qt_TMbXn4hA44CuJL81Q?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>

    <br>
  * Set `elasticsearch.enabled=true` if Elasticsearch is available.
  * Provide your Elasticsearch host details.\
    Example:

    ```properties
    elasticsearch.enabled=true
    es.host=<your-es-host>
    es.password=<your-es-password>
    ```

* **JARs Path Configuration**
  * Specify the correct path for the external JAR files. If you downloaded the JARs to the third\_party\_jars folder, update the path accordingly:\
    \
    Sample Reference Screenshot:

    <div align="left"><figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcPsd6ZOdyMfdMKODzy2v_LSgjbW5WCSC8IOBoZWGSdD_cKVbFj11kRUWvWHcn-Moqc8R8umE2g1kbo-OIvquK182acw18tg5o5Y2r4eqln3NbUVVE_THAmkmYeU17OceE_fHS13A?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure></div>

    \
    Example:

    ```properties
    external.jars.path=/home/ovaledge/third_party_jars
    ```
  * Save and close the file.

* Edit log4j.properties File
  * Navigate to the extprop folder and open log4j.properties:

    ```bash
    vi log4j.properties
    ```

    \
    At the top of the file, you'll find two lines — the first is commented out and the second is active. Update them as follows:

    * Uncomment the first line.
    * Comment out the second line.\
      \
      **Sample Reference Screenshot:**

      <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcQ7tr4wVZxYFsUBVg0tsdUNWxeI685wO2yyGq0-Ppk7lsE1eTwE3q75DhX0gadQo1hvro98fle_9FTgMPkfegW74crz3ny2MNVBuUmcKJ0l0g3rRyGisOVyteY83BBVxvZHrvYew?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

      \
      **Before:**

      ```properties
      #log4j.rootLogger=DEBUG, console, file
      log4j.rootLogger=INFO, console, file
      ```

      \
      **After:**

      ```properties
      log4j.rootLogger=DEBUG, console, file
      #log4j.rootLogger=INFO, console, file
      ```
  * Save and close the file.

* Start Tomcat Services
  * Reload systemd and enable both Tomcat services to start on boot, then start them:

    ```bash
    sudo systemctl daemon-reload
    sudo systemctl enable tomcatui
    sudo systemctl enable tomcatjob

    sudo systemctl start tomcatui
    sudo systemctl start tomcatjob
    ```

    \
    Sample Reference Screenshot:

    <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdhgp_rQNVcoNQIBbamuHJ29-M8PQKJxHiHheXOPfpg7XpQC-np9MkB8jxpwqMsi6Mo4fYsbTBxq7nhHSgNMVw09-y53-33pOu5Gsz920-BKFA7ehvMojZy_yV8_h8qAhl8ahEwaQ?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>

* Access the Application
  * Wait for approximately 2 minutes after starting the services, then access the application in a web browser: `http://<IP_ADDRESS>:8080/ovaledge`

    <figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXcRjxbS9LP5a8WpeTUn7VzjfF1l3vCd5LGDLbTyy9hMZTT71EbNCcvwOfG6vvetmWRs-JRyRBjJhAcvyw7j1-XLRezvf_sjq40IGy1xa_3BZfNOiAVCJ7qF-TCm_4w0JgI1g4lg?key=JrlNkVdtC5rJTX9ytztE-A" alt=""><figcaption></figcaption></figure>
  * Replace `<IP_ADDRESS>` with the actual IP of your application VM.

***

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