Java Reference
In-Depth Information
2.
In the Release Builds section, scroll to the Tomcat 5.5 heading.
The software can be downloaded as a
ZIP
archive, an archive compressed with
TAR
and
GZ
, or a Windows installer.
3.
Click the link of the version you want to download.
4.
Install the software, making note of the folder where it is installed.
5.
Create an environmental variable called
JAVA_HOME
that contains the folder where
Java is installed on your computer.
6.
Create an environmental variable called
CATALINA_HOME
that contains the folder
where Tomcat was installed.
7.
In the
bin
folder of the Tomcat installation, use either
catalina.sh
or
catalina.bat
to run the server with one of these commands:
catalina.sh start
catalina.bat start
Tomcat begins running at port 8080 of your computer. (There's also a
stop
com-
mand to shut it down.)
8.
To verify that it's running, open the address http://localhost:8080 with a web
browser. If you're testing Tomcat from another computer, replace
localhost
with
the domain name or IP address of the server where Tomcat has been installed.
9.
Add to your
Classpath
a reference to the Java servlet class library,
servlet-
api.jar
, that ships with Tomcat. In version 5.5, it's in the
common\lib
subfolder.
If you don't have a server but you want to begin developing servlets, several companies
offer commercial web hosting with Java servlet support. These companies have already
installed Tomcat and configured it to work with their servers, leaving you to focus on
writing servlets using the classes of the
javax.servlet
and
javax.servlet.http
pack-
ages.
For previous editions of the topic, I tested servlets using
Motivational Marketing Associates (MMA) to host servlets and JSP.
MMA offers Java servlet hosting on an Apache web server running
Linux. You can find out more about its commercial hosting ser-
vices by visiting
http://www.mmaweb.com.
NOTE