This page is offered as a service of Bristle Software, Inc. New tips are sent to an associated mailing list when they are posted here. Please send comments, corrections, any tips you'd like to contribute, or requests to be added to the mailing list, to tips@bristle.com.
Last Updated: 7/22/2009
Applies to: Tomcat 5.0.28+
To install Tomcat, download it from:
http://tomcat.apache.org/and follow the installation instructions there. Be sure to change the password of the admin Web apps.
Since Tomcat is written in Java, you may not have to run a setup program. You can simply unzip the zip file into a desired directory and invoke it via the provided shell scripts and/or Windows batch files. However, if you want it to run as a Unix daemon, or as a Windows service, it may be easier to run a setup program.
Here are the steps I have taken on various platforms:
Mac OS X
% ln -s apache/jakarta-tomcat-5.0.28 /usr/local/tomcat
% chown -R fred /usr/local/tomcat/*
% chgrp -R staff /usr/local/tomcat/*
% chmod -R 755 /usr/local/tomcat/*
/usr/local/tomcat/conf/tomcat-users.xmladding the lines:
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="some_good_password" roles="admin,manager"/>
http://localhost:8080
Red Hat Linux
% ln -s apache/jakarta-tomcat-5.0.28 /usr/local/tomcat
% chown -R fred /usr/local/tomcat/*
% chgrp -R staff /usr/local/tomcat/*
% chmod -R 755 /usr/local/tomcat/*
/usr/local/tomcat/conf/tomcat-users.xmladding the lines:
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="some_good_password" roles="admin,manager"/>
http://localhost:8080
Windows
C:\Apps\Apache\jakarta-tomcat-5.0.28\conf\tomcat-users.xmladding the lines:
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="some_good_password" roles="admin,manager"/>
http://localhost:8080
Fedora Linux
% yum install tomcat5
% yum install tomcat5-webapps
% yum install tomcat5-admin-webapps
% ln -s /usr/share/tomcat5 /usr/local/tomcat
/usr/local/tomcat/conf/tomcat-users.xmladding the lines:
<role rolename="manager"/>
<role rolename="admin"/>
<user username="admin" password="some_good_password" roles="admin,manager"/>
http://localhost:8080
% mv /etc/rc.d/rc4.d/K20tomcat5 /etc/rc.d/rc4.d/S89tomcat5
--Fred
Last Updated: 1/7/2006
Applies to: Tomcat 5.0.28+
There are several ways to deploy a Webapp in Tomcat:
--Fred
Last Updated: 1/7/2006
Applies to: Tomcat 5.0.28+
To cause Tomcat to check for and load updated code for a Webapp, edit the <Context> element of the context configuration file, setting the reloadable attribute of the Context element to "true", as:
<Context docBase="/home/fred/bristle/webapps/mywebapp/web"
path="/mywebapp"
reloadable="true"
>
</Context>
--Fred
Last Updated: 1/7/2006
Applies to: Tomcat 5.0.28+
To cause Tomcat to check for and load updated code for all Webapps by default,
add a <DefaultContext> element to the main Tomcat server.xml
file:
.../conf/server.xml
setting the reloadable
attribute of the Default Context element to "true", as:
<DefaultContext reloadable="true"/>
--Fred
Last Updated: 1/7/2006
Applies to: Tomcat 5.0.28+
To cause Tomcat to more frequently (every 10 seconds in this case) check for and load code for a Webapp, add a <Loader> element to the <Context> element of the context configuration file, as:
<Context docBase="/home/fred/bristle/webapps/mywebapp/web"
path="/mywebapp"
reloadable="true">
<Loader
checkInterval="10" />
</Context>
You may not want to do this for a production server, since it wastes unnecessary CPU cycles in an environment where files do not change often, but it's very handy on a development server.
--Fred
©Copyright 2006-2021, Bristle Software, Inc. All rights reserved