Apache Tomcat

Usage

Apache Tomcat is used as the container for Oracle ORDS as well as JRI Publisher.

Stop/Starting/Restarting will restart both the APEX and JRI services.

Layout

The Apache Tomcat (CATALINA) home directory is:

/home/tomcat/apache-tomcat-v/

Where apache-tomcat-v is the version installed.

The CATALINA_HOME variable is set both in the Tomcat init script as well as setenv.sh files.

ORDS File Locations

ORDS is deploy as a war file under:

/home/tomcat/apache-tomcat-v/webapps/ords

APEX Image Folder

The APEX image directory (/i/) is deploy under:

/home/tomcat/apache-tomcat-v/webapps/i

This is the location you would use for deploying static and custom content.

JRI File Locations

For JasperReportsIntegration layout and customization options, please see the Jasper section below.

Starting and Stopping

There are two ways to start/stop/restart Tomcat.

  1. Via Module, using the Stop/Start/Restart buttons as shown below:
../../_images/tomcat-tab.gif
  1. Via SSH, using the following commands
1
 /etc/init.d/tomcat { start | stop | restart | status }

Init Script

The Tomcat init script is located in /etc/init.d and has the following content.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
     #!/bin/bash
     ### BEGIN INIT INFO
     # Provides:        tomcat
     # Required-Start:  $network
     # Required-Stop:   $network
     # Default-Start:   2 3 4 5
     # Default-Stop:    0 1 6
     # Short-Description: Start/Stop Tomcat server
     ### END INIT INFO

     # Source function library.
     . /etc/environment;     #Catalina variables
     . $CATALINA_HOME/bin/setenv.sh

     RETVAL=$?

     function start(){
     echo "Starting Tomcat"
     /bin/su - tomcat $CATALINA_HOME/bin/startup.sh
     RETVAL=$?
     }

     function stop(){
     echo "Stopping Tomcat"
     /bin/su - tomcat -c "$CATALINA_HOME/bin/shutdown.sh 60 -force"
     RETVAL=$?
     }

     case "$1" in
     start)
             start;
     ;;
     stop)
             stop;
     ;;
     restart)
             echo "Restarting Tomcat"
     stop;
             start;
     ;;
     status)

             if [ -f "${CATALINA_PID}" ]; then
                     TOMCAT_PID=$(cat "${CATALINA_PID}")
                     echo "Tomcat is running with PID ${TOMCAT_PID}";
                     RETVAL=1
             else
                     echo "Tomcat is not running";
                     RETVAL=0
             fi
             ;;
     *)
     echo $"Usage: $0 {start|stop|restart|status}"
     exit 1
     ;;
     esac
     exit $RETVAL

Version

Currently, it is deployed with the latest stable version of Tomcat 9.x