This installation guide is not a replacement for reading the Tomcat user guide, but hopefully will help someone avoid some of the problems I had to circumvent.
su -Finding a Package
The first thing I did was look for a Tomcat 3.2.1 RPM, but could only find one for Tomcat 3.1. I decided to have a look at it. To keep things clean I created a tomcat-install directory in /tmp:
cd /tmpI don't like getting files from contrib.redhat.com (too busy and/or slow). I usually use ftp-linux.cc.gatech.edu:
ncftpget ftp://ftp-linux.cc.gatech.edu/pub/linux/distributions/redhat/contrib/libc6/i386/tomcat-3.1-4.i386.rpm(ncftpget is a component of ncftp, my favorite ftp client. You may use any other the ftp client of your choice.)
I wasn't sure I wanted to install the RPM, but I figured I might learn something by looking at its content:
rpm -qpl tomcat-3.1-4.i386.rpm | moreI did learn a few things:
I decided to install the RPM as it would give me a good base to start from:
- A /etc/rc.d/init.d/tomcat file is enclosed
- Everything is installed in /opt/tomcat
- The documentation goes into /usr/doc/tomcat-3.1
rpm -ivh tomcat-3.1-4.i386.rpmNow, I just had to upgrade Tomcat 3.1 to version 3.2.1.
Upgrading to Tomcat 3.2.1
First, I used lynx to get the Tomcat 3.2.1 tarball:
lynx http://jakarta.apache.org/builds/tomcat/release/v3.2.1/bin/jakarta-tomcat-3.2.1.tar.gz(You will be prompted to download and then save the file to disk.)
tar -zxvf jakarta-tomcat-3.2.1.tar.gzRemove the old Tomcat 3.1 /opt/tomcat directory:
rm -fr /opt/tomcatMoved the new /opt/tomcat directory in its place:
mv jakarta-tomcat-3.2.1 tomcatCreated a symbolic link for the Tomcat 3.2.1 documentation in /usr/doc:
mv tomcat /opt
ln -s /opt/tomcat/doc /usr/doc/tomcat-3.2.1Tomcat 3.2.1 is now installed!
After reading some more of the documentation I realized I also had to install mod_jk, a plugin which handles communication between Tomcat and Apache.
I could not find a mod_jk binary for Red Hat Linux and had to build it manually.
I used lynx, again, to get the Tomcat 3.2.1 source tarball:
lynx http://jakarta.apache.org/builds/tomcat/release/v3.2.1/src/jakarta-tomcat-3.2.1-src.tar.gzUncompressed it:
tar -zxvf jakarta-tomcat-3.2.1-src.tar.gzThe make file is located in the /src/native/apache1.3/ directory:
cd jakarta-tomcat-3.2.1-src/src/native/apache1.3/Build the plugin with make:
make -f Makefile.linux allCreated the libexec directory in /etc/httpd:
mkdir /etc/httpd/libexecMoved the plugin to the libexec directory:
mv mod_jk.so /etc/httpd/libexecThe mod_jk plugin is installed!
Mommy told me to always clean up after myself:
rm -rf tomcat-install
In order for the mod_jk plugin to work properly its configuration file must be included within Apache's. This is accomplished by appending:
/etc/httpd/conf/httpd.confAdditionally, the tomcat service configuration file must be updated with the current Java VM and Tomcat home locations:
/etc/rc.d/init.d/tomcat(JAVA_HOME should point to the location of your Java VM.)
For all of the configuration changes to take place, you must restart Tomcat and Apache:
Although not really needed, I've also added the following:
# tomcatto my .login file:
setenv JAVA_HOME "/usr/java/jdk1.3.0_01";
setenv TOMCAT_HOME "/opt/tomcat";
~/.loginI use tcsh for my shell, if you use another type of shell you might have to use:
# tomcatIn case of problems, do like I did, RTFM.
export JAVA_HOME TOMCAT_HOME