Server Configuration

This document describes properties that are used to configure the server and servlet container. The file containing these properties is found by specifying its location as the first argument to the program's main entry point.

There are three subsections:

Server Properties

These properties configure the HTTP server.

Property Name Default Value Description
server.backlog -1 Specifies the connection backlog for the ServerSocket. A value less than 0 indicates that the default value should be used.
server.bufferSize 512 Size, in bytes, of any input or output buffers.
server.hostname <none> This is the default host name of the server. If this is specified and an absolute URL or "Host" header specify a different host, then a 400 Bad Request will be returned. If this property is not specified then the server will ignore the host part of the request. The servlet container, however, will make a "best guess" for the server name.
server.maxHandlers 5 Maximum number of requests that the server will process at once.
server.maxRequestURILength -1 Maximum size of of the Request-URI that the server will accept. The server will respond with 414 Request-URI Too Long for anything over this limit. A negative number means there is no limit.
server.mimeTypesFile <none>

Specifies the location of the MIME types configuration file. This file is a standard properties file that maps file extensions to a MIME type. For example, a line containing:


would map the ".txt" extension to the "text/plain" type.

Please see the MIME Types document for more information.

server.minGCInterval 30 Minimum number of seconds between server internal cleanup calls.
server.port 80 The server listens for requests on this port.
server.requestTimeout 10 Number of seconds the server will wait for input from a connection. A 408 Request Timeout will be sent after this time.
server.rootDir /http-root Specifies the root directory for serving files.
server.sendServerHeader false Indicates whether the "Server" header field will be sent with each response. The HTTP specification encourages that implementors make this a configurable option ("HTTP/1.1", RFC 2616, p. 141). This is a Boolean value.
server.shutdownEnabled false The server can be shut down if a special password URL is requested. This property enables this feature. This is a Boolean value.
server.shutdownPasswordFile <none> If this property is set then the special password URL is stored in the specified file. This property is only utilized if the shutdown feature is enabled with server.shutdownEnabled.
server.verbose false Specifies that all the configuration properties be printed to the log at startup.
server.welcomeFile index.html Specifies the default welcome file name. The server will look for this file if a directory is specified in the Request-URI.


Logging Properties

These properties configure the server logging features.

Property Name Default Value Description
server.log.logFile <none> Specifies the location of the log file. This file will contain all data passed to one of the log methods of the server/servlet container. Setting this property to a single dash, "-", will direct all output to System.out.
server.log.mailFrom <none> This specifies where the emailed log files are 'from'. This should be an email address.
server.log.mailTo <none> Email address to which log files are sent once they reach the maximum size given in the server.log.maxSize property.
The system property is checked for the proper destination.
server.log.maxSize 10000 The log files can reach this maximum size before being sent to the address specified in the server.log.mailTo property. If the log is not mailed, then it is truncated to this length. Specify something very large if you don't want the log to be truncated.
server.log.stackTraceEnabled false Specifies that any logged exceptions will have their stack traces printed to the log, in addition to its type and message.
server.log.transferLogFile <none> Specifies the location of the transfer log file. This file will contain details about every transaction with the server. Setting this property to a single dash, "-", will direct all output to System.out.


Servlet Container Properties

These properties configure the servlet container.

Property Name Default Value Description
servlet.classpath <none> The servlet classloader will search this classpath, in addition to the default and user classpaths, for servlet classes if servlet reloading is enabled. (See the servlet.reloadingEnabled property.) If servlet reloading is required, then this property should be specified. The reason is that certain platforms (such as the EJC from Snijder Micro Systems) cache classes loaded from the default and user paths. Please consult your documentation to discover if this is true for your platform.

Use the path separator appropriate for your platform. This can be obtained from the path.separator system property. The and fields also contain the correct value. For example, if the system path separator is ';', then a valid servlet.classpath setting may be:

servlet.contextParams <none> Specifies the ServletContext initialization parameters, formatted as a comma-separated list of name=value pairs.
servlet.maxTimeBeforeDestroy 20 When reloading a servlet, the previous instance is destroyed. However, the container must wait until all requests using the servlet are finished. According to the specification, a servlet container can wait for the duration of some time limit, and when this time is exceeded, can destroy the servlet, even if some requests are not complete.

To quote:

"Before the servlet container can call the destroy method, it must allow any threads that are currently running in the service method of the servlet to either complete, or exceed a server defined time limit, before the container can proceed with calling the destroy method."

This property specifies this time limit. If it is zero, then the container will wait indefinitely until all requests are completed. It is ignored if servlet reloading is not enabled (servlet.reloadingEnabled property).

servlet.propsFile <none> Specifies the location of the servlet properties file. This file contains details on how the servlets are deployed.
servlet.reloadingEnabled false Specifies that servlet reloading is enabled. Please refer to the servlet.maxTimeBeforeDestroy property. Note that this setting does not affect the Loader Servlet.
servlet.sessionTimeout 300 Specifies the default session timeout, in seconds.
servlet.tempdir <none> Specifies the directory to use for the javax.servlet.context.tempdir context attribute. This attribute will not be set if a valid directory is not valid, or if this property is not set.