Installing Apache Tomcat and Cocoon 2 under FreeBSD

Paul Hoadley

Logic Squad

2004-01-21

Abstract

This document describes how to install The Jakarta Project's Apache Tomcat and The Apache XML Project's Cocoon 2 under FreeBSD. These instructions were tested using Tomcat 4.1.12, Cocoon 2.0.3 and FreeBSD 4.7-PRERELEASE, though there should be minimal differences with other versions of the software. Instructions for installing the original Cocoon 1 application under the Apache JServ servlet container can be found elsewhere.


Table of Contents

1. Installing Apache Tomcat
2. Installing Cocoon 2
3. Testing the installations

1. Installing Apache Tomcat

Installing Apache Tomcat requires nothing more than building the port. As the root user, execute the following:

# cd /usr/ports/www/jakarta-tomcat41/
# make
# make install

Complete the next section before starting up Tomcat.

2. Installing Cocoon 2

There is currently no port for Cocoon 2, so installation must be performed manually. Fortunately, using the binary package provided by The Apache XML Project makes this fairly simple. As the root user, execute the following:

# cd /usr/local
# mkdir cocoon
# cd cocoon
# fetch http://xml.apache.org/cocoon/dist/cocoon-2.0.3-bin.tar.gz
# gunzip cocoon-2.0.3-bin.tar.gz
# cd cocoon-2.0.3
# cp cocoon.war /usr/local/jakarta-tomcat4.1/webapps

If Tomcat had not been previously installed, and it was installed as described above, you may need to log out and log back in again as root in order for tomcat41ctl to be found in your search path. Then execute:

# tomcat41ctl start

3. Testing the installations

At this point, test both installations:

# lynx http://localhost:8080/

The front page of the new Tomcat installation should be displayed. The following should display the front page of the new Cocoon 2 installation:

# lynx http://localhost:8080/cocoon/