Tomcat 3.3 is implemented using a set of modules. Each module has a number of settable properties and implements one or more 'hooks', providing a piece of functionality.
The modules can be configured and assembled in several ways, but the
default and most flexible mechanism uses XML files. Each module is described
by an XML element, with attributes used to set module properties. The main
configuration file is located in TOMCAT_HOME/conf/server.xml
, used to
configure the server. Additional TOMCAT_HOME/conf/server-name.xml
files
will be read after server.xml
, allowing local configurations.
Each attribute value may use the ant-style variable substitution ( ${variable} ). The values are stored as ContextManager properties, and defined using either <property name="foo" value="bar" />, as attributes in the <ContextManager> element, or in the command line using "-foo bar" syntax, or as system properties.
All modules have the following common attributes:
Attribute | Description | Default |
---|---|---|
debug |
Display debug information on the module execution |
0 |
Server.xml is an XML document. Most elements correspond to Tomcat modules, with Java setters being automatically associated with element attributes. The javadoc will contain most details, in this document we focus on the common and supported behaviors.
The purpose of the server.xml is to define the configuration of an instance of the Tomcat 3.3 web server. The parent configuration elements in the server.xml file represent that instance.
This is the main element in server.xml. It has a single child describing the tomcat configuration, ContextManager.
<Server> <ContextManager > ... ( tomcat configuration ) </ContextManager> </Server>
This is the main tag, used to set generic Tomcat options. The following are some of the childen it supports:
Attribute | Description | Default |
---|---|---|
install | Base directory for tomcat installation. It is typically guessed by the startup program, but you can override it here. | TOMCAT_HOME or one level above the location of the startup script or tomcat.jar (if "java -jar" is used for startup). |
workDir | Directory where temporary files will be created. Relative paths are interpreted as relative to TOMCAT_HOME. | work |
home | Base directory for the tomcat instance. While 'install' is used to find the libraries, 'home' is used to resolve almost all relative paths - webapps, work, etc. | TOMCAT_HOME or the value guessed by the startup program. |
<ContextManager install="/opt/tomcat" workDir="/var/tomcat" home="/var" />
It is the set of modules and their configuration that control the behavior of the Tomcat web server. By specifying which modules and their attributes, you have a lot of flexibility in controlling the features of your instance of Tomcat.
Note that "interceptor" is a name that used in the past, prior to the adoption of the name "module". It should be considered synonomous with "module". "Interceptor" will appear various in places, especially in module names and their classes.
The list of modules below is in alphabetical order. Functionally, they may be grouped as follows:
Type: Access, Authentication, and Authorization
Determines if security constraints specified in the web.xml apply to a request and provides the handling for BASIC and FORM authentication if necessary.
Attribute | Description | Default |
---|---|---|
ignoreCase | Enables case insensitive operation when matching a request to a security constraint. | false on Unix based systems true on Windows based systems |
<AccessInterceptor />
Type: Loggers
Creates log files in the style of the Apache servers "AccessLog".
Attribute | Description | Default | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
logFile | Name of the log file. | logs/AccessLog | ||||||||||||||||||||
format | A string describing the logfile format. Possible values are
"combined" (Apache httpd combined format, default),
"common" (Apache httpd common format) or a format string like
'%h %l %u %t "%r" %>s %b "%{Referer}" "%{User-Agent}"' '%h %l %u %t "%r" %>s %b'(The above examples are used when "combined" or "common" format is requested.) Possible patterns are:
|
"combined" format |
<AccessLogInterceptor format="common" />
Type: Server
Handles incoming Ajp12 requests. Ajp12 is a protocol used by the mod_jk based web server connectors and the mod_jserv connector. Also, used for shutting down Tomcat.
Attribute | Description | Default |
---|---|---|
ajpidFile | File in which to record Ajp12 connector info and password. | conf/ajp12.id |
secret | The desired shutdown password. | not specified |
tomcatAuthentication | Enables Tomcat's authentication, ignoring any authentication from the web server sending the requests. | true |
useSecret | Enables use of a random number as the shutdown password. | false |
Socket Properties | ||
address | Address to which the server socket binds. | null, bind on all addresses |
backlog | Maximum length of the backlog queue for the server socket. | 100 |
port | Port on which to receive requests. | no default, must be specified |
Thread Pool Properties | ||
maxThreads | Maximum number of threads in Thread pool. | 200 |
maxSpareThreads | Maximun number of spare threads. Unused threads will be terminated as needed to keep the number of spare threads under this number. | 50 |
minSpareThreads | Minimum number of spare threads. Additional threads will be created as needed to keep the number of spare threads up to this number. | 4 |
pools | Enables use of a Thread pool. | true |
<Ajp12Connector port="8007" ajpidFile="conf/ajp12_2.id" />
Type: Server
Handles incoming Ajp13 requests. Ajp13 is a protocol used by the mod_jk based web server connectors.
Attribute | Description | Default |
---|---|---|
shutDownEnable | Enable shutdown signal via this connector. Normally shutdown is done through Ajp12Connector. | false |
tomcatAuthentication | Enables Tomcat's authentication, ignoring any authentication from the
web server sending the requests. This means that the user returned by
HttpServletRequest.getRemoteUser() will be the user authenticated locally
within Tomcat. If you are using Tomcat with a web server, such as Apache,
and you want to use the user authenticated by the web server, set this
attribute false . |
true |
Socket Properties | ||
address | Address to which the server socket binds. | null, bind on all addresses |
backlog | Maximum length of the backlog queue for the server socket. | 100 |
port | Port on which to receive requests. | no default, must be specified |
Thread Pool Properties | ||
maxThreads | Maximum number of threads in Thread pool. | 200 |
maxSpareThreads | Maximun number of spare threads. Unused threads will be terminated as needed to keep the number of spare threads under this number. | 50 |
minSpareThreads | Minimum number of spare threads. Additional threads will be created as needed to keep the number of spare threads up to this number. | 4 |
pools | Enables use of a Thread pool. | true |
<Ajp13Connector port="8009" tomcatAuthentication="false" />
Type: Configuration
Generate configuration file for mod_jk to be included in Apache's httpd.conf.
For additional information on connecting Tomcat to Apache via mod_jk, see the Working with mod_jk document.
Important Note: The configuration files are not written as part of a normal startup of Tomcat. To generate the configuration files on demand, append:
jkconf
or
-jkconf
to the startup command. Tomcat will initialize sufficiently to write the configuration files and then exit. This may be done while Tomcat 3.3 is running. To generate the configuration files during normal startup, add:
jkconf="true"
to the <ContextManager ... >
element in the
server.xml
file.
Attribute | Description | Default |
---|---|---|
configHome | Default parent directory for the following paths. Ignored whenever any of the following paths is absolute. | TOMCAT_HOME |
jkConfig | Path to use for writing Apache mod_jk configuration file. | conf/auto/mod_jk.conf |
workersConfig | Path to workers.properties file used by mod_jk. | conf/jk/workers.properties |
modJk | Path to Apache mod_jk plugin file. | Windows: modules/mod_jk.dll Netware: modules/mod_jk.nlm Unix and all others: libexec/mod_jk.so |
jkLog | Path to log file to be used by mod_jk. | logs/mod_jk.log |
jkDebug | JK Loglevel setting. May be debug, info, error, or emerg. | emerg |
jkWorker | The desired worker. Must be set to one of the workers defined in the workers.properties file. "ajp12", "ajp13" or "inprocess" are the workers found in the default workers.properties file. | Defaults to "ajp13" if an Ajp13Connector is in use, otherwise it defaults to "ajp12". |
forwardAll | If true , forward all requests to Tomcat. This helps ensure that all the
behavior configured in the web.xml file functions correctly. If false ,
let Apache serve static resources. Warning: When false , some configuration
in the web.xml may not be duplicated in Apache. Review the mod_jk
configuration file to see the actual configuration being set in Apache. |
true |
noRoot | If true , the root context is not mapped to Tomcat. If false and
forwardAll is true , all requests to the root context are mapped to Tomcat.
If false and forwardAll is false , only JSP and servlets requests to the
root context are mapped to Tomcat. When false , to correctly serve
Tomcat's root context in the default host you must also modify the
DocumentRoot setting in Apache's httpd.conf file to point to Tomcat's root
context directory. Otherwise some content, such as Apache's index.html,
will be served by Apache before mod_jk gets a chance to claim the request
and pass it to Tomcat. If a root context is assigned to a virtual host,
then the DocumentRoot is automatically included in the configuration for
that virtual host. |
true |
<ApacheConfig forwardAll="true" noRoot="false" />
Type: Configuration
Automatically expands WAR files on startup.
Note: If the redeploy
attribute is true
and
a ReloadInterceptor is present, then WAR
files will re-deploy automatically while Tomcat 3.3 is running.
Attribute | Description | Default |
---|---|---|
source | Directory where ".war" files are located. | ${tomcat.home}/webapps |
target | Directory where .war files will be expanded | ${tomcat.home}/webapps |
redeploy | Check if the .war file is changed and re-deploy. This works in the same way as reloading. | false |
<AutoDeploy source="webapps" target="webapps" />
Type: Configuration
Automatically adds web application contexts from a directory.
Attribute | Description | Default |
---|---|---|
dir |
Directory from which to load the web applictions. Relative paths are interpreted as relative to TOMCAT_HOME. |
webapps |
prefix |
Prefix to add to the context path for each deployed web application. The context path will consist of the prefix followed subdirectory name. |
DEFAULT |
host |
Virtual host into which each application will be deployed. |
DEFAULT |
ignoreDot | Ignore dirs starting with '.' | true |
flat | Each dir will be treated as a webapp in the same host. If false ,
each dir will be treated as a host name and its subdirs as
web applications. You can add apps to multiple virtual hosts. |
true |
<AutoWebApp dir="webapps" host="DEFAULT" /> <AutoWebApp dir="myhost" host="myhost.com" />
Type:Configuration
Reads the XML files that define contexts to be served by Tomcat. You specify a single file to read. However, in addition to that file, all other files in the same directory will be read that match the pattern "base-*.xml", where base is the base name (i.e. name without extension) of the file you specified. Each file may configure one or more contexts. Where the context matches a context automatically created by the AutoWebApp module, the configuration file will override the default context settings.
For details on the syntax of the context configuration file, refer to the Customizing Contexts section of the Tomcat 3.3 Users Guide.
Attribute | Description | Default |
---|---|---|
config | Context configuration file to read. It may configure one or more contexts. | conf/server.xml |
<ContextXmlReader config="conf/myapps.xml" />
Type: Access, Authentication, and Authorization
Extracts the user name and password from a request and makes the information available for another module to perform the authentication. It currently supports extracting user name and passwords from BASIC and FORM based authetication.
This module must appear prior to the "realm" module that performs the authentication.
This module has no user settable attributes.
<CredentialsInterceptor />
Type: Mappers
Handles the task of establishing the encoding of a request. It also handles optionally normalizing the request and optionally checking the request for unsafe escape sequences.
Attribute | Description | Default |
---|---|---|
defaultEncoding | Server wide default encoding to use. When set, all requests will
default to this encoding if the encoding can't be determined or an
appropriate guess isn't available. If null , a request's
internal default of ISO-8859-1 remains in effect. |
null, which indirectly defaults to ISO-8859-1 |
useSessionEncoding | Enables use of the encoding of the response as default for the next
request. This parameter if true can affect the value returned
by ServletRequest.getCharacterEncoding(). If the encoding hasn't been
previously specified, a request attribute corresponding to
charsetAttribute has not been found, and a session is available, then
getCharacterEncoding() will return the character encoding of the last
response sent for this session. |
true |
charsetAttribute | The name of the URL attribute to use for two alternate ways of specifying
character encoding. First, you may specify the encoding by including
";charsetAttribute=encoding in the URL. For example,
"http://localhost:8080/myapp/index.jsp;charset=UTF-8" would
specify the encoding as UTF-8 . The special attribute is
removed from the URI, so it is not visible to normal request handling.
Second, if the encoding has not been previously specified, then
handing for ServletRequest.getCharacterEncoding() will check for a
request attribute with the charsetAttribute name and return that encoding
if found. |
charset |
normalize | Normalize the request URI to remove occurrences of "//", "/./", and "/x/../". Also remove ending "/." and "/x/.." | true |
safe | Enables checking for unsafe encodings. These are %25 ('%'), %2E ('.'), %2F ('/'), and %5C ('\'). If any are found in the URI, the request is considered "unsafe" and a 403 Forbidden error is returned. | true |
<DecodeInterceptor useSessionEncoding="true" >
Type: Generator
Handles response generation when a request encounters an error. Calls the appropriate error handler if specified, or generates the default error response if not specified.
Attribute | Description | Default |
---|---|---|
showDebugInfo | Enables the inclusion of extra information in the default error output, such as stack traces. This extra information can expose data about the internal operation of Tomcat. It should be disabled in production environments. | true |
<ErrorHandler showDebugInfo="false" />
Type: Server
Handles incoming HTTP, or optionally HTTPS, requests.
Attribute | Description | Default |
---|---|---|
reportedname | Specifies the string to use for the "Server" header | null, use default Tomcat server string |
Connection Properties | ||
secure | Enables use of a SSL socket factory and act as an HTTPS server. | false |
keystore | Keystore containing the Server certificate | .keystore in directory specified by the user.home System property |
keypass | Password to the keystore. | changeit |
clientauth | Enables requirement for client authentication. | false |
Socket Properties | ||
address | Address to which the server socket binds. | null, bind on all addresses |
backlog | Maximum length of the backlog queue for the server socket. | 100 |
port | Port on which to receive requests. | no default, must be specified |
timeout | Socket read timeout in seconds. | 300 |
Thread Pool Properties | ||
maxThreads | Maximum number of threads in Thread pool. | 200 |
maxSpareThreads | Maximun number of spare threads. Unused threads will be terminated as needed to keep the number of spare threads under this number. | 50 |
minSpareThreads | Minimum number of spare threads. Additional threads will be created as needed to keep the number of spare threads up to this number. | 4 |
pools | Enables use of a Thread pool. | true |
<Http10Interceptor port="8080" timeout="60" />
Type: Configuration
Generate configuration files for isapi_redirect.dll to be used for connecting
IIS to Tomcat. Two files will be generated, iis_redirect.reg
and
uriworkermap.properties
. Both files will be written to
conf/auto
relative to TOMCAT_HOME. The iis_redirect.reg
contains the needed registry entries for the iis_redirect.dll
.
You may enter the settings into the registry by double-clicking on this file in
Windows Explorer. The uriworkermap.properties
file will be read
by the isapi_redirect.dll
to get the mappings for determining
which requests should be passed to Tomcat.
For additional information on connecting Tomcat to IIS, see the Tomcat IIS HowTo document.
Important Note: The configuration files are not written as part of a normal startup of Tomcat. To generate the configuration files on demand, append:
jkconf
or
-jkconf
to the startup command. Tomcat will initialize, write the configuration files, and then shutdown. This may be done while Tomcat 3.3 is running. To generate the configuration files during normal startup, add:
jkconf="true"
to the <ContextManager ... >
element in the
server.xml
file.
Attribute | Description | Default |
---|---|---|
configHome | Default parent directory for the following paths. Ignored whenever any of the following paths is absolute. | TOMCAT_HOME |
regConfig | Path to use for writing the registry settings configuration file. | conf/auto/iis_redirect.reg |
uriConfig | Path to use for writing the URI worker map configuration file. | conf/auto/uriworkermap.properties |
workersConfig | Path to workers configuration file. | conf/jk/workers.properties |
jkLog | Path to log file to be used by isapi_redirect.dll . |
logs/iis_redirect.log |
jkDebug | JK Loglevel setting. May be debug, info, error, or emerg. | emerg |
jkWorker | The desired worker. Must be set to one of the workers defined in the workers.properties file. "ajp12", "ajp13" or "inprocess" are the workers found in the default workers.properties file. | Defaults to "ajp13" if an Ajp13Connector is in use, otherwise it defaults to "ajp12". |
forwardAll | If true , forward all requests to Tomcat. This helps ensure that all the
behavior configured in the web.xml file functions correctly. If false ,
let IIS serve static resources. Warning: When false , some configuration
in the web.xml may not be duplicated in IIS. Review the configuration
files to see the actual configuration being set in IIS. |
true |
noRoot | If true, the root context is not mapped to Tomcat. If false and
forwardAll is true , all requests to the root context are mapped to Tomcat.
If false and forwardAll is false , only JSP and servlets requests to the
root context are mapped to Tomcat. |
true |
<IISConfig forwardAll="true" noRoot="false" />
Type: Generator
Provides support for the "/servlet/class name" legacy method of invoking servlets.
This module has no user settable attributes.
<InvokerInterceptor />
Type: Access, Authentication, and Authorization
Authenticates the user if required for a request. The authentication occurs using data from "user" and "user roles" tables accessed using a JDBC connection.
Attribute | Description | Default |
---|---|---|
driverName | JDBC driver to use. | must be specified |
connectionURL | URL to use to connect to the database. | must be specified |
connectionName | User name to use to connect to the database. The connectionPassword must also be specified before the user name and password will be used. | not used |
connectionPassword | Password to use to connect to the database. The connectionName must also be specified before the user name and password will be used. | not used |
userTable | Table that holds the user data. | must be specified |
userNameCol | Column in the user table that holds the user's name. | must be specified |
userCredCol | Column in the user table that holds the user's credentials. | must be specified |
userRoleTable | Table that holds the relation of users to their roles | must be specified |
roleNameCol | Column in the user role table that names a role. | must be specified |
connectOnInit | Enables establishing JDBC connection when Tomcat starts. Otherwise, establish JDBC connection on first use. | false |
<JDBCRealm driverName="sun.jdbc.odbc.JdbcOdbcDriver" connectionURL="jdbc:odbc:TOMCAT" userTable="users" userNameCol="user_name" userCredCol="user_pass" userRoleTable="user_roles" roleNameCol="role_name" />
Type: Generator
Ensures that the proper context classloader is in effect during servlet execution.
This module has no user settable attributes.
<Jdk12Interceptor />
Type: Server
Handles requests processed by Tomcat running in-process. It has no effect if Tomcat was not started in-process by the Tomcat connector.
Attribute | Description | Default |
---|---|---|
exitIfNoLib | Causes Tomcat to exit if the native libary is not successfully loaded. | true |
nativeLibrary | Name of the native library to load. If the name specified is not
absolute, it tries loading the library using the name as is. If that
fails, it will try loading it from TOMCAT_HOME/bin/native . |
Windows: jni_connect.dll Netware: jni_connect.nlm Unix and all others: jni_connect.so |
<JniConnector nativeLibrary="bin/jni_connect.so" />
Type: Configuration
Generate configuration file for mod_jk to be included in Apache's httpd.conf.
For additional information on connecting Tomcat to Apache via mod_jk, see the Working with mod_jk document.
Important Note: The configuration files are not written as part of a normal startup of Tomcat. To generate the configuration files on demand, append:
jkconf
or
-jkconf
to the startup command. Tomcat will initialize sufficiently to write the configuration files and then exit. This may be done while Tomcat 3.3 is running. To generate the configuration files during normal startup, add:
jkconf="true"
to the <ContextManager ... >
element in the
server.xml
file.
Attribute | Description | Default |
---|---|---|
configHome | Default parent directory for the following paths. Ignored whenever any of the following paths is absolute. | TOMCAT_HOME |
jservConfig | Path to use for writing Apache tomcat-apache.conf configuration file. | conf/auto/tomcat-apache.conf |
modJserv | Path to Apache mod_jserv plugin file. | Windows: modules/ApacheModuleJserv.dll Unix and all others: libexec/mod_jserv.so |
jservLog | Path to log file to be used by mod_jserv. | logs/mod_jserv.log |
jservDebug | JServ Loglevel setting. May be debug, info, notice, warn, error, crit, alert, or emerg. | emerg |
forwardAll | If true , forward all requests to Tomcat. This helps ensure that all the
behavior configured in the web.xml file functions correctly. If false ,
let Apache serve static resources. Warning: When false , some configuration
in the web.xml may not be duplicated in Apache. Review the tomcat-apache.conf
configuration file to see the actual configuration being set in Apache. |
true |
noRoot | If true , the root context is not mapped to Tomcat. If false and
forwardAll is true , all requests to the root context are mapped to Tomcat.
If false and forwardAll is false , only JSP and servlets requests to the
root context are mapped to Tomcat. If a root context is assigned to a virtual host,
then the DocumentRoot is automatically included in the configuration for
that virtual host. |
true |
<JservConfig forwardAll="true" noRoot="false" />
Type: Servlet 2.2 Facade
Handles turning a JSP page into a loaded servlet for execution. Execution for the loaded servlet is handled the same as any other servlet. It uses Jasper for translating the JSP to a Java file, then performs compilation to a class file directly rather than using Jasper for the class compilation.
There is support for using Sun's javac
Java compiler as well
as IBM's Jikes
Java compiler.
Attribute | Description | Default |
---|---|---|
JSP Translation Options | ||
keepGenerated | Keep the translated Java file. If false , the Java file
is deleted after being compiled to a class file. |
true |
largeFile | Writes the HTML text from a JSP to a separate file with a ".dat"
extension. This text is read when the JSP servlet initializes. The makes
the class file smaller. If false , "out.print()"
statements are generated with the HTML text is embedded as a literal. |
false |
mappedFile | Generate "out.print()" for each HTML text line in the JSP
file. If false , the HTML text from multiple lines are
concatenated and output in one "out.print()". This option is
ignored if largeFile is true . |
false |
IEClassId | The Microsoft Internet Explorer "classid" to be used by
the jsp:plugin tag. |
clsid:8AD9C840-044E-11D1-B3E9-00805F499D93 |
scratchdir | Destination directory for the JSP's Java file. | context's work directory |
Options for JSP Java Compilation | ||
javaCompiler | Jasper class for invoking the Java compiler. For using Sun's
javac Java compiler in process, specify
org.apache.jasper.compiler.SunJavaCompiler . To use IBM's
Jikes Java compiler out of process, specify
org.apache.jasper.compiler.JikesJavaCompiler or
just jikes which is a supported shortcut. |
org.apache.jasper.compiler.SunJavaCompiler |
classDebugInfo | Enables compiling the class file with debugging information. | false |
Options for Jikes Complier | ||
jspCompilerPath | Path to Java compiler executable. Used only with Jikes as the Java
compiler. If not specified, the Jikes executable must be in the PATH
environment variable. |
empty |
jikesClasspath | Extra classpath entries to pass to the Jikes compiler. This would
typically include extension jars found in the jre/lib/ext
directory of a Java 2 SDK. By default, the jre/lib/rt.jar
file is automatically included so it does not need to be present
in this setting. Classes from WEB-INF/classes and
jars from WEB-INF/lib are also automatically included. |
empty |
Options for JSP Runtime | ||
pageContextPoolSize | Sets pool size of JSP PageContexts. If zero, disables pooling. | 100 |
Options for Jasper JSP servlet - These are not used if
useJspServlet is false . |
||
useJspServlet | Enables use of Jaspers JspServlet for translating, compiling, and loading JSP pages. Provided for backward compatibility with earlier Tomcat implementations. | false |
jspServlet | The JSP servlet class. | org.apache.jasper.servlet.JspServlet |
classPath | Classpath passed to the Java compiler when compiling to a class file. | empty |
<JspInterceptor keepGenerated="false" /> <JspInterceptor javaCompiler="jikes" />
Type: Configuration
This module constructs and sets the classloader for each context. It
supports the Servlet 2.2 spec by including WEB-INF/classes
and the Jars in WEB-INF/lib
in the classloader. The
available attributes allow control over the context classloader's parent.
With the default attributes, "trusted" contexts get the
Server Classloader as their
parent and "untrusted" contexts get the
Apps Classloader as their
parent.
Attribute | Description | Default |
---|---|---|
jaxp | Enables providing a default XML parser to web applications that don't
already have one. If the javax.xml.parsers.SAXParserFactory
class is found in a web application, it is assumed to already contain
an XML parser and not action is taken for that web application. |
true |
jaxpDir | Directory where Jaxp jars are located. | lib/container |
jaxpJars | List of jars to be added, separated by colons. | jaxp.jar:crimson.jar:xalan.jar:xerces.jar |
useNoParent | If true , sets the context classloader's parent to
null . If false , then contexts which are
"trusted" will get the
Server Classloader as the parent. The parent classloader for contexts
which are not "trusted" are controlled by the
useApplicationLoader attribute. |
false |
useApplicationLoader | If true , when useNoParent is false ,
sets the context classloader's parent to the
Apps Classloader. If
false , when useNoParent is false ,
sets the context classloader's parent to the
Server Classloader. |
true |
<LoaderInterceptor11 jaxp="true" />
Type: Servlet 2.2 Facade
Handles pre-loading of servlets specified as <load-on-startup> in a Context's web.xml file.
This module has no user settable attributes.
<LoadOnStartupInterceptor />
Type: Configuration
This module enables logging of when module methods are called. The log output goes to the ContextManager's log channel. Event logging is automatically enabled if the ContextManager's debug level is set greater than 5.
Attribute | Description | Default |
---|---|---|
enabled | If true , enables logging of when module methods are called. |
false |
<LogEvents enabled="true" />
Type: Configuration
Configures a log channel.
Attribute | Description | Default |
---|---|---|
name | Name of the log channel. | null |
path | Path to the desired log file. You may embed a
java.text.SimpleDateFormat string enclosed within '{}'
to create a path that encorporates the current date and or time. |
null, log output goes to stderr |
verbosityLevel | Verbosity level for the log. Accepted values are: FATAL ,
ERROR , WARNING , INFORMATION ,
and DEBUG . |
INFORMATION |
timestamps | If true , a timestamp is included at the beginning of
each line in the log output. |
true |
timestampFormat | Format for timestamp, if enabled. | yyyy-MM-dd HH:mm:ss |
<LogSetter name="tc_log" verbosityLevel="DEBUG" />
Type: Configuration
Generate configuration files for nsapi_redirect.dll to be used for connecting
Netscape Web Server to Tomcat. An obj.conf
will be written to
conf/auto
relative to TOMCAT_HOME. The contents of this
obj.conf
will need to be merged with the obj.conf
file being used for the disired server.
For additional information on connecting Tomcat to Netscape, see the Tomcat Netscape HowTo document.
Important Note: The configuration files are not written as part of a normal startup of Tomcat. To generate the configuration files on demand, append:
jkconf
or
-jkconf
to the startup command. Tomcat will initialize, write the configuration files, and then shutdown. This may be done while Tomcat 3.3 is running. To generate the configuration files during normal startup, add:
jkconf="true"
to the <ContextManager ... >
element in the
server.xml
file.
Attribute | Description | Default |
---|---|---|
configHome | Default parent directory for the following paths. Ignored whenever any of the following paths is absolute. | TOMCAT_HOME |
nsapiJk | Path to Netscape mod_jk plugin file. | Windows: bin/nsapi_redirect.dll Netware: bin/nsapi_rd.nlm Unix and all others: bin/nsapi_redirector.so |
objConfig | Path to use for writing the Netscape obj.conf configuration file. | conf/auto/obj.conf |
objectName | Name of the Object to execute the requests. | servlet |
workersConfig | Path to workers configuration file. | conf/jk/workers.properties |
jkLog | Path to log file to be used by nsapi_redirect.dll . |
logs/nsapi_redirect.log |
jkDebug | JK Loglevel setting. May be debug, info, error, or emerg. | emerg |
jkWorker | The desired worker. Must be set to one of the workers defined in the workers.properties file. "ajp12", "ajp13" or "inprocess" are the workers found in the default workers.properties file. | Defaults to "ajp13" if an Ajp13Connector is in use, otherwise it defaults to "ajp12". |
forwardAll | If true , forward all requests to Tomcat. This helps ensure that all the
behavior configured in the web.xml file functions correctly. If false ,
let Netscape serve static resources. Warning: When false , some configuration
in the web.xml may not be duplicated in Netscape. Review the configuration
files to see the actual configuration being set in Nescape. |
true |
noRoot | If true, the root context is not mapped to Tomcat. If false and
forwardAll is true , all requests to the root context are mapped to Tomcat.
If false and forwardAll is false , only JSP and servlets requests to the
root context are mapped to Tomcat. |
true |
<NSConfig forwardAll="true" noRoot="false" objectName="tomcat" />
Type: Configuration
Installs a security manager and/or a policy file if Tomcat is started with "sandbox" enabled. This module has no effect if you specify a "-Djava.security.policy=..." in the startup command for the Java VM. Setting the policy on the command line is the preferred method.
Attribute | Description | Default |
---|---|---|
securityManagerClass | Customize the security manager | java.lang.SecurityManager |
policyFile | Policy file to be used by the security manager. | conf/tomcat.policy |
sandbox | Force the use of a sandbox, regardless of command line. | false |
<PolicyLoader securityManagerClass="java.lang.SecurityManager" policyFile="conf/tomcat.policy" />
Type: Mappers
Handles reloading of servlets and contexts.
Attribute | Description | Default |
---|---|---|
fullReload | Enables restarting of the context whenever a change is detected. This is
the cleanest form of reload. If false , it only reloads the
servlets. |
true |
<ReloadInterceptor fullReload="true" />
Type: Servlet 2.2 Facade
Handles some miscellaneous tasks that help implement behavior related to the Servlet 2.2 specification.
This module has no user settable attributes.
<Servlet22Interceptor />
Type: Session
Handles actual descruction of expired sessions.
Attribute | Description | Default |
---|---|---|
checkInterval | How often to check for expired sessions, in seconds. | 60 |
<SessionExpirer checkInterval="120" />
Type: Session
Handles associating sessions with requests and responses.
Attribute | Description | Default |
---|---|---|
cookiesFirst | Enables checking cookies first for determining if a request has an
associated session, followed by checking for ";jsessionid" in
the URL. If false , ";jsessionid" is checked for first. |
true |
noCookies | If true, no session cookies are added to the response. Instead you
must use HttpServletResponse.encodeURL() to embed URL's in the response
that contain the session id. If false , the session id will be added
to the response as a cookie. You may still use HttpServletResponse.encodeURL()
if you want your sessions to work with browsers that have cookies turned
off. |
false |
<SessionId cookiesFirst="true" noCookies="false" /> <SessionId noCookies="true" />
Type: Session
Creates new session IDs when needed for a request. If the
randomFile
is not available, the class specified by
randomClass
will be used. In this case, initialization of
class occurs on the first request requiring a session.
Note: The initialization for the java.security.SecureRandom
class can take a relatively long time. For development purposes, you may speed
this up by specifying java.util.Random
as the
randomClass
setting. This should be done only for development
since the random sequence generated by java.util.Random is predictable.
Attribute | Description | Default |
---|---|---|
randomClass | Class for creating a random number use in session ID creation when
randomFile isn't available. |
java.security.SecureRandom |
randomFile | A special "device" available on some Unix based operating
systems. Used for obtaining a random number used in session ID creation.
If available, overrides use of the randomClass setting. |
/dev/urandom |
<SessionIdGenerator randomClass="java.security.SecureRandom" randomFile="/dev/urandom" />
Type: Mapper
Handles the mapping of requests to the appropriate context.
Attribute | Description | Default |
---|---|---|
mapCache | Enables creating a cache map of the full request URI to its associated context. This speeds the mapping operation for subsequent requests. This feature is considered experimental. | false |
ignoreCase | Enables case insensitive operation when mapping a request to a context. | false on Unix based systems true on Windows based systems |
<SimpleMapper1 />
Type: Access, Authentication, and Authorization
Authenticates the user if required for a request. It compares the user name and password information provided by the CredentialsInterceptor against data in memory obtained from an XML file.
Since passwords are stored in text form, you should not use this module when security is important. Replace this module with a more secure one, such as the JDBCRealm.
This module must follow the CredentialsInterceptor.
Attribute | Description | Default |
---|---|---|
filename | File containing the user names, passwords, and roles. A leading '/' is optional. | /conf/users/tomcat-users.xml |
<SimpleRealm filename="conf/users/users.xml" />
XML file format:
<tomcat-users> <user name="user name" password="password" roles="role[,role]" /> </tomcat-users>
Type: Session
Creates, stores, and maintains session objects in a simple in-memory pool.
Note: This module must follow the SessionId module.
Attribute | Description | Default |
---|---|---|
maxActiveSessions | Maximum number of active sessions allowed. Attempts to create sessions beyond this limit will fail. If set to "-1", then there is no limit to the number of active sessions. | -1 |
<SimpleSessionStore maxActiveSessions="-1" />
Type: Generator
Generates the response for requests that map to static files or directories. The display of directory listings may be disabled.
Attribute | Description | Default |
---|---|---|
listings | Enables the display of directory listings when requested. | true |
<StaticInterceptor listing="false" />
Type: Servlet 2.2 Facade
Handles an enhancement to tag libary support by managing a pool tag objects. Tag objects will be created the first time a JSP page runs. After use the tag objects are placed in a pool. The next time the JSP page runs, the tag objects are retrieved from the pool rather than recreated.
If this module is not present, tag objects can't be retrieved from the pool and tag objects are created for each use.
This module has no user settable attributes.
&tl;TagPoolManagerInterceptor />
Type: Configuration
Provides special handling for "trusted" contexts which have a
interceptors.xml
file in their WEB-INF
directory.
This file can specify modules to be added to the server as if they were
specified in the server.xml
file.
This module has no user settable attributes.
<TrustedLoader />
Type: Servlet 2.2 Facade
Reads the WEB-INF/web.xml
file for each context.
Attribute | Description | Default |
---|---|---|
validate | Enables validation of the web.xml when read. After the
first validation, a webxmlval.txt file is written to the
context's work directory. On subsequent startups of Tomcat, validation
is skipped if the webxmlval.txt remains newer than the
web.xml file. |
true |
<WebXmlReader validate="false" />
Type: Configuration
Set the "work" directory for contexts which don't have the "work" directory specified explicitly.
Attribute | Description | Default |
---|---|---|
cleanWorkDir | Deletes context "work" directories as each context is started and
shutdown. It is recommended that you only set this true
during development if it serves a purpose. |
false |
useWebInf | If true , defaults the "work" directory to
WEB-INF/TOMCAT_WORKDIR . If false , defaults
the "work" directory to
workDirBase/host/context path ,
where host is the context's virtual host name, or
"DEFAULT" if a virtual host name isn't set. If the virtual
host name is an IP address, the colons will be replaced with '_'. |
false |
workDirBase | The base directory for work directories when useWebInf is
false . |
ContextManager's work setting which defaults to
"work" |
<WorkDirSetup cleanWorkDir="false" workDirBase="work" />