The Tomcat server.xml File


The Tomcat server.xml File

While the jboss-service.xml file controls the JBoss/Tomcat integration, Tomcat has its own configuration file, which guides its operation. This is the server.xml descriptor that you will find in the jbossweb-tomcat50.sar directory. Although this file doesn't have a formal DTD or schema definition, Figure 9.1 shows the general structure of the file.

Figure 9.1. An overview of the Tomcat server.xml file.


We'll now look at some of the configuration options that are available in the server.xml file. The top-level element is the Server element; it is the root element, and it should contain a Service element that represents the entire web subsystem. The only supported attribute is name, which is a unique name by which the service is known.

The Connector Element

The Connector element configures a transport mechanism that allows clients to send requests and receive responses from the Service it is associated with. Connectors forward requests to the engine and return the results to the requesting client. The Connector element supports these attributes:

  • enableLookups This is a flag that enables DNS resolution of the client hostname, as accessed via the ServletRequest.getRemoteHost method. This flag defaults to false.

  • redirectPort This is the port to which non-SSL requests will be redirected when a request for content secured under a transport confidentiality or integrity constraint is received. This defaults to the standard HTTPS port of 443.

  • secure This attribute sets the ServletRequest.isSecure method value flag to indicate whether the transport channel is secure. This flag defaults to false.

  • scheme This attribute sets the protocol name as accessed by the ServletRequest.getScheme method. The scheme defaults to http.

  • acceptCount This is 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.

  • address For servers with more than one IP address, this attribute specifies which address will be used for listening on the specified port. By default, this port will be used on all IP addresses associated with the server.

  • bufferSize This is the size (in bytes) of the buffer to be provided for input streams created by this connector. By default, buffers of 2048 bytes are provided.

  • connectionTimeout This is 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 (that is, 60 seconds).

  • debug This attribute specifies 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). Whether or not this shows up in the log further depends on the log4j category org.jboss.web.tomcat.tc5.Tomcat5 threshold.

  • maxThreads This attribute specifies 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 200.

  • maxSpareThreads This attribute specifies the maximum number of unused request-processing threads that will be allowed to exist until the thread pool starts stopping the unnecessary threads. The default value is 50.

  • minSpareThreads This attribute specifies the number of request-processing threads that will be created when this connector is first started. The connector will also make sure it has the specified number of idle processing threads available. This attribute should be set to a value smaller than that set for maxThreads. The default value is 4.

  • port This attribute specifies the TCP port number on which this connector will create a server socket and await incoming connections. The operating system allows only one server application to listen to a particular port number on a particular IP address.

  • proxyName If this connector is being used in a proxy configuration, you configure this attribute to specify the server name to be returned for calls to request.getServerName().

  • proxyPort If this connector is being used in a proxy configuration, you configure this attribute to specify the server port to be returned for calls to request.getServerPort().

  • tcpNoDelay If set to TRue, the TCP_NO_DELAY option will be set on the server socket, which improves performance under most circumstances. This is set to true by default.

You can find additional attribute descriptions in the Tomcat documentation at http://jakarta.apache.org/tomcat/tomcat-5.0-doc/config/http.html.



JBoss 4. 0(c) The Official Guide
JBoss 4.0 - The Official Guide
ISBN: B003D7JU58
EAN: N/A
Year: 2006
Pages: 137

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net