List of Directives


Back

Syntax of the configuration files

The syntax of the configuration files for esehttpd is very similar to the httpd.conf files for apache. Each line of a configuration file consists of a directive and arguments for it. How arguments are interpreted is depend on the directive. White spaces(including TABs) are ignored, Lines starting with '#' are ignored.

To change configurations for a potion of the server, write directives inside a section between <VirtualHost>...</VirtualHost>, <Directory>...</Directory>, <FilesMatch>...</FilesMatch>, or <Limit>...</Limit>.

If an argument expresses a path name or a regular expression, you can quote it with "". The backslash character works as the escape inside the quotes.


Directives affects to the whole server

BindAddress ADDRESS

Specifies a specific ADDRESS to bind. If not specified, esehttpd accepts connections to all addresses on the server. You need not to use this directive if you don't need to specify an address to bind.

User NAME

Sets userid to run the server. If not specified, the user 'nobody' is used. NAME must not be the super user.

Group NAME

Sets groupid to run the server. If not specified, the group 'nobody' is used. NAME must not be the super user.

MaxFiles NUMBER

Sets the limit number of open files per process. You need to use this directive only if you want esehttpd to accept a large number of connections at a time.

StartServers NUMBER

Sets the number of worker process. If not specified, it becomes 1. Because a esehttpd process can accept many connections at a time, the value 1 would be OK in most cases. For SMP machines, specify more than 1.

ChangeRoot DIRNAME

If specified, esehttpd calls chroot() before it drops the root privileges. Note that some directives, including DocumentRoot and <Directory>, will be affected by the chroot-ing.

ListenBacklog NUMBER

Sets the length of the listen backlog queue.

SendBufferSize NUMBER

Sets the size of the TCP send buffer.

RecvBufferSize NUMBER

Sets the size of the TCP receive buffer.

FileCacheSize NUMBER

Sets the maximum number of entries in the file cache built in esehttpd. The default value is 300. If you want to increase this, you need to increase the limit number of files your OS can handle. For Linux, you need to change /proc/sys/fs/files-max.

FileCacheThreshold NUMBER

Sets the maximum size of a file to be cached. Only the files whose length is smaller or equal to NUMBER will be candidates for caching. If 0 is specified, all the files can be cached. The default value is 0.

SendCGIErrors (On|Off)

If this option is On, esehttpd sends error messages generated by CGI scripts to the client. This is useful for debugging CGI scripts. The default value is Off.

MultipleAccept (On|Off)

If this option is On, esehttpd calls accept() system call repeatedly until it fails. The default value is Off.

ForceLingeringClose (On|Off)

If On, esehttpd does lingering close for HTTP 1.0 clients also. Default is Off.

LingeringCloseLimit NUMBER

Sets the limit size of dummy reads from half-closed connections. Default is 65536.

RequestHeaderLimit NUMBER

The maximum size of request headers to accept. Default is 8192.

RequestBodyLimit NUMBER

The maximum size of request body to accept. Default is ???.

ScriptEvalMax NUMBER

When esehttpd evaluates ruby script more then NUMBER times, the worker process exits and another worker will started. This option is affective only if StartServers is more than 1.

<VirtualHost HOSTNAME>

Defines a virtual host.

Virtualhost-wise settings

To configure a virtualhost, write the following directives between <VirtualHost> and </VirtualHost>. The following directives can be written outside of <VirtualHost>...<VirtualHost> clauses, and such directives are affected to the 'default' virtualhost.

Port NUMBER

Sets the port number to listen. Possibly NUMBER should be 80 in most cases. If this directive is not specified, esehttpd does not accept HTTP connections.

ServerName HOSTNAME

Sets the host name for the virtual server. Default is localhost.

PassEnv NAME [...]

Passes environment variables to CGI scripts.

CustomLog FILENAME [LOGTYPE]

Sets the access log file. LOGTYPE must be 'common' or 'combined'. The default value for LOGTYPE is 'common'.

DocumentRoot DIRNAME

Sets the top directory corresponding to the '/' URI on the server.

TypesConfig FILENAME

Sets the 'mime.type' file.

ErrorDocumentDir DIRNAME

Sets the directory containing error messages.

