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 1024 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 4 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.

Note that it is recommended that the log files be stored in a ramdisk to minimize wear on the flash. Please consult the "Information about the flash" section of the FAQ in the SNAP documentation for more details.

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 and the system mailhost are both checked for the proper destination. The ipconfig command or the SNAP API can be used to set the system mailhost.
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 standard error stream.
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.contextParams <none> Specifies the ServletContext initialization parameters, formatted as a comma-separated list of name=value pairs.
servlet.propsFile <none> Specifies the location of the servlet properties file. This file contains details on how the servlets are deployed.
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.