CSCI A348/548
Lab Notes Ten

Fall 2000


Server-side Java support with Java servlets and Java Server Pages (JSP): Installing Tomcat.
Please note that these notes have been updated Monday night.

Welcome to lab 10. Here are the highlights:

  1. This should help you with the fifth in-lab assignment (LAB5).
  2. You will be installing a precompiled version of Tomcat.
  3. This will give you server-side Java support: servlets and JSP.
  4. The installation is fairly quick, but please proceed with care.
1. Unix at IU.

In case you need to refresh your knowledge of Unix please rely on Rob Henderson's most outstanding Unix at IU pages.

2. Download Tomcat 3.1.

Download

jakarta-tomcat.tar.gz   18-Apr-2000 12:31   1.8M  GZIP compressed file
from
http://jakarta.apache.org/builds/tomcat/release/v3.1/bin/
into your
/u/username/apache
directory (which is where your apache_1.3.14 directory also is).

3. Uncompress and unpack the archive

Run

gunzip *.gz
in the directory, then
tar xvf *.tar
and check that a jakarta-tomcat directory gets created.

Then remove the .tar file.

4. Configure Tomcat

Go to

/u/username/apache/jakarta-tomcat/conf
and make a backup copy of server.xml (mine is called server.sml.backup).

Then make the following changes:

burrowww.cs.indiana.edu% pwd
/nfs/paca/home/user1/dgerman/apache/jakarta-tomcat/conf
burrowww.cs.indiana.edu% diff server.xml server.xml.backup
54c54
<             <Parameter name="port" value="12xxx"/>
---
>             <Parameter name="port" value="8080"/>
59c59
<             <Parameter name="port" value="13xxx"/>
---
>             <Parameter name="port" value="8007"/>
burrowww.cs.indiana.edu% 
Where 12xxx and 13xxx are your own ports.

5. Prepare the environment

Add the following three lines at the end of your ~/.cshrc file:

setenv JAVA_HOME   /l/jdk1.2
setenv TOMCAT_HOME /u/username/apache/jakarta-tomcat
setenv CLASSPATH   $TOMCAT_HOME/lib/servlet.jar
setenv myServlets  $TOMCAT_HOME/webapps/examples/WEB-INF/classes
Save the file, log out and log back in.

6. Start Tomcat

Go to $TOMCAT_HOME then type bin/startup.sh at the prompt, press Enter.

7. Run servlets, demo JSPs

In Netscape go to:

http://burrowww.cs.indiana.edu:12xxx
where 12xxx is your own port.

Try some of the servlets and JSPs listed on the page. (Here's my installation.)

Your installation is complete if all the examples run.

8. Stopping Tomcat

Go to $TOMCAT_HOME then type bin/shutdown.sh at the prompt, press Enter.


Last updated on October 30, 2000, by Adrian German for A348/A548