table of contents
other versions
- wheezy 2.1-2+deb7u1
tntnet.conf(7) | Tntnet users guide | tntnet.conf(7) |
NAME¶
tntnet.conf - configuration-file for tntnet (8)DESCRIPTION¶
Tntnet is configured in the configuration-file tntnet.conf. tntnet.conf contains configuration variables with parameters. Each line in tntnet.conf is either empty, a comment starting with '#' or a variable with 0 or more parameters. The variablename and parameters are spearated by whitespace. A parameter can be surrounded by quotation-marks (")or apostrophes ('). If the parameter is marked this way, it can contain whitespace itself - even linefeeds. If the value itself needs to have the separator, the character can be prepended by backslash, which disables the special meaning of the character itself. Examples:Varname value
Defines a variable with the name Varname and the value value.
Varname2 value1 value2 "This is a value
with whitespace
and newline and quotationsmark: \""
Defines a variable with 3 parameters.
CONFIGURATION VARIABLES¶
This section describes the variables, used by Tntnet (8).AccessLog filename¶
Writes a log entry for each request in a common format. This format is compatible with most log file analyze systems for http servers. The log file has the fields:BufferSize bytes¶
Specifies the number of bytes sent in a single system-call. This does not limit anything in application-level. It does not affect e.g. savepoints or exception-handling. Component-output is collected completely and then passed in chunks of BufferSize bytes to the operating system. The default value is 16384.CompPath directory¶
CompPath specifies, where tntnet should search for webapplications. Tntnet searches first in the current directory and then in each directory, you specify here, until a library is found. You can repeat the directive as many times as desired to add more entries. If it is not found, the next MapUrl-entry is tried. ExampleChroot directory¶
Does a chroot(2)-system call on startup, which locks the process into the directory at system-level. ExampleDaemon 0|1¶
If this flag is set to 1, Tntnet forks at startup and terminates the parent-process on successful initialization.Dir directory¶
Changes the current working directory of the process on startup. ExampleEnableCompression yes|no¶
Specifies, if Tntnet should use gzip-compression at http-level. By default Tntnet use compression. A http-client like a web browser can send a header "Accept-Encoding", to tell Tntnet, that it would accept compressed data. Tntnet then can decide, if it use compression. When the body is complete, Tntnet tries to compress the body. If the data can be compressed by more than 10%, Tntnet sends this compressed data. With this flag, this feature can be turned off. Compression slows down processing but reduces the network-load. Normally the size of html-pages can be compressed by about 70%, while Tntnet slows down by up to 30%. ExampleErrorLog filename¶
Redirects stderr to the specified file when tntnet runs as a daemon. If ErrorLog is not set stderr is redirected to /dev/null.Group unix-group¶
Changes the group under which tntnet answers requests. Exampleinclude filemask¶
Reads additional settings from the specified files. Filemask might contain glob-characters, so that multiple files might be read. The order is not specified. ExampleKeepAliveTimeout milliseconds¶
Sets the timeout for keep-alive requests. Tntnet tries to do keep-alive-requests wherever possible. This has the effect, that tntnet can receive multiple requests within a single tcp-connection. The connection times out after KeepAliveTimeout milliseconds. The timeout defaults to 15000ms. ExampleKeepAliveMax number¶
Sets the maximum number of request per tcp-connection. This defaults to 100. ExampleListen ip [ port]¶
Specifies, on which address tntnet waits for connections. There can be more than one Listen-directives, in which case tntnet waits on every address. If there is no Listen-directive tntnet listens on 0.0.0.0 port 80. ip might also be a hostname. Example Listen 127.0.0.1 8000ListenRetry number¶
On startup Tntnet calls listen on the specified port. When the systemcall returns with an error, Tntnet tries again and fails after the specified number of attempts. The default number is 5. ExampleListenBacklog number¶
The system-call listen(3p) needs a parameter backlog, which specifies, how many pending connections the operating-system should queue before it starts to ignore new request. The value is configurable here. The default value is 16 ExampleMapUrl url component-identifier [ path-info { additional-arguments } ]¶
Tells tntnet, which component should be called, when it receives a http-request. url is a regular expression, which is tried against the request-url. If it matches, the component-identifier is evaluated. component-idetifier may contain backreferences to the url. By default the url is passed as path-info to the component, but this can be changed with a third parameter. Additional parameters can be passed to the component and accessed through tnt::httpRequest::getArgs(). This variable can occur more than once and they are tried in the order they are found in the configurationfile, until the regular expression matches and the component does not return tnt::DECLINED. If no MapUrl-directive is found, http-error 404 (not found) is sent. ExampleMapUrlMapCache size¶
As described in MapUrl urls are mapped to components with regular expressions. This is a quite expensive operation, while the number of different urls used in a typical web application is small. Therefore Tntnet has a simple cache, which stores mappings to prevent the need to process the same regular expression multiple times. The size of this cache is limited. After the size is exceeded the cache is simply cleared. This clearing is logged with the message "clear url-map-cache". If you have a application whit many different urls and you often see this warning-message, you might want to increase the cache. The default value is 8192. ExampleMaxRequestSize number¶
This directive limits the size of the request. After number Bytes the connection is just closed. This prevents denial-of-service-attacks through long requests. Every request is read into memory, so it must fit into it. Bear in mind, that if you use file-upload-fields a request might be larger than just a few bytes. The value defaults to 0, which means, that there is no limit at all. ExampleMaxRequestTime seconds¶
In daemon mode tntnet has a watchdog, which restarts tntnet when the maximum request time is exceeded. This happens, when a request is in a endless loop or otherwise hangs. Restarting tntnet looses all active sessions and the currently running requests. Therefore the timeout should be well long enough for the longes request.MinThreads number¶
Tntnet uses a dynamic pool of worker-threads, which wait for incoming requests. MinThreads specifies, how many worker threads there have to be. This defaults to 5. ExampleMinCompressSize number¶
Http-compression for replies smaller than this are not compressed at all. The default value for this is 1024. ExampleMaxThreads number¶
Tntnet uses a dynamic pool of worker-threads, which wait for incoming requests. MaxThreads limits the number of threads. The default is 100. ExamplePidFile filename¶
When run in daemon-mode, tntnet writes the process-id of the monitor-process to filename. When the monitor-process is deactivated, the pid of the worker-process is written. This ensures, that sending a sigkill to the the stored process-id stops tntnet. ExamplePropertyFile filename¶
This directive specifies the property-file, where logging is configured. ExampleQueueSize number¶
Tntnet has a request-queue, where new requests wait for service. This sets a maximum size of this queue, after wich new requests are not accepted. The default value is 1000. ExampleSessionTimeout seconds¶
This sets the number of seconds without requests after which a sesssion is erased. The default value is 300 seconds. ExampleSocketReadTimeout milliseconds¶
A worker-thread waits for some milliseconds on incoming data. If there is no data, the job is put into a queue and another thread waits with poll(2) on incoming data on multiple sockets. The workerthreads are freed and they can respond to other requests quickly. The default value is 10 milliseconds, which is good for normal operation. A value of 0 results in non-blocking read. If timeout is reached, this does not mean, that the socket is closed. A small timeout reduces contextswitches on slow connections. ExampleSocketWriteTimeout milliseconds¶
This defines the time, how long the workerthreads wait on write. If the timeout is exceeded, the socket is closed and the browser might not get all data. The default value is 10000 milliseconds. ExampleSslCertificate file¶
Specifies the certificate-file for ssl-connections if not specified in SslListenSslKey file¶
Specifies the certificate-key for ssl-connections if not specified in SslListenSslListen ip [ port [ ssl-certificate-file [ ssl-key-file] ] ]¶
Specifies, on which ip and port tntnet waits for incoming ssl-connections. Optionally a certificate- and key-file can be passed. ExampleThreadStartDelay ms¶
ExampleUser username¶
Changes the user under which tntnet answers requests. ExampleVMapUrl host url component-identifier [ path-info { additional-arguments } ]¶
This is like MapUrl, but is specific for the virtual host. This rule matches only if the host and the url matches against the specified values. Both are regular-expressions, so one rule can also match multiple hosts. ExampleAUTHOR¶
This manual page was written by Tommi Mäkitalo <tommi@tntnet.org>.SEE ALSO¶
tntnet(1) tntnet.properties(7).2006-08-13 | Tntnet |