TimeOut SEC

Sets the connection timeout value.

SSLPort NUMBER

Sets the port number for SSL connections. Possibly NUMBER should be 443 in most cases. If not specified, esehttpd does not accept HTTPS connections. If neither Port nor SSLPort is specified, such a virtual server does noting.

SSLCertificateFile FILENAME

Specifies the certificate file for the server. FILENAME must be in PEM format. This option must be set if you want to use SSL.

SSLCertificateKeyFile FILENAME

Specifies the private key file for the server. FILENAME must contain a RSA key in PEM format. If this option is not specified, esehttpd tries to read private key for the server from the file specified by SSLCertificateFile instead.

SSLCACertificateFile FILENAME

Specifies the certificate file for the CA used by client authentifications. That is, esehttpd accepts client certificates signed by the CA. FILENAME must be in PEM format. This directive is necessary if you want to use client authentifications.

SSLDHParamFile FILENAME

Specifies the PEM file containing a DH parameter. This directive is not mandatory if you don't want to use ciphers that require DH.

SSLCipherSuite STRING

Sets the list of ciphers to use. Type "openssl ciphers" to get the list of available ciphers.

Alias URI DIRNAME

Maps URI to the directory DIRNAME.

ScriptAlias URI DIRNAME [MODULENAME]

Maps URI to the directory DIRENAME, and uses the module MODULENAME as the default handler for the URI. If MODULENAME is omitted, cgi-script module is used.

<Directory DIRNAME>

Defines a directory section.

Directory-wise settings

To configure a directory section, write the following directives between <Directory DIRNAME> and </Directory>. These directives can be written outside of <Directory> sections, and such lines are affected to the files that don't match any <Directory> sections.

AuthUserFile FILENAME

Specifies the password file for Basic Authentication. Password files can be created by esepasswd command.

AuthName NAME

Specifies the realm for the authentication.

DirectoryIndex FILENAME [...]

Specifies the list of the index files used when the directory itself is requested. The default value is 'index.html'.

DefaultType MIMETYPE

Specifies the default MIME type.

AddType MIMETYPE SUFFIX

Sets the MIME type for files that have SUFFIX.

AddHandler MODULENAME SUFFIX

Sets the handler for files that have SUFFIX.

Options OPTION [...]

Sets some options for the directory. As of the current version of esehttpd, OPTION must be 'Indexes' or 'NoFileCache'. If 'Indexes' is specified, directory listings are allowed for the directory. If 'NoFileCache' is specified, file caching is disabled for the directory contents.

SSLVerifyClient REQUIREMENT

Sets if SSL client authentication is required or not. REQUIREMENT must be 'require' or 'none'. If REQUIREMENT is 'require', esehttpd requests the client a certificate.

SSLVerifyDepth NUMBER

Sets the maximum length for the certificate chain. The default value is 1.

<FilesMatch PATTERN>

Defines a FilesMatch section.

Filename-wise settings

To specify filename-wise options, write the following directives inside a section between <FilesMatch PATTERN> and </FilesMatch>. If a file is matched to more than one <FilesMatch sections, the first one in the configuration file is affected. The following directives can be written outside of <FilesMatch> sections, and such lines are affective to files that don't match any <FilesMatch> sections.

<Limit METHOD [...]>

Defines a Limit section.

Method-wise settings

To specify method-wise options, write the following directives inside a section between <Limit METHOD> and </Limit>. These directives can be written outside of <Limit> sections, and such lines are affective to requests that don't match any <Limit> sections.

Require user USERNAME [...]

Indicates that only the users USERNAME [...] are allowed to do the request for the URI. Esehttpd sees the password file specified by AuthUserFile directive in order to judge if the supplied password is correct.

Require valid-user

Indicate that only the users listed in the password file are allowed to do the request for the URI. Of course a request is allowed only if the specified password is correct.

Note: semantical difference of esehttpd.conf from apache's httpd.conf

When a directory-wise directive is written outside of any <Directory> sections, apache treats it as a directive affective for all the files. Esehttpd doesn't treat it as apache does, and treat it as a directive affective for the files that don't match any <Directory> sections. For <VirtualHost> and others, the same difference exists.
Back
Akira Higuchi