• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
This article, in which we examine issues specific to Tomcat, is the second in our series on the Jakarta-Tomcat server. In this article we will discuss
the requirements for installing and configuring Tomcat,
the process of installing and configuring Tomcat, and
deploying Tomcat web applications.
Requirements for Installing and Configuring Tomcat
Before performing the tasks outlined by this article you will need to download the items listed in theTable 1.
Table 1. RequirementsNameLocation
Tomcat 4.0 beta 1http://jakarta.apache.org/JDK 1.3 Standard EditionFor this article we will be using the latest versions of the tools listed above.
Installing and Configuring Tomcat
In this article we will be installing Tomcat as a stand-alone server. This means that Tomcat will serviceall requests, including static content, JSPs, and servlets.To configure Tomcat as a stand-alone server you will need to download the
Tomcat 4.0 beta 1
and the
JDK 1.3 Standard Edition
from the locations listed above. You should choose the appropriatedownloads based on your OS. We will be covering the steps involved in installing to both NT/2000 andLinux.
Installing to Windows NT/2000
The first installation we will be performing is to Windows NT/2000. The first thing you need to do isinstall the JDK, following its installation instructions. For this article I am installing the JDK to driveD:, therefore my
JAVA_HOME
directory is
D:\jdk1.3
. Now you need to extract the Tomcat server. Again, I am installing to drive D:, which will make my
TOMCAT_HOME
directory
D:\jakarta-tomcat-4.0-b1
.After you have extracted Tomcat, the next step is putting your JDK into Tomcat's
CLASSPATH
andsetting the
TOMCAT_HOME
environment variable. To do this under NT/2000, you must1.Open the NT/2000 Control Panel.2.Start the NT/2000 System Application and select the Advanced tab.3.Select the Environment Variables button.4.Select the New button on the System Variables section of the Environment Variables dialog.Add a JAVA_HOME variable and set its value to the location of your JDK installation. Figure 4shows the settings associated with my installation.
 
Figure 4. JAVA_HOME Environment Settings5.Repeat Step 4 using
TOMCAT_HOME
for the variable name and the location of your Tomcatinstallation as the value. For my installation I am setting the value to
D:\jakarta-tomcat-4.0-b1
.That's all there is to it. You should skip the following section "Installing to Linux" and move on to"Testing You Tomcat Installation."
Testing Your Tomcat Installation
To test the Tomcat installation, first start the Tomcat server. Table 4 contains the startup and shutdowncommands for each OS.
Table 4. Tomcat Startup/Shutdown CommandsOSStartupShutdown
Windows NT/2000
TOMCAT_HOME\bin\startup.batTOMCAT_HOME\bin\shutdown.bat
Linux
TOMCAT_HOME/bin/startup.shTOMCAT_HOME/bin/shutdown.sh
Once Tomcat has started, point your browser at http://localhost:8080/
 
If you would like to have all requests serviced on the default HTTPport of
80
, instead of port
8080
, you will need to make the followingchange to the TOMCAT_HOME/conf/server.xml file and restart Tomcat.
Change
<!-- Define a non-SSL HTTP/1.1 Connector on port 8080 --><ConnectorclassName="org.apache.catalina.connector.http.HttpConnector"
 port="8080"
minProcessors="5" maxProcessors="75"acceptCount="10" debug="0"/>
to
<!-- Define a non-SSL HTTP/1.1 Connector on port 80 --><ConnectorclassName="org.apache.catalina.connector.http.HttpConnector"
 port="80"
minProcessors="5" maxProcessors="75"acceptCount="10" debug="0"/>
 Now point your browser at
http://localhost/
and you'll see results similar to those in Figure 5.The next step is to verify the installation of your JDK, which is done by executing one of the JSPexamples provided with the Tomcat server. At the page shown in Figure 5, choose
JSP Examples
. Youshould see a page similar to Figure 6.
Figure 6. The JSP Examples Page
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...