tomcat6 with APR on RHEL5.5

The other day at $CLIENT I had to install a webapp that needed tomcat6 and I found it was quite a hassle to install a packaged version on a 32bits RedHat RHEL 5.5. During that painful process, lefred helped finding the magic package that solved it all so I felt it was only fair for me to publish the complete solution as a guest post on his blog!

The other day at $CLIENT I had to install a webapp that needed tomcat6 and I found it was quite a hassle to install a packaged version on a 32bits RedHat RHEL 5.5.

During that painful process, lefred helped finding the magic package that solved it all so I felt it was only fair for me to publish the complete solution as a guest post on his blog!

The tomcat6 package is present on the jpackage repository so the easiest way to grab it and its dependencies is to add the jpackage sources to your yum configuration as follow:


wget http://www.jpackage.org/jpackage50.repo -O /etc/yum.repos.d/jpackage50.repo

Unfortunately, there is an issue between the RHEL and the jpackage repository and a conflict because of usr/bin/rebuild-security-providers. The solution (found by lefred) is to add a fixed package that solves this and allow the two repositories to cohabit nicely:


wget http://plone.lucidsolutions.co.nz/linux/centos/images/jpackage-utils-compat-el5-0.0.1-1.noarch.rpm
rpm -ivh jpackage-utils-compat-el5-0.0.1-1.noarch.rpm

You can then update yum and install tomcat6 and the various dependencies using:


yum update
yum install java-1.6.0-openjdk tomcat6 tomcat6-webapps tomcat6-admin-webapps

And voilà, you have a cleanly packaged tomcat6 installed on you machine.

If you want it to run automatically when the machine boots, remember to do a

chkconfig --level 234 tomcat6 on

As an optional step, it is possible to add native tomcat libraries, said to give a boost in terms of performance (disclaimer: I haven’t had the opportunity to benchmark the behaviour of the application with or without APR, don’t take it for granted, check by yourself :)).

For this, you will need to add the EPEL repository. For a 32bits RHEL5.5, you can do so with the following steps:


wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm -ivh epel-release-5-4.noarch.rpm

You can then update yum and install tomcat-native and its dependencies (the apr* packages will be pulled from the RHEL repository):


yum update
yum install tomcat-native

You should then restart tomcat6 and check in the first lines of your catalina.out log file that all is fine and that tomcat is no longer complaining that it can’t find APR.

Enjoy!
Gildas

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

3 Comments

  1. I tried several other methods I found by Googling, but none were successful. Yours was a breeze. I substituted x86_64 where necessary and the install went very smoothly for Tomcat 6.0.29. Thanks!

Leave a Reply to BillCancel Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

As MySQL Community Manager, I am an employee of Oracle and the views expressed on this blog are my own and do not necessarily reflect the views of Oracle.

You can find articles I wrote on Oracle’s blog.