Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. The application can be run as a Windows Service using FireDaemon Pro, which lets you start the application automatically at boot prior to login, start multiple instances of the application and more. This HOWTO will show you how to set it up. You can also use Fusion to manage FireDaemon and other Windows services via a web browser.


Apache Tomcat Setup Under FireDaemon Pro

Note: Read this article on running Java applications in FireDaemon to understand how to run your applications successfully.


First, download and install JSE 6.0 or later or JRE from the Java website.


Download and install Tomcat version 7.0 from the Tomcat website. The Windows installer will install the Apache Service Manager in the System Tray plus install a service named Tomcat7. We will deal with these later.


Download and install FireDaemon Pro into the directory of your choice, typically C:\Program Files\FireDaemon.


Next start the FireDaemon Pro GUI and click on the "Show All Services" toolbar button. Scroll down until you find "Apache Tomcat 7.0 Tomcat7". Double click it and in the startup type dropdown box, select "Disabled". Click the "Stop" button and then click OK.




Click the "Show All Services" toolbar button again. Now click on the "Create new service definition button" and fill out the fields exactly as you see below. Modify the Short Name if you intend to run multiple Tomcat instances and adjust your paths where necessary. The entire Parameters line reads:

-Xrs -Dcatalina.home="%CATALINA_HOME%" -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" -Djava.util.logging.manager="%LOGGING_MANAGER%" org.apache.catalina.startup.Bootstrap start


Now click on the Logging tab. If you wish to enable FireDaemon debug logging, check the "Debug Logging" option and choose a path and filename for the debug log file. If you wish to capture Tomcat's Stdout and Stderr output choose a path and filename in both the "Capture Stdout in File" and "Capture in File" fields.



Now click on the Environment tab. This is where you enter environment variables specific to your Tomcat instance. The names and values of the environment variables are below; adjust your paths to suit your installation. Note that environment variable order is important:

JAVA_HOME: C:\Program Files\Java\jre1.5.0_04
CATALINA_HOME:  C:\Program Files\Apache Software Foundation\Tomcat 5.5
CLASSPATH: %CATALINA_HOME%\bin\bootstrap.jar
CATALINA_TMPDIR: %CATALINA_HOME%\temp
JAVA_ENSORSED_DIRS: %CATALINA_HOME%\common\endorsed
LOGGING_MANAGER: org.apache.juli.ClassLoaderLogManager


Now click on the Pre / Post-Service tab. Append a new Post-Service Program. This is where we set up Tomcat to stop gracefully when we shut down the service. The complete value of the Parameters field is:

-Xrs -Dcatalina.home="%CATALINA_HOME%" -Djava.endorsed.dirs="%JAVA_ENDORSED_DIRS%" -Djava.io.tmpdir="%CATALINA_TMPDIR%" -Djava.util.logging.manager="%LOGGING_MANAGER%" org.apache.catalina.startup.Bootstrap stop


Now click OK to complete your setup and start Apache Tomcat!


Point your browser at the Tomcat instance to ensure it is up and running. If you have issues, refer to the FireDaemon debug log file, Windows Event Viewer and the Tomcat log files. Alternately, run the FireDaemon service interactively and turn off logging to Stderr/Stdout so you can see what is happening when the Tomcat instance starts.