Tomcat 5.5 on FreeBSD 7.3

Posted on Thu 10 June 2010 by Pavlo Khmel

1. Update ports tree

portsnap fetch extract update

2. Install Tomcat 5.5

If TZUPDATE option was chosen, 2 packets should be downloaded and installed: diablo-caffe-freebsd6-i386-1.6.0_07-b02.tar.bz2, and tzupdater-1_3_29-2010f.zip. Download them to: /usr/ports/distfiles then:

make install clean.

Then:

$ cd /usr/ports/www/tomcat55/
$ make install clean

After install add to file /etc/rc.conf:

tomcat55_enable="YES"

3. Run and test

/usr/local/etc/rc.d/tomcat55 start

Check in browser http://192.168.0.1:8180
Test examples http://192.168.0.1:8180/servlets-examples/servlet/RequestParamExample

4. Compile applications

cd /usr/local/tomcat5.5/webapps/servlets-examples/WEB-INF/classes
# remove application tested in previous example:
rm RequestParamExample.class
# add environment variable
setenv CLASSPATH /usr/local/tomcat5.5/common/lib/servlet-api.jar
# compile
javac RequestParamExample.java