Admin Life Errors, Fixes, and Encounters

5Feb/1010

Installing Apache Tomcat 6 on FreeBSD

So you want to install Tomcat 6 on FreeBSD, this is how I did it.

cd /usr/ports/www/tomcat6
make install clean

use the default Options for diablo-jdk

Then you get some nice "licensing restrictions"

Because of licensing restrictions, you must fetch the distribution
manually.

Please access

http://www.FreeBSDFoundation.org/cgi-bin/download?download=diablo-caffe-freebsd6-i386-1.6.0_07-b02.tar.bz2

with a web browser and "Accept" the End User License Agreement for
"Caffe Diablo 1.6.0".

Please open http://java.sun.com/javase/downloads/index.jsp
in a web browser and follow the "Download" link for
"JDK US DST Timezone Update Tool - 1_3_21" to obtain the
time zone update file, tzupdater-1_3_21-2009p.zip.

Please place the downloaded file(s) in /usr/ports/distfiles.

*** Error code 1

Stop in /usr/ports/java/diablo-jdk16.
*** Error code 1

Stop in /usr/ports/java/diablo-jdk16.
*** Error code 1

Stop in /usr/ports/www/tomcat6.

So we go to the freebsd foundation website and download diablo caffe.
Then we go to the sun websute to download the Timezone update and what do you know, Sun has version 1.3.25 and not 1.3.21.

So we do an "cvsup -g -L 2 /root/cvs-supfile" on our system to update the ports collection.
... wait 10..20 minutes as the system wasn't up to date ...

While that's going, we copy (sftp) the file over to the server "diablo-caffe-freebsd6-i386-1.6.0_07-b02.tar.bz2"

cp /home/user_name/diablo-caffe-freebsd6-i386-1.6.0_07-b02.tar.bz2 /usr/ports/distfiles

The ports collection was updated but it didn't do anything, still need 1.3.21... Maybe because it's an old version of FreeBSD (6.2) o_0
Luckily for me, I had tzupdater-1_3_21-2009p.zip from a pervious install on another server (email me if you need the file)
I rsync the file accross

rsync -ave ssh /usr/ports/distfiles/tzupdater-1_3_21-2009p.zip user_name@192.168.1.101:/home/user_name/tzupdater-1_3_21-2009p.zip

cp /home/user_name/tzupdater-1_3_21-2009p.zip /usr/ports/distfiles
cd /usr/ports/www/tomcat6
make install clean

The installation continues. Then it finishes without issue.

cd /usr/local/apache-tomcat-6.0
vi RUNNING.txt

To run it, we need to set up the JAVA_HOME environment variable... I'm on the bash shell (GO BASH) and we installed the JDK not JRE so I do

JAVA_HOME=/usr/local/diablo-jdk1.6.0
cd /usr/local/etc/rc.d/
./tomcat6 start

and nothing happened... Probably because it's not in /etc/rc.conf

cd /usr/local/apache-tomcat-6.0/logs/
ls -l

no logs in the log folder...

cd /usr/local/apache-tomcat-6.0/bin/

./startup.sh

Now we have logs

tail catalina.out

The following line shows up...

Feb 5, 2010 10:17:01 AM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8180

so we go to http://192.168.1.101:8180 and just like that it comes up..

If you want to change the port, edit /usr/local/apache-tomcat-6.0/conf/server.xml

Now that was a long install, hope it helps someone.