Man, this class is pretty!

T540 Spring Semester 2002

Lecture Notes Sixteen: Server-side Java

Create a folder where you will install tomcat. pwd
Go there, and copy it from my public directory. pwd
/nfs/paca/home/user1/dgerman/tomcat cp /u/dgerman/public/jak*.zip . ls -l
total 5160
-rw-r--r--   1 dgerman  faculty   5275338 Mar  7 12:09 
Unzip it, and you're almost done.

unzip *.zip
Check your quota, remove the archive.


  inflating: jakarta-tomcat-4.0.3/RELEASE-NOTES-4.0-B2.txt  
  inflating: jakarta-tomcat-4.0.3/RELEASE-PLAN-4.0.txt  
  inflating: jakarta-tomcat-4.0.3/RELEASE-PLAN-4.0.1.txt  
  inflating: jakarta-tomcat-4.0.3/RUNNING.txt quota -v
Disk quotas for dgerman (uid 10867):
Filesystem     usage  quota  limit    timeleft  files  quota  limit    timeleft
               94490 100000 102400               2766      0      0    ls -ld *
drwxr-xr-x  11 dgerman  faculty      1024 Mar  1 14:49 jakarta-tomcat-4.0.3
-rw-r--r--   1 dgerman  faculty   5275338 Mar  7 12:09 rm *.zip quota -v
Disk quotas for dgerman (uid 10867):
Filesystem     usage  quota  limit    timeleft  files  quota  limit    timeleft
               89330 100000 102400               2765      0      0    
For reference, latest version of Tomcat is always available here.

Let's now configure our server.

(Notice the folder where you need to go to, first.) pwd
/nfs/paca/home/user1/dgerman/tomcat/jakarta-tomcat-4.0.3/conf ls -l
total 67
-rw-r--r--   1 dgerman  faculty      6689 Mar  1 14:48 catalina.policy
-rw-r--r--   1 dgerman  faculty     11819 Mar  1 14:48 server-noexamples.xml.config
-rw-r--r--   1 dgerman  faculty     16079 Mar  1 14:48 server.xml
-rw-r--r--   1 dgerman  faculty       450 Mar  1 14:48 tomcat-users.xml
-rw-r--r--   1 dgerman  faculty     31554 Mar  1 14:48 web.xml cp server.xml server.xml.backup emacs server.xml diff server.xml server.xml.backup
<     <!-- Define a non-SSL HTTP/1.1 Connector on port 36120 -->
>     <!-- Define a non-SSL HTTP/1.1 Connector on port 8080 -->
<                port="36120" minProcessors="5" maxProcessors="75"
>                port="8080" minProcessors="5" maxProcessors="75"
Do the same, by using a port with the number 36xxx + 120 (twenty).

Now we need to set a few environment variables.

setenv JAVA_HOME   /l/jdk

setenv CATALINA_HOME /u/dgerman/tomcat/jakarta-tomcat-4.0.3
Make the change in ~/.cshrc, source it, then test: echo $JAVA_HOME
/l/jdk echo $CATALINA_HOME
Now start your server. $CATALINA_HOME/bin/
/u/dgerman/tomcat/jakarta-tomcat-4.0.3/bin/ Permission denied chmod 700 $CATALINA_HOME/bin/*.sh $CATALINA_HOME/bin/           
Using CATALINA_BASE:   /nfs/paca/home/user1/dgerman/tomcat/jakarta-tomcat-4.0.3
Using CATALINA_HOME:   /nfs/paca/home/user1/dgerman/tomcat/jakarta-tomcat-4.0.3
Using CATALINA_TMPDIR: /nfs/paca/home/user1/dgerman/tomcat/jakarta-tomcat-4.0.3/temp
Using JAVA_HOME:       /l/jdk 
Then try it (at 36xxx + 120).

For me this is right here.

Here, in fact are all our servers:

201,BL,1255,36000,Last Name, First Name    ,dgerman      ,INDIANA.EDU
201,BL,T540,36084,Baumgartner, Jason       ,jlbaumga     ,INDIANA.EDU
201,BL,T540,36085,Cincotta, Nicholas       ,ncincott     ,INDIANA.EDU
201,BL,T540,36086,Ehrlichman, Wesley       ,wehrlich     ,INDIANA.EDU
201,BL,T540,36087,Fleetwood, Joshua        ,jfleetwo     ,INDIANA.EDU
201,BL,T540,36088,Fox, John                ,jffox        ,INDIANA.EDU
201,BL,T540,36089,Friend, Christopher      ,cmfriend     ,INDIANA.EDU
201,BL,T540,36090,Hall, Christopher        ,cmhall       ,INDIANA.EDU
201,BL,T540,36091,Heald, David             ,dheald       ,INDIANA.EDU
201,BL,T540,36092,Keese, Brian             ,bkeese       ,INDIANA.EDU
201,BL,T540,36093,Lewis, Megan             ,meblewis     ,INDIANA.EDU
201,BL,T540,36094,Lu, Nan                  ,nlu          ,INDIANA.EDU
201,BL,T540,36095,Polit, Gregory           ,gpolit       ,INDIANA.EDU
201,BL,T540,36096,Rauscher, Andrew         ,arausche     ,INDIANA.EDU
201,BL,T540,36097,Scott, Thomas            ,thscott      ,INDIANA.EDU
201,BL,T540,36098,CHONG, Ji Young          ,jchong       ,INDIANA.EDU
201,BL,T540,36099,Pernice, Wolfram         ,wpernice     ,INDIANA.EDU
201,BL,T540,36109,Jin, Ying                ,yinjin       ,INDIANA.EDU
201,BL,T540,36111,Gillespie, Thom          ,thom         ,INDIANA.EDU
Make a change to your Tomcat's home page. cd $CATALINA_HOME/webapps/ROOT pwd
/nfs/paca/home/user1/dgerman/tomcat/jakarta-tomcat-4.0.3/webapps/ROOT emacs index.html 
Take a look at the servlet examples.

Here's where they are located on your server. cd $CATALINA_HOME cd webapps/examples/WEB-INF/classes ls
CookieExample.class    colors          RequestParamExample.class  compressionFilters
HelloWorldExample.class   dates       error
JndiServlet.class           SessionExample.class       examples          filters     SnoopServlet.class         listeners          num  TroubleShooter.class       servletToJsp.class
RequestHeaderExample.class   cal                        sessions
RequestInfoExample.class    checkbox                   validators
You may also need to change your CLASSPATH environment variable as follows. echo $CLASSPATH
You may also create a few other shortcuts: For the rest of the lecture we will use a combination of existing notes.

There will be a few other things that we will touch on, as well.

Here's a quick problem.

Last updated: Mar 7, 2002 by Adrian German for A348/A548