Navigation Links
  • Ten Minute Guide

  • Setup Apache Tomcat Web Server

    Apache Tomcat

    This document contains instructions to install Tomcat 7 and configure for use with Fortress Realm.

    This section covers installation to Linux distros

    1. If Tomcat is already installed skip this step.

      As root, issue the following commands:
                  

      wget http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.30/bin/apache-tomcat-8.0.30.tar.gz tar xzf apache-tomcat-8.0.30.tar.gz mv apache-tomcat-8.0.30 /usr/local/tomcat8 /usr/local/tomcat8/bin/startup.sh

    2. Verify process is running:
                  

      ps -ef | grep tomcat

    3. Place the fortress-realm proxy jar from Build Apache Fortress Realm into Tomcat server's /lib folder. The proxy jar name is fortress-realm-proxy-[version].jar and located here: directory-fortress-realm/proxy/target
                

      cp [directory-fortress-realm]/proxy/target/fortress-realm-proxy-[VERSION]-proxy.jar /usr/local/tomcat7/lib

      Where [directory-fortress-realm] is location of Fortress Realm source package and [VERSION] matches [directory-fortress-realm] package pom.xml file.

    4. Edit tomcat-users.xml:
                

      vi /usr/local/tomcat8/conf/tomcat-users.xml

    5. Add privilege for tcmanager user to connect with Tomcat Manager. This account can access GUI and deploy via maven.
                  

      <role rolename="manager-script"/> <role rolename="manager-gui"/> <user username="tcmanager" password="m@nager123" roles="manager-script"/> <user username="tcmanagergui" password="m@nager123" roles="manager-gui"/>

      Using the config file realm to store credentials for an important application like the Tomcat Manager is a security antipattern. In production, the fortress realm should be used globally by Tomcat.

    6. Save and exit.

    7. Restart Tomcat:
                  

      /usr/local/tomcat8/bin/shutdown.sh /usr/local/tomcat8/bin/startup.sh

    8. Verify clean logs after startup:
                  

      tail -f -n10000 /usr/local/tomcat8/logs/catalina.out

      Ensure there are no errors within Tomcat's log. One common problem: UnsupportedClassVersionError. This is a sure sign that your Tomcat is running under the wrong version of java. Remember Java 7 or greater is required to run this tutorial.

    9. Verify setup by signing onto the Tomcat Manager app with credentials userId: tcmanagergui, password: m@nager123

      http://localhost:8080/manager

    Copyright 2003-2016, The Apache Software Foundation. All Rights Reserved.