Basic Concepts
This section establishes minimal context for understanding Tomcat features that the Fortune Server uses.
What is Tomcat?
Tomcat is a servlet container. It can run connected to a web server, such as the Apache HTTP server, or it can run in a standalone mode using the web server included with it. These instructions for the Fortune Server use Tomcat in its standalone mode, but feel free to use Tomcat anyway you know how.
For information about Tomcat, see the resources listed below:
- The Tomcat site at http://jakarta.apache.org/tomcat.
- Books, articles and other resources compiled at http://jakarta.apache.org/tomcat/resources.html.
Which version?
The Fortune Server was developed using Tomcat 5.0.28, which as of this writing is the current stable release (5.0.29 is beta and 5.5 is alpha). Tomcat 5.0 implements the Servlet 2.4 and JavaServer Pages 2.0 specifications.
See http://jakarta.apache.org/tomcat/tomcat-5.0-doc for the Tomcat 5.0 documentation. Also, the http://jakarta.apache.org/tomcat/tomcat-5.0-doc/appdev application manual is quite nicely done.
Earlier Tomcat releases may work just fine, but they haven't been tested.
Set Environment Variables
JAVA_HOME specifies the root location of your JDK and CATALINA_HOME specifies the root location of your Tomcat installation. The examples below show how to set these environment variables on Windows and UNIX.
Windows: Set Environment Variables
set JAVA_HOME=C:\jdk1.4 set CATALINA_HOME=C:\tomcat\jakarta-tomcat-5.0.28
UNIX Korn Shell: Set Environment Variables
JAVA_HOME=/opt/sun-jdk-1.4.2.04 export JAVA_HOME CATALINA_HOME=/opt/jakarta-tomcat-5.0.28 export CATALINA_HOME
Start/Stop Tomcat
On Windows, start Tomcat with %CATALINA_HOME%\bin\startup.bat, and shut Tomcat down with %CATALINA_HOME%\bin\shutdown.bat.
The corresponding commands for UNIX are $CATALINA_HOME/bin/startup.sh and $CATALINA_HOME/bin/shutdown.sh.