Monday, May 17, 2010

RedHat Tomcat 6 with Web Manager

The Red Hat Tomcat 6 RPM is not behaving politely. It would seem the manager should be available after install, but I'm getting a blank page. Turns out that I've had life pretty easy thus far (news to me) and someone has already done the hard work. Here's what it took for me to get Tomcat 6 working via RPM.

Starting with my "standard load" which does not include Apache:
# yum install tomcat6 tomcat6-admin-webapps
This will snag a quantity of dependencies, but will install with the web manager broken. Before starting Tomcat we will need to "fix" the web manager. While were at it, lets do some reorganizing:
# ls -l /usr/share/tomcat6/ | awk '{print $8" "$9" "$10}
bin
conf -> /etc/tomcat6
lib -> /usr/share/java/tomcat6
logs -> /var/log/tomcat6
temp -> /var/cache/tomcat6/temp
webapps -> /var/lib/tomcat6/webapps
work -> /var/cache/tomcat6/work
Okay... They tried to organize things, but I've never seen anybody put in /usr/share on a production system. Let's go with /opt:
# mkdir /opt; cd /opt; ln -s /usr/share/tomcat6 tomcat
# ln -s tomcat $(cd /usr/share/doc; ls -d tomcat6-*)
# ls -l | awk '{print $8" "$9" "$10}'
tomcat -> /usr/share/tomcat6
tomcat6-6.0.18 -> tomcat
Time to fix the manager. Web manager will ask for the user the authenticate, even though not user is allowed, by default.
# cd conf; grep manager tomcat-users.xml
One of the lines should show the user "tomcat" with the role of "manager". Notice the line is commented. Obviously we un-comment the line to allow a manager. We should now be ready:
# service tomcat6 restart
Hit the manager at something like:
http://tomcat.example.com:8080/manager/html

2 comments:

  1. I ran into the same issue. Although when I tried to do a yum install tomcat6-admin-webapps it couldn't find the package in the Red Hat yum repo (which I thought was odd). I had to log into the Red Hat Network portal and download the package.

    tomcat6-admin-webapps-6.0.24-24.el6_0.noarch.rpm

    ReplyDelete
  2. You have to subscribe to the "RHEL Server Optional" channel in order to get this package available through yum.

    ReplyDelete