Deploy Contrast with a WAR file
Using this procedure lets you manage the different components of the Contrast installation separately. After using this method to deploy Contrast, you can upgrade your configuration by replacing the existing WAR file with a new one.
Before you begin
Steps
Create a compressed file that contains the following files from the directory where you installed Contrast (for example,
/usr/local/contrast
):data/agents/
data/conf/
data/esapi/
data/.contrast
data/.initialized
data/cache/
data/contrast.lic
webapp/Contrast.war
Example: This example shows how to create a TAR file that contains the Contrast files:
$ cd /usr/local/contrast $ tar -czvf ~/ctdc.tar.gz data/agents data/conf data/contrast.lic data/esapi/ data/cache/ data/.initialized data/.contrast webapp/Contrast.war
Install Tomcat and Java:
Use the same version of Tomcat that is included in the Contrast installer.
Set up the
contrast-data
directory.The volume where you create this directory must be large enough for log files, caches and ActiveMQ persistence. For best performance, use a separate volume to handle growth without impacting your overall system.
Create the
contrast-data
directory with a command similar to the following:$ mkdir /opt/contrast-data
This example creates the directory in the
/opt
directory, but you can create it in any location.Unarchive the compressed file you created in step 1 into the contrast-data directory.
Check the contents of the directory using a command similar to the following:
ls /opt/contrast-data/conf
You should see files named
general.properties
anddatabase.properties
among several others.To ensure there are no access issues, change the owner and group for the
contrast-data
directory with a command similar to the following:$ chown -R tomcat7:tomcat7 /opt/contrast-data
To complete the configuration, in the
JAVA_OPTS
environment variable, set the location ofcontrast.home
andcontrast.data.dir
to the location where you unarchived the compressed file.This example shows one way to set the
JAVA_OPTS
variable. Use the documentation for your environment to determine the best way to set this variable.-XX:+UseTLAB -XX:+UseCompressedOops -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:CMSFullGCsBeforeCompaction=1 -XX:+CMSParallelRemarkEnabled -XX:+PrintVMOptions -XX:+PrintCommandLineFlags -Xmx4g -Xms4g -server -XX:MaxPermSize=768m -Dcontrast.data.dir=/opt/contrast-data -Dcontrast.home=/opt/contrast-data -XX:+HeapDumpOnOutOfMemoryError -Xloggc:/opt/contrast-data/gc.out
Place the
Contrast.war
file in the Tomcatwebapps
directory.Create a symbolic link, copy, or move the
Contrast.war
file from the location where you unarchived the compressed file to the Tomcatwebapps
directory.This example shows how to create a symbolic link to the file in a Ubuntu environment:
$ sudo ln -s /opt/contrast-data/webapp/Contrast.war /var/lib/tomcat7/webapps/Contrast.war
This example shows how to copy the file in a Ubuntu environment:
$ cp /opt/contrast-data/webapp/Contrast.war /var/lib/tomcat7/webapps/Contrast.war