The easiest way (on SuSE) is just to install the tomcat5 RPM, which can be done easily with YaST. On other distributions / operating systems, please use the package management tools or download the official distribution available from http://jakarta.apache.org/tomcat which should work just as well. We are developing on Tomcat 5.0.30, for older versions, please read the issues paragraph.
SLES9 (tomcat 5.0.19):
- Do a: chown -R tomcat.tomcat /srv/www/tomcat/base/webapps/webswamp/ otherwise tomcat will not be able to write files
- Remove: /usr/share/tomcat/common/lib/commons-collections.jar as it conflicts with the collections lib installed by SWAMP.
The following instructions are only neccessary if you want to do administrative tasks on the tomcat server itself. If you don't, just skip them.
Go to $TOMCAT_BASE/conf. ($TOMCAT_HOME is /srv/www/tomcat5/base/conf for the SuSE rpm). Edit the file tomcat-users.xml and make the following changes:
<role rolename="tomcat"/> + <role rolename="manager"/> + <role rolename="admin"/> - <user username="tomcat" password="tomcat" roles="tomcat" /> + <user username="tomcat" password="tomcat" + roles="tomcat,admin,manager"/> <user username="role1" password="tomcat" roles="role1"/> |
For the SuSE rpm, issue as root:
# rctomcat start
# rctomcat restart
and
#rctomcat stop
JAVA_OPTS="-server -Djava.net.preferIPv4Stack=true -Xmx128M" |
Check http://localhost:8080/. You should see the Tomcat default page there.
Go to http://localhost:8080/manager/html and log in with the user tomcat/tomcat (or whatever you set up in the step before). You see a list of web applications Tomcat has found in its webapp directory. If you rebuilt and re-installed a webapp, locate it in this list and click on the "reload" link.
To reload a webapp from the command line you can use:
curl -u <user>:<password>@http://<hostname>:8080/manager /html/reload?path=/webswamp |
To avoid automatic re-deployment of the webapp on changes in config files, set autoDeploy="false" in the server.xml's <Host> element.