JSP Tutorials - Herong's Tutorial Examples - Version 4.03, by Dr. Herong Yang
Outdated: Installing Tomcat 4.1.18
This section provides a tutorial example on how to download and install Apache Tomcat 4.1..18 on a Windows computer. Testing of HTML document and JPS page on the Tomcat server is also provided.
Tomcat is a free, open-source implementation of Java Servlet and JavaServer Pages technologies developed under the Jakarta project at the Apache Software Foundation.
Tomcat 4.1.18 is a web server and supports Servlet 2.3 and JSP 1.2. It requires JDK 1.2 or later. I did the following to get Tomcat 4.1.18 installed on my Windows system:
1. Checked JDK requirement. I had JDK 1.3.1 installed on \local\jdk1.3.1.
2. Downloaded tomcat-4.1.18.zip from http://www.apache.inetcosmos.org/dist/jakarta/tomcat-4/binaries/.
3. Unzipped tomcat-4.1.18.zip in \local.
4. Started Tomcat server:
cd \local\jakarta-tomcat-4.1.18\bin set JAVA_HOME=\local\jdk1.3.1 startup
5. Tomcat created a separate command window, on which I got:
[INFO] Registry - -Loading registry information [INFO] Registry - -Creating new Registry instance [INFO] Registry - -Creating MBeanServer [INFO] Http11Protocol - -Initializing Coyote HTTP/1.1 on port 8080 Starting service Tomcat-Standalone Apache Tomcat/4.1.18 [INFO] Http11Protocol - -Starting Coyote HTTP/1.1 on port 8080 [INFO] ChannelSocket - -JK2: ajp13 listening on 0.0.0.0/0.0.0.0:8009 [INFO] JkMain - -Jk running ID=0 time=30/130 config=C:\local\jakarta- tomcat-4.1.18\bin\..\conf\jk2.properties
6. Ran Internet Explorer (IE) with url: http://localhost:8080. I got the Tomcat home page with the following message on it:
If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!
7. To find out where it document root directory of this Web server, let's create hello.html:
8. Then save hello.html to \local\jakarta-tomcat-4.1.18\webapps\ROOT. Now, run IE with url: http://localhost:8080/hello.html. You should see "Hello world!" in the IE window.
9. To verify if Tomcat supports JSP or not, let's create hello.jsp:
<html><body> <% out.println("Hello world!"); %> </body></html>
10. Then save hello.jsp to \local\jakarta-tomcat-4.1.18\webapps\ROOT. Now, ran IE with url: http://localhost:8080/hello.jsp. You should see "Hello world!" in the IE window.
Congratulations! I have successfully served an JSP page through Tomcat.
Last update: 2006.
Table of Contents