With this tutorial, I will try to give you the steps to build Jakarta Tomcat, as an RPM package. This will allow for easy deployment, with the use of mod_jk2 and Fedoras httpd (Apache2).
Also see this article about How to build Custom yum Repository which will make it even easier.
"Tomcat is the servlet container that is used in the official Reference Implementation for the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed by Sun under the Java Community Process."
UPDATED 2004-03-13 I got an email from Jeff Carlson, which suggested some changes. Some of them would where quite good. a) how to check if the tomcat user/group exist - use getent instead of grep b) move the webapps directory to /var/www/webapps (probably not where he wanted it). I have modified the .spec file to reflect these changes. One thing - I have not tested what happens with an -Uvh. I would suggest to copy out the changes you have made before doing an update.
UPDATED 2004-02-11 There was an error in tomcat4 which was pointed out by Marc Gimpel: "I noticed a small error in the init.d/tomcat4 script, on line 135 it reads: "kill -9 $kipd" instead of kill -9 $kpid". This have been updated in the tomcat4 which is available from this site.
[casper@localhost SPECS]$ rpmbuild -ba tomcat4.spec Executing(%prep): /bin/sh -e /home/casper/rpmbuild/TMP/rpm-tmp.88678 + umask 022 + cd /home/casper/rpmbuild//BUILD + LANG=C + export LANG + unset DISPLAY + rm -rf /home/casper/rpmbuild//BUILD/jakarta-tomcat-4.1.29 + cd /home/casper/rpmbuild/BUILD + rm -rf jakarta-tomcat-4.1.29 + /usr/bin/gzip -dc /home/casper/rpmbuild/SOURCES/jakarta-tomcat-4.1.29.tar.gz ................. Wrote: /home/casper/rpmbuild/SRPMS/jakarta-tomcat-4.1.29-2.fc1.src.rpm Wrote: /home/casper/rpmbuild/RPMS/i386/jakarta-tomcat-4.1.29-2.fc1.i386.rpm Wrote: /home/casper/rpmbuild/RPMS/i386/jakarta-tomcat-debuginfo-4.1.29-2.fc1.i386.rpm Executing(%clean): /bin/sh -e /home/casper/rpmbuild/TMP/rpm-tmp.40591 + umask 022 + cd /home/casper/rpmbuild//BUILD + cd jakarta-tomcat-4.1.29 + rm -rf /home/casper/rpmbuild/TMP/jakarta-tomcat-4.1.29-2.fc1-root-casper+ exit 0 [casper@localhost SPECS]$
[casper@localhost SPECS]$ su -c "rpm -ivh jakarta-tomcat-4.1.29-2.fc1.i386.rpm" Password:If you get an error like this:Preparing... ########################################### [100%] Creating "tomcat4" group Creating "tomcat4" user 1:jakarta-tomcat ########################################### [100%]
error: Failed dependencies: httpd >= 2.0.47 is needed by jakarta-tomcat-4.1.29-2.fc1 mod_jk2 >= 2.0.2 is needed by jakarta-tomcat-4.1.29-2.fc1Then you're missing a webserver (Apache2), and mod_jk2, if you're just installing it for testing use:
[casper@localhost SPECS]$ su -c "rpm -ivh --nodeps jakarta-tomcat-4.1.29-2.fc1.i386.rpm"To disable dependency checking. Otherwise install Apache2:
[casper@localhost SPECS]$ su -c "yum install httpd" Password: ... [casper@localhost SPECS]$And mod_jk2.
[casper@localhost SPECS]$ su -c "/sbin/service tomcat4 start" Password: Starting tomcat4: [ OK ] [casper@localhost SPECS]$
Click on picture for full size