4. Servlets

Tomcat Install

Author: Scott Franson

Objective: Install and configure Tomcat server container.


Steps to Installing Tomcat

Nota bene: a more recent tutorial covering Tomcat installation and use can be found by clicking here.


Tomcat is part of the Apache Jakarta Project. You can download Tomcat at: http://tomcat.apache.org/download-60.cgi.

For Windows, there are two options for installation: first, a zip file that you unzip to the directory of your choice; and second, a windows installer that includes a application to start and stop Tomcat. (The installer will also install Tomcat as a 'service' so it starts when windows starts.) By default the installer installs Tomcat in c:\Program Files\Apache Software Foundation\Tomcat 5.5.

Which ever path you choose, after you install Tomcat you need to create a server environment variable, CATALINA_HOME, set to the directory in which Tomcat is installed. The startup and shutdown scripts are located in the %CATALINA_HOME%\bin directory. You may want to create shortcuts on the desktop to these scripts.

After you verify the environment contains the CATALINA_HOME variable, start Tomcat with the startup script. You can verify that Tomcat is running by entering the following URL into the address field of your browser:

   http://localhost:8080/

Once Tomcat is up, you can explore the JSP and Servlet Example applications. To manage Tomcat, you can use the built in Web Application Manager, available via the Tomcat Manager link under Administration on the Tomcat home page. If the Manager fails to start you may need to add a “role” and “user” in the %CATALINA_HOME%\conf\tomcat-users.xml file.

   <role rolename="manager"/>
   <user username="admin" password="password" roles="admin,manager"/>

Links


Assignment

The only assignment is to install Tomcat successfully. Feel free to examine the Tomcat installation part of the Eclipse Web Tools Platform (WTP) Tutorial to see Tomcat downloaded and installed.