Tomcat & Cocoon

R. Alexander Milowski

milowski@sims.berkeley.edu

School of Information Management and Systems

#1

Tomcat 5.0.19

#2

Checking JAVA_HOME

#3

Getting Started

  1. Unpack the tomcat distribution:

    unzip jakarta-tomcat-5.0.19.zip
  2. Make sure that 'JAVA_HOME' is set in your environment.

  3. Open up a shell and start tomcat:

    On Unix or Mac OS X:

    cd jakarta-tomcat-5.0.19/bin
    ./startup.sh

    On Windows

    cd jakarta-tomcat-5.0.19/bin
    startup

    Note: On Unix or Mac OS X you may need to make the scripts executable first:

    cd jakarta-tomcat-5.0.19/bin
    chmod u+x *.sh
  4. Check to see if it running at http://localhost:8080

#4

Stopping Tomcat

  1. Open up a shell and start tomcat:

    On Unix or Mac OS X:

    cd jakarta-tomcat-5.0.19/bin
    ./shutdown.sh

    On Windows

    cd jakarta-tomcat-5.0.19/bin
    shutdown

#5

Setting Up an Administrator

  1. Open this file in your favorite XML editor:

    jakarta-tomcat-5.0.19/conf/tomcat-users.xml
  2. Add these two elements after the last 'role' element:

    <role rolename="manager"/>
    <role rolename="admin"/>
  3. Add this element after the last 'user' element:

    <user username="admin" password="admin" roles="admin,manager"/>
  4. If you have tomcat running, you'll have to restart it.

#6

The Web Application Manager

  1. Start tomcat.

    On Unix or Mac OS X:

    cd jakarta-tomcat-5.0.19/bin
    ./startup.sh

    On Windows

    cd jakarta-tomcat-5.0.19/bin
    startup
  2. Go to this URL: http://localhost:8080/manager/html

  3. Use your administrator username and password to login (e.g. 'admin' for both).

#7

What You Are Seeing

#8

Deploying a Small Application

#9

Deploying a Large Application

#10

Accessing Applications the First Time

#11

What's A WAR File?

#12

WAR File Structure

#13

web.xml

#14

JSP & web.xml

#15

Multiple Applications

#16

Using Cocoon