Search the OSG website:

Central

Drake Emko

Introduction

We have Tomcat instances installed across multiple nodes, and admistrative commands may be issued from any one of them.

All the instances are configured through a single file, located at:

	/nerdc/servlets/osgjas/scripts/admin/conf/tomcat-all.xml
      

From this file, all the administrative scripts and tomcat configuration files are generated. It also provides the data for the file:

	/nerdc/servlets/osgjas/INFO.html
      

which will tell you which node each instance resides on, as well as the different ports they use.

Configuring a Server

This section describes how to configure a Tomcat instance from the global configuration file:

	/nerdc/servlets/osgjas/scripts/admin/conf/tomcat-all.xml
      

This file, from which the Tomcat server.xml, build.xml, tomcat-users.xml, workers.properties, and administrative scripts get generated, contains all the configurable information for OSG's distributed Tomcat framework. It is the only file you need to edit when adding, modifying, or removing applications and servers.

The Document Type Definition (DTD) for tomcat-all.xml resides in the same directory, and is named tomcat-all.dtd. Many of the elements and attributes are self-explanatory, and most within the <server> element mirror the functionality of those found in tomcat's server.xml file.

Here are some pointers for editing tomcat-all.xml when you want to modify or create a server:

  • The <ajp13-connectors> element should contain only information about load-balanced connectors. Each <lb> element describes a load-balancing worker, and its children are the individual <worker>s that it is comprised of.

  • In the <server> element, the <shutdown-port>, <http-port>, and <ajp13-port> elements must each have number values that are unique throughout all servers in tomcat-all.xml. Make sure you don't, for example, assign a <shutdown-port> number in one server that is the same as the <ajp13-port> number in another server. View /nerdc/servlets/osgjas/INFO.html to see which ports are available.

  • In the <server> element, the <admin-password> is used by the admin and manager programs, which the administrative scripts use, via ant. The authorization process is conducted by the scripts, and neither the administrator nor the customer need remember the password. Just make it difficult to guess.

  • In the <server> element, the <datasource> element may contain only the value jdbc/osg_public for now. More options will become available as we acquire more tomcat customers.

  • In the <server>/<host>/<context> element, the <realm> element may contain only the value ldap/gatorlink for now (GatorLink authentication).

When you are finished editing tomcat-all.xml, run:

	/nerdc/servlets/osgjas/scripts/admin/bin/create-all.sh
      

to generate all the configurable Tomcat files on the system. Make sure you are logged in as root.

Creating a new Tomcat instance

  1. Create a directory for the new instance. As root, run:

    /nerdc/servlets/osgjas/scripts/admin/bin/create-instance-dir.sh lt;instance_name> <userid> <groupid>
                

    where <instance_name> is the name you want to give the instance, and <userid> and <groupid> are the UNIX user and group IDs you want the server to run as. This will create the server directory:

    /nerdc/servlets/osgjas/<instance_name>/
    	  

  2. Create one or more virtualhost directorie for use by new instance, for example:

    mkdir /nerdc/servlets/osgjas/<instance_name>/webapps/www.example.com/
    chown <userid>:<groupid> /nerdc/servlets/osgjas/<instance_name>/webapps/www.example.com/
                

  3. Edit the global tomcat configuration file:

    	  
    /nerdc/servlets/osgjas/scripts/admin/conf/tomcat-all.xml
                

    and add an entry for the new clone, copying the basic pattern used by the other clones. You can see which ports are free by viewing the table in:

    /nerdc/servlets/osgjas/INFO.html
                

  4. Generate all the necessary support files by running:

    /nerdc/servlets/osgjas/scripts/admin/bin/create-all.sh
                

  5. You should be able to start the new tomcat instance now:

    /nerdc/servlets/osgjas/scripts/server/<instance_name>-startup.sh
                

    The logs will appear in:

    /nerdc/servlets/osgjas/<instance_name>/logs/
                

  6. At this point, the mod_jk config file:

    	  
    /nerdc/servlets/osgjas/conf/workers.properties
                

    should be configured correctly, but the instance won't begin taking requests until all the apache servers in the web cluster are restarted.

    Restart apache on the following nodes:

    osgtest01
    edge01
    edge02
    edge03
    edge04