Deploy Verigreen over the Tomcat 7 Web Server - Verigreen/verigreen GitHub Wiki

Deploy Verigreen over the Tomcat 7 Web Server

Tomcat is a web server application. It is based on Java and supports Linux, Windows and BSD-based operating systems.
The Verigreen WAR file can be deployed directly over Tomcat. Please follow below guidelines for this type of deployment.
Although this guide targets LINUX-based systems, it can be easily adapted for Windows as well.

Prerequisites

Installation

  1. Install Tomcat.
    For this example, assume that tomcat is install under /opt/tomcat7/apache-tomcat-7.0.64.
    Note:
    • It is highly recommended to set up Tomcat to run as a non-administrator user.
    • Run Tomcat as a system service/daemon.
  2. Prepare a folder to hold the Verigreen files. In this guide, the folder /opt/verigreen will be used to hold the required files.
    mkdir -p /opt/verigreen/config
  3. Set up git and SSH/HTTP(S) credentials for the user running the Tomcat7 webserver.
    SSH authentication is recommended.
  4. Clone the required git repository Verigreen will protect branches in.
    cd /opt/verigreen/
    git clone ssh://git@MyGitHost:port/MyRepo.git
  5. Download the Verigreen configuration file, config.properties.
    wget https://raw.githubusercontent.com/Verigreen/verigreen/master/verigreen-collector-webapp/resources/config.properties
  6. Configure the parameters within the config.properties file using this guide.
  7. Modify the setenv.sh (setenv.bat on windows) file, and add the environment variable VG_HOME. This variable value need be the path to the folder holding the Verigreen config.properties file, as set above.
    echo 'export VG_HOME=/opt/verigreen/config' > /opt/tomcat7/apache-tomcat-7.0.64/bin.setenv.sh
    Note: In case the file was newly created, verify it is owned by the correct user and is set with run permissions.
  8. Download and deploy the Verigreen WAR file. Either use Tomcat's manager app, or place the WAR directly under Tomcat's webapps folder.
    This example deploys Verigreen at http://tomcat7Hostname:port/verigreen/. cd /opt/tomcat7/apache-tomcat-7.0.64/webapps
    wget https://github.com/Verigreen/verigreen/releases/download/verigreen-2.5.6/verigreen-collector.war -O verigreen.war
  9. Restart Tomcat.
    service tomcat7 restart
    As the web server starts up, it will automatically attempt to deploy the WAR file placed under its webapps folder. Once the server start up, usually within a few seconds, Verigreen would be up and running at http://tomcat7Hostname:port/verigreen/

Troubleshooting

  • Check the catalina.out log file for any error messages.
    For this example, the full path to the file is: /opt/tomcat7/apache-tomcat-7.0.64/log/catalina.out