JSP Tutorials - Herong's Tutorial Examples - Version 5.00, by Dr. Herong Yang
Outdated: Installing Tomcat 5.5.7
This section provides a tutorial example on how to download and install Apache Tomcat 5.5.4 on a Windows computer. Testing of HTML document and JPS page on the Tomcat server is also provided.
Tomcat 5.5.7 is a Web server and supports Servlet 2.4 and JSP 2.0. It requires JDK 1.5 or later. I did the following to get Tomcat 5.5.7 installed on my Windows computer:
1. Checked JDK requirement. I had JDK 1.5.0 installed on \local\j2sdk1.5.0.
2. Downloaded jakarta-tomcat-5.5.7.zip from http://jakarta.apache.org/tomcat.
3. Unzipped jakarta-tomcat-5.5.7.zip in \local.
4. Started Tomcat server:
cd \local\jakarta-tomcat-5.5.7\bin set JAVA_HOME=\local\j2sdk1.5.0 startup
5. Tomcat created a separate command window, on which I got:
11:09:23 PM org.apache.coyote.http11.Http11Protocol init INFO: Initializing Coyote HTTP/1.1 on http-8080 11:09:23 PM org.apache.catalina.startup.Catalina load INFO: Initialization processed in 631 ms 11:09:23 PM org.apache.catalina.core.StandardService start INFO: Starting service Catalina 11:09:23 PM org.apache.catalina.core.StandardEngine start INFO: Starting Servlet Engine: Apache Tomcat/5.5.7 ......
6. Ran Internet Explorer (IE) with url: http://localhost:8080. I got the Tomcat home page with the following message:
Apache Tomcat/5.5.7 If you're seeing this page via a web browser, it means you've setup Tomcat successfully. Congratulations!
7. To find out where the document root directory of this Web server is located, let's create a text file called: hello.html:
8. Then save hello.html to \local\jakarta-tomcat-5.5.7\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! -- From JSP"); %> </body></html>
10. Then save hello.jsp to \local\jakarta-tomcat-5.5.7\webapps\ROOT. Now, ran IE with url: http://localhost:8080/hello.jsp. You should see "Hello world! -- From JSP" in the IE window.
Congratulations! I have successfully served a JSP page through Tomcat.
Last update: 2006.
Table of Contents