TuxBot's Tomcat 5 Hack
These changes have been integrated into OpenNMS. See the Tomcat 5 page for more information.
Notes and Warnings
I whipped these up in about 20 (hence the horrible html, code, etc) minutes or so just to get OpenNMS running. Your experience can and will vary. I'll probably create a much cleaner version of this soon, in the mean time here you go!
Files on the old web site:
SUSE 9.2 RPM's opennms-1.1.4-0.20041212.0_suse92.i586.rpm opennms-docs-1.1.4-0.20041212.0_suse92.i586.rpm opennms-webapp-1.1.4-0.20041212.0_suse92.i586.rpm README.suse_92 server.xml
Add tomcat to the root group (Yes, this is evil) and follow the configuration instructions below. (See the README above and the example server.xml)
- Grab a copy of Tomcat 5 (Tested with Jakarta Tomcat 5.0.30-beta and with tomcat 5.5)
- Grab a copy of OpenNMS (Tested with OpenNMS 1.1.4-1)
- Unzip both where you want them
- Copy the catalina.jar from $TOMCAT_HOME/server/lib/ overwriting the catalina.jar in $OPENNMS_HOME/server/lib/
- Download this version of OpenNMSTomcatRealm.java and overwrite the version in $OPENNMS_HOME/source/src/web/src/org/opennms/web/authenticate/
- Download this version of build.xml and overwrite the version in $OPENNMS_HOME/source/
- Download mbean-descriptor.xml and copy it into $OPENNMS_HOME/source/etc/
- Run ant install (see normal OpenNMS building instructions)
- Copy $OPENNMS_HOME/source/dist/lib/opennms_web.jar to $TOMCAT_HOME/server/lib/
- Copy $OPENNMS_HOME/source/dist/lib/castor-0.9.3.9.jar to $TOMCAT_HOME/common/lib/
- Copy $OPENNMS_HOME/source/dist/lib/regexp120.jar to $TOMCAT_HOME/common/lib/
- Copy $OPENNMS_HOME/source/dist/lib/log4j.jar to $TOMCAT_HOME/common/lib/
- Copy $OPENNMS_HOME/source/dist/lib/opennms_common.jar to $TOMCAT_HOME/common/lib/
- Copy $OPENNMS_HOME/source/dist/lib/opennms_core.jar to $TOMCAT_HOME/common/lib/
- Copy $OPENNMS_HOME/source/dist/lib/opennms_services.jar to $TOMCAT_HOME/common/lib/
Open up $TOMCAT_HOME/conf/server.xml and find the line
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" debug="0"/>
Change it to:
<Listener className="org.apache.catalina.mbeans.ServerLifecycleListener" debug="0" descriptors="/mbean-descriptor.xml"/>
And finally in the Host block add the contents of the opennms.xml file found in $OPENNMS_HOME/source/dist/webapps/ EG:
<Context path="/opennms" docBase="/some/path/to/opennms-1.1.4-1/source/dist/webapps/opennms" debug="0" reloadable="true"> <!-- Logger className="org.opennms.web.log.Log4JLogger" homeDir="/some/path/to/opennms-1.1.4-1/source/dist" --> <Realm className="org.opennms.web.authenticate.OpenNMSTomcatRealm" homeDir="/some/path/to/opennms-1.1.4-1/source/dist" /> </Context>
Follow the normal OpenNMS instructions and enjoy.
I did not have to do any of the jar copies as the installers added symlinks takes care of that. Also since it appears that redhat/fedora/jpackage have all come to their senses, well at least partially anyway, recent rpms have user tomcat:tomcat. Hopefully this convention takes everywhere as allowing tomcat to run as tomcat is preferred and this add one less dependency to track.
All of this was on an FC4 machine rpms from jpackage, your mileage may vary. Should be the same for Centos 4.X as that is normally what I test against and results where the same or better than FC4 typically.
List of jsp's to fix includes on.
/opennms/admin/userGroupView/users/modifyUser.jsp /opennms/admin/userGroupView/users/userDetail.jspc /opennms/admin/userGroupView/groups/list.jsp /opennms/admin/userGroupView/groups/modifyGroup
$OPENNMS_HOME/webaps $OPENNMS_HOME/etc/etc/users.xml $OPENNMS_HOME/etc/groups.xml $OPENNMS_HOME/etc/notifications.xml /var/opennms
For some odd reason I did not have to do snmp-config.xml, but I am near brain dead at this time so may just be that. This is a moving target as I just want to start parking notes in the wiki until things are finalized.