Installation Instructions for the Tomcat Status Widget

If you've not done so already then download a copy of the lastest zip file from the downloads page. Please note I've made a couple of assumations while writting these instructions...namely that you are a developer and I don't need to tell you how to copy files or explain where ~/Library/Widgets is.

Install and launch the Widget

Once downloaded install the widget in the usual way i.e. Double click on the downloaded zip file to unpack it and then either copy it to ~/Library/Widgets or launch the resulting .wdgt package.

Dashboard should prompt you to confirm that you want to run it the first time you launch this widget as it requires network access.

All good and well. The Widget should start and inform you that 'Unable to request Applications list from the tomcat monitor'. First thing is to is set the manager URL on the flip side of the Widget. It will default to http://localhost:8080/manager/. Also on the flip side is the username and password fields, if you haven't setup your instance of tomcat to secure the manager application that next section will guide you through this.

Configure tomcat

Warning this procedure will enable access to the tomcat manager application, while access will be restricted to authenicated username, it will effectively lower the security level of your tomcat instance.

By default tomcat out of the box doesn't enable any user access to the manager application, even through it is deployed. In order to setup access you first have to define a security role named manager then create a valid user with that role.

This procedure should be roughly the same on Tomcat 4.1 through to Tomcat 5.5.

  1. First find the tomcat-users.xml, which is ussually in $CATALINA_HOME /conf/tomcat-users.xml
  2. Make a copy of this file.
  3. Edit this file and insert a new <role> for rolename="manager" tag as shown below <?xml version='1.0' encoding='utf-8'?> <tomcat-users> <role rolename="tomcat"/> <role rolename="role1"/> <role rolename="manager"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="role1" password="tomcat" roles="role1"/> <user username="both" password="tomcat" roles="tomcat,role1"/> <user username="admin" password="aReallyCleverPasswordThatNoOneWillGuess" roles="manager"/> </tomcat-users>
  4. Now add a new user similar to the admin user shown below: <?xml version='1.0' encoding='utf-8'?> <tomcat-users> <role rolename="tomcat"/> <role rolename="role1"/> <role rolename="manager"/> <user username="tomcat" password="tomcat" roles="tomcat"/> <user username="role1" password="tomcat" roles="role1"/> <user username="both" password="tomcat" roles="tomcat,role1"/> <user username="admin" password="aReallyCleverPasswordThatNoOneWillGuess" roles="manager"/> </tomcat-users> Note that the username and password is completely up to you, in fact I would recomend that you shouldn't use the values that I've used.
  5. Restart Tomcat and go to http://localhost:8080/manager/list, you should be prompted for a username and password. If the new username and password combo doesn't work it maybe worth while having a look at the documentation on the Jakarta Tomcat website. otherwise drop me a line gareth@logicalpractice.com.