This page last changed on Oct 13, 2008 by chuckp.

How to Fix Tomcat Servers

Owned by: Tony Johnson

Apache Tomcat is a web container that specifes a runtime environment for web components, including services such as: security, concurrency, life-cycle management, transaction, deployment, etc.   It implements Sun Microsystem's specifications for Java Servlet and  Java Servlet pages, and it also includes its own internal http server. Tomcat runs on a number of the glastlnx machines.

Notes: 

How to Fix: 
1. Tomcat Server 
2. IIS (glast-win01/02)
3. redirector


Key Information:

1. Tomcat Server

To Test
  • Using the ServerMonitoring tool, check the status of all of the tomcat servers.

    Note:  See SAS Resources by Monitoring Tool for a quick overview of which applications run on which server.  Be aware, however, that applications may have been assigned to a different server since this page was last updated. To verify that an application is running on a given server, use the ServerMonitoring tool --> Applications.

  • To Fix:  Note that  tomcat servers are normally started automatically when the machine boots via cron jobs running under the glast account. Each server runs under control of the java service wrapper, which will automatically restart the server if it fails.

    If it is necessary to do a manual restart, log in to the failed machine as user "glast"; then issue the command:  ~glast/tomcat/scripts/tomcat restart

2. IIS (glast-win01/02)

Note: IIS refers to Microsoft's Internet Information Services (IIS) server software.

To Test
  • Enter (in your web browser): http://glast-win01.slac.stanford.edu/
  • To Fix: Call Windows xHELP at (650) 926-4357.  You will get the Help menu.

    Select "page the on-call Technical Coordinator" who will try to assist, or will contact a member of the Windows Infrastructure Group as needed. 

Key Information

Important  Locations

directory use
~glast/tomcat/scripts Scripts for starting/stopping/configuring tomcat
~glast/tomcat/BASE55 Tomcat configurations (per host)
~glast/tomcat/common Tomcat configurations common to all (or most) hosts
~glast/tomcat/apps External application (confluence, jira)
~glast/tomcat/data Data used by applications (e.g. confluence, jira)

Symbolic links cannot be stored in CVS; therefore, a SYMLINKS file is maintained in each directory.  Running the script ~/tomcat/scripts/symlinks will create/delete symlinks based on the contents of the SYMLINKS files. By default the symlinks script works on any directories at or below the current working directory.

 Code file systems

AFS Stuff which the tomcat servers themselves should not modify (the tomcat servers run without an AFS token).
NFS Stuff which can be modified by a running tomcat. Primarily this includes the webapps directory, the home directory (used to store the java preferences settings) and the conf/Catalina/localhost directory.
/scratch Anything which is written by the tomcat server but not important, e.g. logs, work space, temp space.

All permanent code on AFS also exists in CVS module tomcat for configuration control and emergency recovery purposes. If any of this code is modified it should be committed back to CVS with a suitable comment.

Tomcat Connector

An ISAPI connector is used to bridge between the glast-ground IIS server and a Tomcat 5 instance running the system tests backend.

Configuration Files

The current configuration on glast05 is: (note these are currently in c:\tony\jakartato keep them distinct from similar files Matt has installed elsewhere, but should probably be moved to somewhere more appropriate).\bin\isapi_redirect.dll
\isapi_redirect.properties
\conf\uriworkermap.properties
\web007-tomcat5.properties
\logs\iis_redirect.log

The files are:

isapi_redirect.dll

This is the core of the ISAPI connector. I have been using this particular version for many years without problems. Some other versions I have tried have not worked. I believe it originally came from the tomcat 3 distribution (currently at http://archive.apache.org/dist/jakarta/tomcat-3/bin/win32/i386/). It does not appear to have a version #.

isapi_redirect.properties

Used to configure the isapi_redirect.dll. By putting this file in the same directory as the isapi_redirect.dll its configuration is read from here rather than from the windows registry. This makes it possible to use more than one connector with the same server if necessary.

Currently the file contains:

isapi_redirect.propertiesextension_uri=/jakarta/isapi_redirect.dll
log_file=c:\tony\jakarta\logs\iis_redirect.log
log_level=error
worker_file=c:\tony\jakarta\conf\web007-tomcat5.properties
worker_mount_file=c:\tony\jakarta\conf\uriworkermap.properties
This file configures the log file location and logging level, and points to other configuration files (described below).

uriworkermap.properties

This file maps areas of the glast-ground namespace to (potentially different) tomcat servers. Currently only the /SystemTests/* space is mapped:

uriworkermap.propertiesdefault.worker=ajp13

/SystemTests/=$(default.worker)
/SystemTests/*=$(default.worker)
Note the name ajp13 defined here is just a symbolic name looked up in web007-tomcat5.properties.

web007-tomcat5.properties

This file is contains many comments and unused entries, but the relevant lines are:

web007-tomcat5.propertiesworker.ajp13.port=8019
worker.ajp13.host=web007
worker.ajp13.type=ajp13
The second token (ajp13) is the name defined in uriworkermap.properties. These lines configure the server to point to tomcat5 on web007 (its ajp13 connector currently listens on port 8019).

IIS6 Setup

Three things need to be done to get the ISAPI filter installed under IIS6.

  • Configure a virtual directory (called jakarta) which points to the directory containing isapi_redirect.dll. This directory must be given "Scripts and Executables" permissions.
  • Install the ISAPI filter itself. This can be called anything (typically jakarta), and must point to the dll in the directory above.
  • Register the DLL under "Web Service Extensions" with any name (I used Tomcat ISAPI) and set its status to allowed.

Unresolved/Confusing issues

Material on the web recommends switching the service to "IIS 5.0 isolation mode". I did not do this since I wasn't sure what this does, and since it was a global setting that might cause problems for other applications. Things seem to work without this, but there may be some hidden issues we need to worry about later.

When making changes to the dll or the configuration files it is unclear exactly when the changes take effect. To be safe restart the entire web server, although it also appears to (sometimes) work to just start and stop the virtual server in question (which is much faster). Best is just to get them right first time!

Background Info

There is plenty of background info available at:

http://wiki.apache.org/jakarta-tomcat/Tomcat_2fLinks

much of it refers to the (no longer supported) jk2, but most of it is also relevant for jk1.2



htf_tomcatSrvrs.png (image/png)
htf_tomcatSrvrs.png (image/png)
htf_tomcatSrvrs.png (image/png)
htf_tomcatSrvrs.png (image/png)
Document generated by Confluence on Jan 21, 2010 11:37