Tomcat Admin Tool

 


Overview

The admintool webapp can to set up users and contexts while Tomcat is runnng. Log in with a user name/password that has been assigned the role of admin. User names and passwords are defined in:

$TOMCAT_HOME/conf/tomcat-users.xml

Syntax looks like:

  <user name="name" 
   password="password" 
   roles="admin, manager, provider" />

Changes are written to:

$TOMCAT_HOME/conf/server.xml

The previous version of server.xml is backed up in the same directory with an date suffix. For example, server.xml.2002-06-15.12-11-54. To restore a previous configuration, shut down Tomcat, mv the old file to server.xml, and restart Tomcat. This document contains information about using admintool to configure the behavior of Tomcat. For more information on these configuration elements, read the Tomcat Configuration Reference, which can be found at $TOMCAT_HOME/docs/tomcat/config/index.html.

This document does not attempt to describe which configurations should be used to perform specific tasks. For information of this type, refer to one of the following documents:

Configuring Tomcat

As you can see in Figure A-1, admintool presents a hierarchy of elements that can be configured to customize the Tomcat JSP/Servlet container to your needs. The Server element represents the characteristics of the entire JSP/Servlet container.

 

Setting Server Properties

Select Tomcat Server in the left pane. The Server Properties display in the right pane. The Server element represents the entire JSP/Servlet container. The server properties are shown in Table A-2.

Property
Description
Port Number
The TCP/IP port number on which this server waits for a shutdown command. This connection must be initiated from the same server computer that is running this instance of Tomcat. The default value is 8005. Values less than 1024 will generate a warning, as special software capabilities are required when using this port
Debug Level
The level of debugging detail logged by this server. Higher numbers generate more detailed output. If not specified, the default debugging detail level is zero (0).
Shutdown
The command string that must be received via a TCP/IP connection to the specified port number in order to shut down Tomcat. The value for this property must contain at least 6 characters. The default value is SHUTDOWN.

Configuring Services

Service elements are nested with the Server element. The Service element represents the combination of one or more Connector components that share a single engine component for processing incoming requests. The default configuration for Tomcat includes a Internal and a Java Web Services Developer Pack services.

It is possible to use admintool to add other services, which might use a different port. To create a new service,

  1. Select Tomcat Server in the left pane.

  2. Select Create New Service from the drop-down list in the right pane.

  3. Enter the values for Service Name, Engine Name, Debug Level, and Default Hostname.
    The Service Name is the display name of this Service, which will be included in log messages if you choose a Logger (see Configuring Logger Elements).

 

Note: The name of each Service associated with a particular Server must be unique.

 

For each Service element defined, you can create or delete the following elements:

 

Configuring Connector Elements

A Connector elements represent the interface between external clients sending requests to (and receiving responses from) a particular Service.

To edit a connector,

  1. Expand the Service element in the left pane.

  2. Select the Connector to edit.

  3. Edit the values in the right pane.

  4. Select Save to save the changes for this session. Select Commit Changes to save the changes for when Tomcat is restarted.

To create a new connector for a service,

  1. Select the Service element in the left pane. It is highly recommended that you only modify the Java Web Services Developer Pack Service, or a service that you have created.

  2. Select Create New Connector from the Available Actions list.

  3. Enter the preferred values for the Connector. See Connector Attributes for more information on the options.

  4. Select Save to save the changes for this session. Select Commit Changes to save the changes for when Tomcat is restarted.

To learn more about Connectors, read the documents titled Coyote HTTP/1.1 Connectors at $TOMCAT_HOME/docs/tomcat/config/coyote.html or the document titled JK 2 Connectors at $TOMCAT_HOME/docs/tomcat/config/jk2.html.

Types of Connectors

Using admintool, you can create the following types of Connectors:

Connector Attributes

When you create or modify any type of Connector, the attributes shown in Table A-3 may be set, as needed.

Attribute
Description
Accept Count
The maximum queue length for incoming connection requests when all possible request processing threads are in use. Any requests received when the queue is full will be refused. The default value is 10.
Connection Timeout
The number of milliseconds this Connector will wait, after accepting a connection, for the request URI line to be presented. The default value is 60000 (i.e. 60 seconds).
Debug Level
The debugging detail level of log messages generated by this component, with higher numbers creating more detailed output. If not specified, this attribute is set to zero (0).
Default Buffer Size
The size (in bytes) of the buffer to be provided for input streams created by this connector. By default, buffers of 2048 bytes will be provided.
Enable DNS Lookups
Whether or not you want calls to request.getRemoteHost() to perform DNS lookups in order to return the actual host name of the remote client. Set to True if you want calls to request.getRemoteHost() to perform DNS lookups in order to return the actual host name of the remote client. Set to False to skip the DNS lookup and return the IP address in String form instead (thereby improving performance).
IP Address
Specifies which address will be used for listening on the specified port, for servers with more than one IP address. By default, this port will be used on all IP addresses associated with the server.
Port Number
The TCP port number on which this Connector will create a server socket and await incoming connections. Your operating system will allow only one server application to listen to a particular port number on a particular IP address.
Redirect Port Number
The port number where Tomcat will automatically redirect the request if this Connector is supporting non-SSL requests, and a request is received for which a matching security constraint requires SSL transport.
Minimum
The number of request processing threads that will be created when this Connector is first started. This attribute should be set to a value smaller than that set for Maximum. The default value is 5.
Maximum
The maximum number of request processing threads to be created by this Connector, which therefore determines the maximum number of simultaneous requests that can be handled. If not specified, this attribute is set to 75.

When the Connector is of type HTTP or HTTPS, additional attributes are also available, as shown in Table A-4.

Attribute
Description
Proxy Name
The server name to be returned for calls to request.getServerName() if this Connector is being used in a proxy configuration.
Proxy Port Number
The server port to be returned for calls to request.getServerPort() if this Connector is being used in a proxy configuration.

When the type of Connector is HTTPS, additional attributes as outlined in Table A-5 may also be set.

Attribute
Description
Client Authentication
Whether or not you want the SSL stack to require a valid certificate chain from the client before accepting a connection. Set to True if you want the SSL stack to require a valid certificate chain from the client before accepting a connection. A False value (which is the default) will not require a certificate chain unless the client requests a resource protected by a security constraint that uses client-certificate authentication.
Keystore Filename
The path to and name of the keystore file where you have stored the server certificate to be loaded. By default, the file name is .keystore and the path name is the operating system home directory of the user that is running Tomcat. If you are using default values for the file name and path, you can leave this field blank.
If you specify a keystore file name without specifying a path, admintool looks for the file in the $TOMCAT_HOME directory.
Keystore Password
The password used to access the server certificate from the specified keystore file. The default value is changeit.

 

Note: In order to use an SSL connector, use keytool to generate a keystore file. If you have generated a keystore file with the default name (.keystore) in the default directory (the operating system home directory of the user that is running Tomcat) with default password (changeit), you can leave the Keystore Filename and Keystore Password attributes empty when creating an SSL Connector. When the two properti