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/.contrastdata/.initializeddata/cache/data/contrast.licwebapp/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-datadirectory.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-datadirectory with a command similar to the following:$ mkdir /opt/contrast-data
This example creates the directory in the
/optdirectory, 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.propertiesanddatabase.propertiesamong several others.To ensure there are no access issues, change the owner and group for the
contrast-datadirectory with a command similar to the following:$ chown -R tomcat7:tomcat7 /opt/contrast-data
To complete the configuration, in the
JAVA_OPTSenvironment variable, set the location ofcontrast.homeandcontrast.data.dirto the location where you unarchived the compressed file.This example shows one way to set the
JAVA_OPTSvariable. 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.warfile in the Tomcatwebappsdirectory.Create a symbolic link, copy, or move the
Contrast.warfile from the location where you unarchived the compressed file to the Tomcatwebappsdirectory.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