Copyright © 2001 Paul Hoadley
This document describes how to set up Cocoon
1.8.2 with Apache JServ
1.1.2 and Apache
1.3.20 on a
4.4-R system. Cocoon
1.8.2 remains the latest distribution of the
Cocoon 1 system from the Apache XML Project, despite
being reasonably old now. Apache JServ
1.1.2 is a servlet engine from the Java Apache Project that
and is no longer in active development. Apache
1.3.20 is one of the latest releases of Apache's
HTTP server, though Cocoon is known
to work with other versions of Apache
in the 1.3 branch. This is not a general How-To for
Cocoon, or even XML publishing, but
is specifically designed to merely get Cocoon
1.8.2 running on a
FreeBSD system. By the end of this
document, you will be able to view the output of
http://localhost/Cocoon.xml and possibly nothing more.
Some familiarity with
system is required.
Table of Contents
Cocoon should be installed from the ports system, as trying to piece it together using incompatible releases of the Apache XML Project's tools will almost certainly fail.
It is certainly preferable to be able to test the installation as it proceeds from the machine onto which you are installing. The default configuration of Apache will not allow the server information and status pages to be viewed outside the localhost. JServ's default configuration similarly disallows access to its status page outside of the localhost. (Interestingly, Cocoon does allow its status page to be world-viewable by default.) X-Windows, or even console facilities like a monitor and keyboard, however, are not required. Even lynx will be sufficient to demonstrate that installation is proceeding. The default configurations can be changed later to allow the appropriate outside access.
Installation of Apache from the
ports is relatively unproblematic. The latest version of
Apache will probably work, though this
document was written when the current version was
Apache 1.3.20. As
root, execute the following:
Some customisation of the configuration file
/usr/local/etc/apache/httpd.conf will be
required. Getting Apache running is
beyond the scope of this article, and is well covered elsewhere.
At the end of installation, and after modification of
The parent Apache process will
root, and all its
children will run as the user and group specified in the
Apache by pointing a broswer at the
A default Apache page should be displayed at this point.
Installation of Apache JServ from
the ports is relatively unproblematic. As
root, execute the following:
JServ's dependencies include the
Java 1.1.8 JVM, so the installation may
take some time if Java is not yet installed on your machine. At
the end of
make install, the following
advice is given:
o Touch /var/log/jserv.log with write permission for owner of httpd. o Add "Include etc/apache/jserv/jserv.conf" into httpd.conf to activate mod_jserv.
To do this, execute the following as
chown nobody.nobody /var/log/jserv.log
This assumes that httpd will run as user
nobody which is the
default. If you have chosen to run httpd as
another user or group, adjust the chown command
accordingly. Restart Apache as
Test that JServ is working:
There are a few additional traps in installing
Cocoon, however it is predominantly a
matter of making the port and following the additional
The instructions given by the
at the end of make install should be followed
(additional comments are below each of the
(1) Add following line into jserv.conf. "ApJServAction .xml /servlets/org.apache.cocoon.Cocoon"
This line is commented out in the default
#' comment character simply needs to be
removed from the front of the line.
(2) Add following lines into jserv.properties. "wrapper.classpath=/usr/local/share/java/classes/cocoon.jar" "wrapper.classpath=/usr/local/share/java/classes/xerces_1_2.jar" "wrapper.classpath=/usr/local/share/java/classes/xalan_1_2_D02.jar" "wrapper.classpath=/usr/local/share/java/classes/fop_0_15_0.jar"
mis-spelled in the default installation of
Cocoon.jar, so don't simply uncomment the
line—you must correct the spelling. The entries for
fop_0_15_0.jar are not in the default version
jserv.properties and should be added as
instructed above, though without quotation
marks. Additionally, although this does not appear to be
documented anywhere, Cocoon requires
the following additional
.jar files in its
wrapper.classpath=/usr/local/share/java/classes/w3c.jar wrapper.classpath=\ /usr/local/share/java/classes/turbine-pool.jar
Those lines should also be added to
(3) Add following line into zone.properties. "repositories=/usr/local/share/java/classes/cocoon.jar" "servlet.org.apache.cocoon.Cocoon.initArgs=properties= \ /usr/local/etc/apache/cocoon/cocoon.properties"
cocoon.jar is mis-spelled as
Cocoon.jar in the default installation of
The line should be uncommented, and the spelling corrected.
Additionally, the full path of
cocoon.properties is wrong in that file. By
cocoon.properties is installed into
/usr/local/etc/apache/cocoon/, so when
uncommenting the line in
sure to insert the additional
subdirectory into the path. Note that despite the instruction
above, there are two lines to be added, and
neither should be delimited by quotation marks.
(4) Make directory "/var/tmp/cocoon-repository".
The ownership of this directory should also reflect the user
and group under which httpd will be running,
chown nobody.nobody /var/tmp/cocoon-repository
Finally, restart Apache and test Cocoon: