MANUAL INSTRUMENTATION
Supported Linux Version: The following configuration is tested on RHEL 7.5 Operating System. To manually configure the TomcatServer with VSP, follow the steps below:
-
Shut down Tomcat Server (if it is running) using the command:
-
$CATALINA_HOME/bin/shutdown.sh
-
-
Create a file setenv.sh in the directory $CATALINA_HOME/bin. Add content below to the file:
export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -javaagent:/opt/virsec/iae-java/instrumentation.jar -DVSP_HOME=/opt/virsec -Dvirsec_appcontextpath=<AppCollectiveID>"
NOTE:
Ensure that <AppCollectiveID> mentioned above is replaced with the App Collective ID in the CMS Application Configuration section
-
Start the Tomcat Server using any one of the below methods:
-
Method 1: Using Startup Script:
-
$CATALINA_HOME/bin/startup.sh
-
-
Method 2: Using init service:
-
Example: systemctl start <tomcat-service-name>
-
A sample tomcat.service script is provided below. Verify that the variable WorkingDirectory is present. If it is not, add it as depicted below:
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/opt/jdk1.8.0_161
Environment=CATALINA_PID=/opt/apache-tomcat-8.5.30/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/apache-tomcat-8.5.30
Environment=CATALINA_BASE=/opt/apache-tomcat-8.5.30
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom'
WorkingDirectory=/opt/apache-tomcat-8.5.30
ExecStart=/opt/apache-tomcat-8.5.30/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
User=tomcat
Group=tomcat
[Install]
WantedBy=multi-user.target
-
-