Skip to main content

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

  1. 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
  2. Install Tomcat and Java:

  3. 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.

    1. 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.

    2. Unarchive the compressed file you created in step 1 into the contrast-data directory.

    3. 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 and database.properties among several others.

    4. 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
  4. To complete the configuration, in the JAVA_OPTS environment variable, set the location of contrast.home and contrast.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
  5. Place the Contrast.war file in the Tomcat webapps directory.

    Create a symbolic link, copy, or move the Contrast.war file from the location where you unarchived the compressed file to the Tomcat webapps 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