Server Reference Guide : G. Installing Tomcat : Install Tomcat for Linux
 
Share this page                  
Install Tomcat for Linux
Follow these procedures to install Tomcat for Linux.
Download Tomcat 8 for Linux
1. You can install Tomcat on Linux using yum:
$ sudo yum install tomcat
2. Then install the admin packages:
$ sudo yum install tomcat-webapps tomcat-admin-webapps
3. Open the configuration file:
/usr/share/tomcat/conf/tomcat.conf
4. Add the following to JAVA_OPTS:
JAVA_OPTS="-Djava.library.path=<$II_SYSTEM>/ingres/lib:<$II_SYSTEM>/ingres/mainwin/mw/lib-amd64_linux:<$II_SYSTEM>/ingres/mainwin/mw/lib-amd64_linux_optimized"
Note:  Expand the fully qualified path of your II_SYSTEM in the above specification.
Configure Tomcat with OpenROAD Libraries
There are two ways to use Tomcat for this purpose. One is to register OpenROAD libraries as the user owning Tomcat and the second is to change the owner of Tomcat to the user that owns Ingres and OpenROAD. Although both processes are explained, the first way is preferred and should be used by default always.
1. Register OpenROAD libraries as the Tomcat user.
Let us assume that Tomcat is installed and owned by the user "tomcat" (the default) unless specified or changed.
a. Log in as the tomcat user and source the OpenROAD environment setup script:
source /home/ingres/.orXXsh
where XX is your OpenROAD instance ID.
b. Register the COM libraries for OpenROAD server and XML:
regsvr32 -nodisplay $MWHOME/lib-${MWCONFIG_NAME}_optimized/libmwxml.so
cd $II_SYSTEM/ingres/lib
regsvr32 -nodisplay liborrso.so
regsvr32 -nodisplay liborrsps.so
regsvr32 -nodisplay liborps.so
2. Change the owner of the Tomcat service.
The Tomcat service should be run as the same user as your OpenROAD user. For this we need to make the following change.
The file /etc/systemd/system/multi-user.target.wants/tomcat.service contains a line that specifies the "user" (default user is tomcat). Change this to the user that owns the OpenROAD instance. For example:
user=ingres
Also change the owner of the following folders to the same user:
$ chown -RH ingres /usr/share/tomcat/webapps/ /usr/share/tomcat/work/ /usr/share/tomcat/temp/ /usr/share/tomcat/logs/
Set up the OpenROAD environment for Tomcat
1. Create a customized orjsonrpc.conf file under /etc/tomcat/conf.d. Move to the specified directory and as the root user, create a file:
$ cd /etc/tomcat/conf.d/
$ vi orjsonrpc.conf
2. Enter the following lines in the file and save the file:
. /home/ingres/.orXXsh
export MWNO_CATCH_SIGNALS=SIGSEGV,SIGILL,SIGABRT
where, XX in ".orXXsh" is your OpenROAD instance ID.
Starting or restarting the Tomcat service sets the OpenROAD environment.
Start the Tomcat service and verify that it is running
1. Start the Tomcat service and enable it:
$ systemctl start tomcat
$ systemctl enable tomcat
2. Check the status of Tomcat.
For example, the following command and output indicate that Tomcat is running for the IngresII instance:
$ systemctl status tomcat
? tomcat.service - Apache Tomcat Web Application Container
Loaded: loaded (/usr/lib/systemd/system/tomcat.service; enabled; vendor preset: disabled)
Active: active (running) since Thu 2017-07-06 05:09:29 CDT; 1 weeks 4 days ago
Main PID: 13838 (java)
CGroup: /system.slice/tomcat.service
+-13838 /usr/lib/jvm/jre/bin/java -Djava.library.path=/opt/Actian/IngresII/ingres/lib:/opt/Actian/IngresSS/ingres/mainwin/mw/lib-amd64_linux:/opt/Actian/I...