Tomcat Configuration

Tomcat Configuration

Web applications in Tomcat

We are trying to get some order into how web applications are installed into the Tomcat instance. The most important thing to remember is NOT INSTALL into the webapps folder of Tomcat.

Tomcat installation

We are running Tomcat 5.5 and the exact dot-release will probably vary faster than this document is updated.

The binary is installed in /java/impl, with symbolic links in /java to point to the current version.
Any reference to the Tomcat instance should be done with /java/tomcat.

The following has been entered into catalina.sh.

CATALINA_OPTS=-XX:CompileCommand=exclude,org/apache/lucene/index/IndexReader$1,doBody
JAVA_OPTS="-XX:PermSize=128m -XX:MaxPermSize=256m -Xmx784M -Dorg.apache.jasper.runtime.BodyContentImpl.LIMIT_BUFFER=true"

One directory in /home per application

We create one directory in /home for each application, such as /home/jira and /home/confluence. The downloaded ZIP/TAR is unzipped in this location, and the original versioning from the vendor is kept as-is. For instance /home/jira/atlassian-jira-enterprise-3.7.3

Web Application Folder

We have a dedicated /home/webapps folder. It contains one subfolder per web application and a version under that. For instance /home/webapps/jira/3.7.3.

If the application is a WAR file, it goes under that version. /home/webapps/jira/3.7.3/jira-3.7.3.war

If it is an exploded application, we put it one directory down, for instance /home/webapps/confluence/2.2.8/confluence/WEB-INF

Under the versioned directory of the web application, there is also the Context descriptor folders. Only Tomcat 5.5 are typically provided. A symbolic link must be placed in the directory /java/tomcat/conf/Catalina/localhost/ pointing to such descriptor.

Special Note: JIRA

JIRA is an application that one should "build". We have modified the build.xml script in the /home/jira/atlassian-jira-enterprise-3.7.3 to use a shorter name for the produced output as well as writing the produced WAR file directly to the /home/webapps/jira/3.7.3/ folder. Also, the content in /home/jira/atlassian-jira-enterprise-3.7.3/etc/tomcat-5.5-jira.xml has been modified to what we use. This is also true for the entityengine.xml in edit-webapp/WEB-INF/classes/. The build script will produce the Context descriptor from that, and we will end up with a situation where the WAR file will also be exploded into the /home/tomcat/webapps/ folder when started.