Chapter 7:  Configuration Reference


Once Stronghold Web Server 3.0 is installed, it can be configured to suit your site. This chapter provides a quick reference to all configuration directives for the core Apache server, its precompiled modules, and its optional dynamically loadable modules. The directives control different aspects of server behavior including:

For each directive, this chapter gives several types of information:

Context Description

server

Server directives apply to the site in general and must appear outside containers.

host

Host directives can appear within <VirtualHost> containers or in the general proxy server configuration.

object

Object directives can appear within <Directory>, <Location>, <File>, or <Limit> containers, as well as .htaccess files. They can also appear in <VirtualHost> containers or in the general server configuration.

Although many directives can appear in more than one context, only one is given for each. The given context is the narrowest one in which the directive can appear; it can also appear in any larger context.


General Configuration

Stronghold Web Server's general configuration directives control the most fundamental aspects of the server and its virtual hosts:

Server Setup Directives

Most server setup directives are set by the installation program, but they can be changed at any time. They are not associated with any modules, but only with Stronghold's server core.

StrongholdLicenseFile

Syntax: StrongholdLicenseFile licensefileserver
Context: Server
Module: core

This sets the license file for the Stronghold Web Server 3.0 . The license file contains the license block you received via email when you downloaded or purchased the software. It looks like this:

*****BEGIN LICENSE BLOCK*****
MIIBOgIBAAJBAPkt+UzfOtml9SeKQp7vYV5DpGLiJs4lWScx9Rz5Zq7vQlMBqUBA
cqbANVQKK4SgbkqGBA6yQxEz5pYy2zTUeAECAwEAAQJAT0JOYCNJZt2hAzi5RDDE
eeVuLn3c9glvOEZtvw+dl9qmQzjLFC1cY1zi8+OeB3l9IX5YhsqcyeWBDpimmM5y
AQIhAPzX9vAx2zrztthis1is2not3a4real5license6blockHWUlMx7AOVOSJly
+lEGYXr0MI2sIzJbaJsmSjrktvcnbPECIBvT9SS4iAVz/x+Vy865lv6l4A2rdK6V
xCAabpgUAg7RAiEA7F1P+CL5Q5VYR8yRhdKD5NlWZMNREHgLL5Btp112+oECIGHw
+Ul0wkvw068K5wh+OBjC2o3P9gjv3QEyPsDY8ATh
*****END LICENSE BLOCK*****

The license block must be present in order to run the server. When using an evaluation copy of Stronghold, your license block expires when the evaluation period ends.

ServerRoot

Syntax: ServerRoot path
Context: server
Module: core

The <ServerRoot> directive sets the directory in which the server binary is installed. It should contain all subdirectories required for server operation, such as conf/ and logs/. See The Server Directory Tree for a complete list of subdirectories the server expects to find here.

DocumentRoot

Syntax: DocumentRoot directory
Context: host
Module: core
Default: /usr/local/etc/httpd/htdocs

This directive sets the directory from which Stronghold Web Server 3.0 serves files. Unless matched by a directive like Alias, the server appends the path from the requested URI to the document root to form the path of the document. For example, if DocumentRoot/user/web is specified, then an access to http://www.my_host.com/index.html refers to /user/web/index.html

ErrorDocument

Syntax: ErrorDocument filename|"errormessage"|URL
Context: object
Module: core
AllowOverride: FileInfo

ErrorDocument controls Stronghold Web Server 3.0 's responses in the event of a problem. It is followed by an HTTP server error code and one of the following:

URLs begin with a slash (/) for local URLs, or a full URL which the client can resolve. Examples:

ErrorDocument 404 /cgi-bin/bad_urls.pl
ErrorDocument 500 http://www.c2.net/cgi-bin/tester
ErrorDocument 403 "Sorry, can't allow access today"

For a complete list of error codes and their meanings, see Appendix B Server Status Codes.

Listen

Syntax: Listen [IP:]port
Context: server
Module: core

The Listen directive instructs the server to listen to one or more IP addresses or ports. The value for Listen can be an IP address or hostname and a port number, or a port number alone.

User

Syntax: User <id>
Context: server
Module: core
Default: nobody

The User directive sets the user ID as which the server will answer requests. In order to use this directive, the server must be run initially as root. <id> is one of the following:

The user should have no privileges that enable him or her to access files that are not intended to be visible to the outside world; similarly, the user should not be able to execute code that is not meant for HTTPD requests. We recommend setting up a new user and group specifically for running the server. Some administrators use "nobody," but this is not always possible or desirable.

If the server is started by a non-root user, it will fail to change to the lesser privileged user and will instead continue to run as that original user. If the server starts as root, then it is normal for the parent process to remain running as root. The parent process does not serve any requests, so this does not represent a violation of access controls using the specified user ID.

Group

Syntax: Group <id>
Context: server
Module: core
Default: nobody

The Group directive sets the group under which the server answers requests. In order to use this directive, the server must run as root initially. <id> is one of the following:

We recommend setting up a new group specifically for running the server. If the server starts as a non-root user, it will not change to the specified group and will instead run as the group of the original user.

Options

Syntax: Options option1 [option2...]
Context: object
Module: core
AllowOverride: Options

The Options directive controls which server features are available. It is useful for limiting the freedom of virtual host customers. Options can be set to one or more of the following:

Option Description

None

No options

All

All options except for MultiViews. This value is not recommended.

ExecCGI

Execution of CGI scripts is permitted.

FollowSymLinks

The server follows symbolic links in this directory.

Includes

Server-side includes are permitted.

IncludesNOEXEC

Server-side includes are permitted, but the #Include of CGI scripts are disabled. We highly recommend this option as a security measure.

Indexes

If a URL that maps to a directory is requested, and there is not DirectoryIndex (for example, index.html) in that directory, then the server will return a formatted listing of the directory.

Multiviews

Content-negotiated MultiVIews are allowed. For details about using content negotiation, See "Content Negotiation" on page 9-6.

SymLinksIfOwnerMatch

The server will only follow symbolic links for which the target file or directory is owned by the same user ID as the link.

Any option can be prepared by a plus of minus sign (+ or -) to configure exceptions to a high-level Options directive. Simply add or subtract from the default option list like this:

<Virtualhost www.manatee.org:80>
options -ExecCGI+MultiViews
</VirtualHost>

If multiple options could apply to a directory, then the most specific one is taken complete, the options are not merged. For example:

<Directory /web/docs>
Options Index FollowSymLinks
lt;/Directory>
<Directory /web/docs/spec>
Options Includes
</Directory>

In this example, only "Includes" is set for the /web/docs/spec directory. The "Indexes" and "FollowSymLinks" options are set for all other subdirectories of /web/docs.

ServerAdmin

Syntax: ServerAdmin email-address
Context: host
Module: core

The ServerAdmin directive sets the email address of this host's administrator. The server uses it to notify the administrator when the host's certificate is about to expire.

It may be worth setting up a separate address for this, for example,
ServerAdmin webmaster@foo.bar.com as users do not always mention that they are talking about the server.

Include

Syntax: Include filename
Context: object
Module: core

This directive includes another configuration file, specified by a filename. The contents of the file are parsed at the current point in httpd.conf.

ServerSignature

Syntax: ServerSignature off|on|email
Context: object
Module: core
Default: ServerSignature Off

The ServerSignature directive configures a trailing footer line under server-generated documents such as error messages, mod_proxy FTP directory listings, mod_info output, and so on. This is useful in a chain of proxies where the user often cannot tell which of the chained servers actually produced a returned error message.

Virtual Hosts

Virtual host directives control basic, host-specific attributes of virtual hosts. For a broader discussion of virtual host configuration, see "Configuring Virtual Hosts" on page 6-10

ServerName

Syntax: ServerName hostname
Context: host
Module: core

The ServerName directive sets the hostname of a host. This directive is only used for name-based virtual hosts and creating redirection URLs. The main server and all virtual hosts must each have the ServerName directive. If it is omitted, then the server attempts to deduce it from its own IP address. However, this may not always return the preferred hostname. For example, ServerName www.foo.com might be used even if the canonical name of the server platform were monster.foo.com.

NameVirtualHost

Syntax: NameVirtualHost IP[:port]
Context: server
Module: core

The NameVirtualHost directive is required for all name-based virtual hosts but is set at the global level (in other words, outside all <VirtualHost> containers). It specifies the IP address to which the hostname of the name-based virtual host resolves. Repeat this directive for each name-based host on each address.

Although IP can be a hostname, an IP address is recommended, such as:

NameVirtualHost 111.22.33.44

Optionally, specify a port number on which the name-based virtual host should be used, like this:

NameVirtualHost 111.22.33.44:8080

The main server and any "_default_" servers are never served for a request to a NameVirtualHost IP address (unless for some reason you specify NameVirtualHost but don't define any virtual hosts for that address).

For more information about configuring name-based virtual hosts, see "Name-Based Virtual Hosts" on page 6-14.

ServerAlias

Syntax: ServerAlias host1 [host2 ...]
Context: host
Module: Module

The ServerAlias directive sets alternate names for a host, for use with name-based virtual hosts. Each host can be a full hostname or a wildcard string.

UseCanonicalName

Syntax: UseCanonicalName on|off
Context: object
Module: core
AllowOverride: AuthConfig

In many situations, the server must construct self-referential URLs. A self-referential URL refers back to the host itself. When UseCanonicalName is set to "on," Stronghold uses the ServerName and Port directives to construct a canonical name for the server. When UseCanonicalName is set to "off" Stronghold forms self-referential URLs using the hostname and port supplied by the client. If none is supplied by the client, it uses the canonical name. This name is used in all self-referential URLs, and for the values of SERVER_NAME and SERVER_PORT in CGIs.


The client is free to give any value as a hostname. This should not be a problem if the CGI is only using SERVER_NAME to construct self-referential URL's

ServerPath

Syntax: ServerPath path
Context: host
Module: core

The ServerPath directive sets the legacy URL pathname for a host, for use with name-based virtual hosts.

SSL Setup

These directives are required to enable SSL functionality for any host on the server. When SSL is enabled, server authentication is required but client authentication is not. See "Server Authentication" on page 7-94 for the required server authentication directives.

SSLEngine

Syntax: SSLEngine on/off
Context: server config, virtual host
Module: mod_ssl
Default: SSLEngine off
Compatibility: SSLEngine supersedes SSLFlag, see Compatibility Directives on page 7-115

This directive toggles the usage of the SSL/TLS Protocol Engine. This is usually used inside a <VirtualHost> section to enable SSL/TLS for a particular virtual host. By default the SSL/TLS Protocol Engine is disabled for both the main server and all configured virtual hosts.

Example:

<VirtualHost _default_:443>
SSLEngine on
...
</VirtualHost>

SSLPrototcol

Syntax: SSLProtocol (+-)protocol...
Context: server config, virtual host
Module: mod_ssl
Default: SSLprotocol all
AllowOverride: Options

This directive can be used to control the SSL protocol flavors Stronghold should use when establishing its server environment. Clients then can only connect with one of the provided protocols.

The available (case-insensitive) protocols are:

Example:

SSLRoot

Syntax: SSLRoot path
Context: host
Module: mod_ssl

SSLRoot is the root directory for SSL files such as keys and certificates. SSL file directives (except logging directives) can be relative to SSLRoot.

SSLMutex

Syntax: SSLMutex type
Context: server config
Module: mod_ssl
Default: SSLMutex none

SSLMutex supersedes SSLSessionLockFile see Compatibility Directives on page 7-115

This configures the SSL engine's semaphore (aka. lock) which is used for mutual exclusion of operations which have to be done in a synchronized way between the pre-forked Apache server processes. This directive can only be used in the global server context because it's only useful to have one global mutex. The following Mutex types are available:

SSLPassPhraseDialog

Syntax: SSLPassPhraseDialog type
Context: server Config
Module: mod_ssl
Default: SSLPassPhraseDialog bulitin

When Stronghold starts up it has to read the various Certificate (see SSLCertificateFile) and Private Key (see SSLCertificateKeyFile) files of the SSL-enabled virtual servers. Because for security reasons the Private Key files are usually encrypted, Stronghold needs to query the administrator for a passphrase in order to decrypt those files. This query can be done in two ways which can be configured by type:

Anything else has to be left as an exercise to the administrator, because local security requirements are so different. The reuse-algorithm above is used here, too. In other words: The external program is called only once per unique passphrase.

Example:

SSLPassPhraseDialog exec:/usr/local/apache/sbin/pp-filter

SSLRandomSeed

Syntax: SSLRandomSeed Context source [bytes]

Context: server config
Module: mod_ssl
Default: none

This configures one or more sources for seeding the Pseudo Random Number Generator (PRNG) in OpenSSL at startup time (context is startup) and/or just before a new SSL connection is established (context is connect). This directive can only be used in the global server context because the PRNG is a global facility.

The following source variants are available:

SSLSessionCache

Syntax: SSLSessionCache type
Context: server config
Module: mod_ssl
Default: SSLSessionCache none

This configures the storage type of the global/inter-process SSL session cache. This cache is an optional facility which speeds up parallel request processing. For requests to the same server process (via HTTP keep-alive), OpenSSL already caches the SSL session information locally. Because modern clients request inlined images and other data via parallel requests (usually up to four parallel requests are common) those requests are served by different pre-forked server processes. Here an inter-process cache helps to avoid unneccessary session handshakes.

The following two storage types are currently supported:

SSLSessionCacheTimeout

Syntax: SSLSessionCacheTimeout Seconds
Context: server config
Module: mod_ssl
Default: SSLSessionCache 300

This directive sets the timeout in seconds for the information stored in the global/inter-process SSL session cache and the OpenSSL internal memory cache. It can be set as low as 15 for testing, but should be set to higher values like 300 in real life.

Example:

SSLSessionCacheTimeout 600

SSLOptions

Syntax: SSLOptions (+-) option...
Context: server config, virtual host, directory, .htaccess
Module: mod_ssl
Default: none

AllowOverride: Options

This directive can be used to control various run-time options on a per-directory basis. Normally, if multiple SSLOptions could apply to a directory, then the most specific one is taken completely; the options are not merged. However if all the options on the SSLOptions directive are preceded by a plus (+) or minus (-) symbol, the options are merged. Any options preceded by a "+" are added to the options currently in force, and any options preceded by a "-" are removed from the options currently in force.

The available options are:

SSLCARevocationPath

Syntax: SSLCARevocationPath Directory
Context: server config, virtual host
Module: mod_ssl
Default: none

This directive sets the directory where you keep the Certificate Revocation Lists (CRL) of Certification Authorities (CAs) whose clients you deal with. These are used to revoke the client certificate on Client Authentication. The files in this directory have to be PEM-encoded and are accessed through hash filenames. Usually you have not only to place the CRL files there. Additionally you have to create symbolic links named hash-value.rN. And you should always make sure this directory contains the appropriate symbolic links. Use the Makefile which comes with mod_ssl to accomplish this task.

Example:

SSLCARevocationPath /usr/local/apache/conf/ssl.crl/

SSLCARevocationFile

Syntax: SSLCARevocationFile filename
Context: server config, virtual host
Module: mod_ssl
Default: none

This directive sets the all-in-one file where you can assemble the Certificate Revocation Lists (CRL) of Certification Authorities (CA) whose clients you deal with. These are used for Client Authentication. Such a file is simply the concatenation of the various PEM-encoded CRL files, in order of preference.

This can be used alternatively and/or additionally to SSLCARevocationPath.

Example:

SSLCARevocationFile /usr/local/apache/conf/ssl.crl/ca-bundle-client.crl

SSLCertificatePath

Syntax: SSLCertificatePath directory
Context: server config, virtual host
Module: mod_ssl
Default: none

This directive sets the directory where you keep the Certificates of Certification Authorities (CAs) whose clients you deal with. These are used to verify the client certificate on Client Authentication. The files in this directory have to be PEM-encoded and are accessed through hash filenames. So usually you can't just place the Certificate files there: you also have to create symbolic links named hash-value.N. And you should always make sure this directory contains the appropriate symbolic links.Use the Makefile which comes with mod_ssl to accomplish this task.

Example:

SSLCACertificatePath /usr/local/apache/conf/ssl.crt/


Additional Features

Environment Variables

Environment variables are system parameters that Stronghold's CGI module uses. These directives specify the environment variables that Stronghold automatically passes to the CGI module, including browser-dependent variables.

PassEnv

Syntax: PassEnv variable1,[variable2...]
Context: object
Module: mod_env
PassEnv specifies one or more environment variables that are passed from the shell environment to the CGI environment.

SetEnv

Syntax: SetEnv variable value
Context: object
Module: mod_env

With SetEnv, you can explicitly set a CGI environment variable. For example

SetEnv LIBDIR /www/lib

SetEnvIf

Syntax: SetEnvIf attribute regex envar[=value] [...]
Context: server
Module: mod_setenvif

The SetEnvIf directive defines environment variables based on attributes on the request. THese attributes can be the values of various HTTp request header fields or other aspects of the request, including the following:

HTTP Header Description

REMOTE_HOST

the hostname of the client making the request, if available

REMOTE_ADDR

the IP address of the client making the request

REMOTE_USER

the authenticated username, if available

REQUEST_METHOD

the name of the method being used, such as GET or POST

Request_URL

the portion of the URL following the scheme and host

Some of the more commonly used request header field names include Host, User-Agent, and Referer.

For example:

SetEnvIf Request_URL "\.(gif)|(jpg)|(xbm)$" object_is_image
SetENvIf Referer www\.mydomainin\.com intra_site_referral

The first example sets the environment variable object_is_image if the requested file is an image file. The second example sets intra_site_referral if the referring page is somewhere on the www.mydomain.com site.

SetEnvIfNoCase

Syntax: SetEnvIfNoCase attribute regex envar[=value] [...]
Context: server
Module: mod_setenvif

SetEnvIfNoCase is semiautomatically identical to the SetEnvIf directive, except that the regular expression matching is cas-sensitive. or example:

SetEnvIfNoCase Host Apache\.org site=apache.

This causes the site environment variable to be set to "apache" if the Host HTTP header was included and contained Apache.Org. apache.org, or any other variation.

UnSetEnv

Syntax: UnSetEnv variable
Context: object
Module: mod_env

UnSetEnv excludes variables from being set or passed. For example, if PassEnv and SetEnv are set for the root document directory, but a subdirectory cannot use the given variables, you can use UnSetEnv to exempt the subdirectory from those variable settings.

BrowseMatch

Syntax: BrowserMatch regex var1 [var2...]
Context: server
Module: mod_browser

The server configuration can include one or more BrowserMatch directives, which define environment variables based on the User-Agent HTTP header in client requests. Stronghold reads multiple BrowserMatch entries in the order in which they appear in httd.conf. regex is a POSIX.2 regular expression that denotes a User-Agent string match. If a User-Agent string matches more than one BrowserMatch argument, Stronghold merges the arguments, regex is followed by one or more variable strings that can take the following forms:

Variable String Description`

variable

The name of an environment variable to be used with a matching client request. The default value for a named variable is 1.

!variable

The name of an environment variable to be excluded from any matching client request.

variable=value

Defines the value of an environment variable for any matching client request.

For example, BrowserMatch is included in the default configuration to disable Keepalive support for Netscape 2.x browsers, which have problems related to keepalive:

BrowserMatch Mozilla/2 nokeepalive

BrowserMatchNoCase

Syntax: BrowserMatchNoCase regex var1 [var2...]
Context: server
Module: mod_browser

BrowserMatchNoCase is identical to BrowseMatch above, except that its argument are case-insensitive.


Custom Log Formats

When mod_ssl is built into Apache or at least loaded (under DSO situation) additional functions exist for the Custom Log Format of mod_log_config. First there is an additional "%{varname}x" extension format function which can be used to expand any variables provided by any module, especially those provided by mod_ssl.

For backward compatibility there is additionally a special "%{name}c" cryptography format function provided.

Example:

CustomLog logs/ssl_request_log \
"%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b".


The lock file must be stored locally. If the logs/ directory is on an NFS-mounted file system, set
SSLSessionLockFile to point to a local file.


.htaccess Configuration

Although the httpd.conf file can control all aspects of the server, some directives can also be used in per-directory configuration files, usually called.htaccess files. This configuration can be useful if directories moved frequently, or to give users some control over Web files in their own directories. Any directory that contains files accessed by the server can also contain a htaccess file.

Per-directive configuration files are enabled only when

This feature can be enabled globally or on a per-virtual-host basis. In this chapter the directives that are valid in the per-directory configuration files are listed with an "AllowOverride" field. This field gives the AllowOverride value that enables the use of the directive in per-directory configuration files. Directives that are listed with not "AllowOverride" field are never valid in per-directory configuration files.

AccessFileName

Syntax: AccessFileName filename1 [fielname2...]
Context: host
Module: core
Default: .htaccess

When this directive is set, the server looks for one or more specified filenames (usually .htaccess) in every directory of the path to a requested document. For example, a request for /usr/local/web/index.html causes Stronghold to look for
/.htaccess, /usr/.htaccess, /usr/local/.htaccess, and
/usr/local/web/.htaccess, unless per-directory configuration files have been disabled with

AllowOverride None

AllowOverride

Syntax: AllowOverride override....
Context: Directory and Location only
Module: core
Default: All

When the server finds a .htaccess file (as specified by Access Filename), it needs to know which of its directives can override the main configuration file.

AllowOverride can be set to one or more of the following:

Option Description

AuthConfig

Allow use of the access authorization directives:

AuthDBMGrouFile, AuthDBMUserFIle, AuthGroupFIle, AuthName, AuthType, AUthUserFile and require.

FIleInfo

Allow use of document-type directives:AddEncoding, AddLanguage, AddType, DefaultType and LanguagePriority, and all PHP directives, PHP directives are listed in PHP/FI 3.0 Embedded Scripting on page 7-82

Indexes

Allow use of the directives controlling directory indexing: AddDescription, AddIcon, DefaultIcon, DirectoryIndex, FancyIndexing, HeaderName, IndexIgnore, IndexOptions, and ReadmeName.

Limit

Allow use of the host-based access directives: allow, deny and ReadmeName.

Options

Allow use of the directives controlling specific directory features: Options and XBitHack

The directives in "Perl Scripting" are valid in .htaccess files if AllowOverride is set to any value except "none."

Environment Variables

Environment variables are system parameters that Stronghold's CGI module uses. These directives manipulate the environment variables that Stronghold automatically passes to external programs, including browser-dependent variables.

PassEnv

Syntax: PassEnv variable1 [variable2...]
Context: object
Module: mod_env

PassEnv specifies one or more environment variables that are passes from the shell environment to the CGI environment.

SetEnv

Syntax: SetEnv variable value
Context: object
Module: mod_env

SetEnv explicitly sets a CGI environment variable. For example:

SetEnv LIBDir /www/Lib

SetEnvIf

Syntax: SetEnvIf attribute regex envar[=value] [...]
Context: server
Module: mod_setenvif

The SetEnvIf directive defines environment variables based on attributes of the request. These attributes can be the values of HTTP request header fields or environment variables. For example:

SetEnvIf Request_URI "\.(gif)|(jpg)|(xbm)$" object_is_image
SetEnvIf Referer www\.mydomain\.com intra_site_referral

The first example sets the environment variable Request_URL if the requested file is an image file. The second example sets Referer if the referring page is somewhere on the www.mydomain.com site.

SetEnvIfNoCase

Syntax: SetEnvIfNoCase attribute regex envar[=value] [...]
Context: server
Module: mod_setenvif
SetEnvIfNoCase is semantically identical to the SetEnvIf directive, except that the regular expression matching is case-insensitive. For example:

SetEnvIfNoCase Host C2\.Net site=c2

This causes the site environment variable to be set to "c2" if the Host HTTP header was included and contained C2.Net, c2.net, or any other variation.

UnSetEnv

Syntax: UnSetEnv variable
Context: object
Module: mod_env

UnSetEnv excludes variables from being set or password. For example, if OassEnv and SetEnv are set for the root directory cannot use the given variables, use UnSetEnv to exempt the subdirectory from those variable settings.

BrowserMatch

Syntax: Browsermatch regex var1 [var2...]
Context: server
Module: mod_browser

The BrowserMatch directive defines environment variables based on the User-Agent request header. Stronghold reads multiple BrowserMatch entries in the order in which they appear in httpd.conf. Regex is a POSIX2 regular expression that denotes a User-Agent string match. If a User-Agent string matches more than one BreowserMatch argument, Stronghold merges the arguments. Regex is followed by one or more variable strings that can take the following forms:

BrowserMatch is included in the default configuration to disable KeepAlive support for Netscape 2 x browsers, which have KeepAlive problems:

Browsermatch Mozilla/2 nokeepalive

BrowserMatchNoCase

Syntax: BrowserMatchNoCase regex var1 [var2...]
Context: server
Module: mod_browser

BrowsermatchNoCase is dientical to BrowserMatch, except that its argument are case-insensitive.


Performance Tuning

Stronghold's flexible design accommodates a wide variety of hardware configurations and traffic loads. Use the directives in this section to optimize Stronghold for your unique platform and site:

Basic Performance Tuning

These directives control the basic functions that affect Stronghold's performance.

StrongholdAccelerator

Syntax: StrongholdAccelerator accelerator type
Context: server
Module: mod_ssl
Default: none

Stronghold Accelerator indicates whether the server platform has an installed ecnryption accelerator. By default, it is set to "none."

For more information about cryptographic hardware contact C2Net

ServerType

Syntax: ;ServerType type
Context: server
Module: core
Default: standalone

The ServerType directive sets how the server is executed by the system. Type is one of the following:

CoreDumpDirectory

Syntax: CoreDumpDirectory directory
Context: server
Module: core
Default: ServerRoot

This sets the directory to which Stronghold attempts to switch before dumping a core. The default is the <ServerRoot> directory. However, since this directory should not be writeable by the user the server runs as, core dumps normally do not get written. To obtain a core dump for debugging, temporarily set this directive to place it in a writeable location.

SendBufferSize

Syntax: SendBufferSize n
Context: server
Module: core

SendBufferSize sets the TCP buffer size. Use it to optimize Stronghold for high-bandwidth, high-latency file transfers such as trans- or intercontinental transfers.

TimeOut

Syntax: TimeOut n
Context: server
Module: core
Default: 1200

The TimeOut directive sets the maximum time, in seconds, that the server will wait for the client to acknowledge receipt of the last server response. If it takes more than n seconds for a client to receive and acknowledge the response, the server breaks off the connection. On slow networks, increasing the TimeOut value may help.

Keepalive

Normally every HTTP request and response uses a separate connection. This can slow server response time, because the server must open and close a connection each time it receives a request or sends a response. To improve transaction speed, use Stronghold's keepalive feature to reserve an open connection for a series of requests and responses. These directives set the parameters of keepalive functionality.

KeepAlive

Syntax: KeepAlive on|off
Context: server
Module: core
Default: off

This directive enables and disables persistent connections.

KeepAliveTimeout

Syntax: KeepAliveTimeout seconds
Context: server
Module: core
Default: 15

This sets the number of seconds Stronghold will wait for a subsequent request before closing the connection.

MaxKeepAliveRequests

Syntax: MaxKeepAliveRequest n
Context: server
Module: core
Default: 100

This directive sets the maximum number of requests that Stronghold fulfills during any single keepalive connection. The default is 100.

If MaxKeepAliveRequests, MaxKeepAliveTimeout, and TimeOut are all set, then Stronghold terminates the keepalive connection when any of those conditions are fulfilled.

Process Control

Process control refers to control of the HTTPD parent process and the child processes it spawns. These directives limit the number and lifespan of server processes.

ListenBacklog

Syntax: ListenBacklog n
Context: server
Module: core
Default: 511

This sets the maximum length of the queue of pending requests. Generally, no tuning is needed. However, on some systems it is desirable to increase this when under a TCP SYN flood attack. See the backlog parameter to the listen(2) system call.

LockFile

Syntax: Lockfile filename
Context: server
Module: core
Default: logs/accept.lock

The LockFile directive sets the path to the lockfile used when the server is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or USE_FLOCK_SERIALIZED_ACCEPT. This directive can normally be left at its default value. It should be changed if the logs/ directory is NFS-mounted, since the lockfile must be stored on a local disk. The PID of the main server process is automatically appended to the filename.


Avoid putting this file in a world-write able directory such as /var/tmp. Someone could create a denial-of-service attack by creating a lockfile with the same name as the one the server tries to create. The server cannot start under such an attack.

See also SSLSessionLockFile on page 7-115.

MaxClients

Syntax: MaxClients n
Context: server
Module: core
Default: 150

The MaxClients directive sets the limit on the number of simultaneous requests that can be served. This is the maximum number of child server processes created on startup. It should never be set to a value less than 2.

A hard limit of 256 simultaneous requests is set in the <ServerRoot>/src/httpd.h.If necessary, edit this file and recompile the server with a different hard limit. See "Recompiling Stronghold" on page 8-6 for instructions on recompiling Stronghold.

MaxRequestsPerChild

Syntax: MaxRequestsPerChild n
Context: server
Module: core
Default: 0

The MaxRequestsPerChild directive sets the limit on the number of requests that each child process serves. After serving n requests, the child process dies. If MaxRequestsPerChild is 0, then children never expire.

Setting MaxRequestsPerChild to a non-zero limit has two beneficial effects:

MaxSpareServers

Syntax: MaxSpareServers n
Context: server
Module: core
Default: 10

The MaxSpareServers directive sets the maximum number of idle child processes. An idle process is one which is not handling a request. If there are more than n MaxSpareServers idle, then the parent process kills the excess children.

This parameter should need tuning only on very busy sites. Setting this parameter to a number larger than necessary is almost always a bad idea.

MinSpareServers

Syntax: MinSpareServers n
Context: server
Module: core
Default: 5

The MinSpareServers directive sets the minimum number of idle child server processes. An idle process is one which is not handling a request. If there are fewer than n MinSpareServers idle, then the parent process creates new children at a maximum rate of one per second.

This parameter should need tuning only on very busy sites. Setting this parameter to a number larger than necessary is almost always a bad idea.

StartServers

Syntax: StartServers n
Context: server
Module: core
Default: 5

The StartServers directive sets the number of child processes initially created on startup. As the number of processes is dynamically controlled depending on the load, there is usually little reason to adjust this parameter.

Resources

These directives determine how Stronghold uses system resources. If the maximum resource limit for any of these directives is set to a value higher than that already permitted by the operating system, Stronghold must start as root.

RLimitCPU

Syntax: RLimitCPU n|max [n|max]
Context: host
Module: core

RLimitCPU sets the CPU resource limit for all server processes. It can have one or two values, and the values are either n or "max," where

Whether this directive is given one value or two, the first value is always the soft resource limit. If there are two values, the second is the hard resource limit.

RLimitMEM

Syntax: RLimitMEM n|max [n|max]
Context: host
Module: core

RLimitMEM sets the memory resource limit for all server processes. It can have one or two values, and the values are either n or "max," where

Whether you give this directive one value or two, the first value is always the soft resource limit. If there are two values, the second is the hard resource limit.

RLimitNPROC

Syntax: RLimitPROC n|max [n|max]
Context: host
Module: core

RLimitNPROC sets the maximum number of processes per user. For example, use this directive to control the number of simultaneous CGI processes allowed per individual user. It can have one or two values, and the values are either n or "max," where


If CGI processes run under the same user ID as Stronghold, this directive sets the maximum number of processes Stronghold itself is allowed to create. If the limit is too low, the error log
manifests the problem with "Cannot fork" messages.

Dynamic Shared Objects

The dynamic shared object module, mod_so, enables the server to load shared object code, including shared object modules, at startup. These directives designate the shared object code to be loaded at startup

LoadModule

Syntax: LoadModule Module filename.
Context: server
Module: mod_so
The LoadModule directive links the object file or library filename and adds the module structure named module to the list of active modules. Module is the name of the external variable of type module in the file. For example:

LoadModule status_module src/modules/ mod_status loads the status module from the src/modules sub directory of <ServerRoot>.

LoadFile

Syntax: LoadFile filename1 [filename2...]
Context: server
Module: mod_so
The LoadFile directive links one or more object files of libraries when the server starts or restarts. It can be used to load auxiliary code which may be required for a module to work. Filename is either an absolute path or relative to <ServerRoot>.

Dynamic Module Linking

By default, all modules compiled into Stronghold are active, meaning that they all start with the server and can be used at any time thereafter. With dynamic modules, compiled-in modules can be activated or deactivated without Recompiling Stronghold, by modifying httpd.conf and restarting Stronghold. This makes it quick and easy to optimize the server by suspending unnecessary modules.

ClearModuleList

Syntax: ClearModuleList
Context: server
Module: core
This directive "clears" the list of active modules and enables dynamic module linking. It is required in order to use its counterpart, AddModule.

AddModule

Syntax: AddModule 1[module2...]
Context: server
Module: core

When ClearModuleList is set AddModule sets the list of active modules. The values must be module names as they appear in the Configuration file, and they must already be compiled into Stronghold. For example,

AddModule mod_cgi.c mod_ssl.c mod_dir.c mod_userdir.c mod_alias.c

limits the active modules to CGI, SSl, directory indexing, user directories, and aliasing. Although other modules may be compiled into the server, only these five modules can be invoked under this configuration.

Whenever a module is added or removed from the AddModule list, Stronghold must restart to implement the changes. For instructions on restarting the server, see "Restarting Stronghold" on page 1-3


Proxy Service and Caching

Stronghold can act as a proxy server using mod_proxy. The proxy module is described i more detail in Chapter 4, "Proxy Service."

ProxyRequests

Syntax: ProxyRequests On|Off
Context: host
Module: mod_proxy

ProxyRequests enables normal caching proxy service. For example, add this directive to use Stronghold as a firewall that serves documents from remote hosts to users on your LAN.

ProxyRemote

Syntax: ProxyRemote match http://hostname:port
Context: host
Module: mod_proxy

This directive defines remote proxies to the Stronghold proxy server. Match is one of the following:

For example:

ProxyRemote ftp http://ftpproxy.mydomain.com:8080
ProxyRemote http://goodguys.com/ http://mirrorguys.com:8000
ProxyRemote * http://cleversite.com

See "Proxying to Other Proxies" on page 4-8 for more information about ProxyRemote.

ProxyPass

Syntax: ProxyPass path URL
Context: host
Module: mod_proxy

This directive allows remote servers to be mapped into the space of the local server; the local server does not act as a proxy in the conventional sense, but appears to be a mirror of the remote server. Path is the name of a local virtual path; URL is a partial URL for the remote server. Suppose the local server has address http://wibble.org In that case,

ProxyPass /mirror/foo http://foo.com

causes a local request for the http://wibble.org/mirror/foo/bar to be internally converted into a proxy request to http://foo.com/bar

ProxyRequests and the cache directives are included in the default configuration file, commented out. To use their default values, simply uncomment them. They can be modified to suit any configuration. See ProxyPassReverse

ProxyPassReverse

Syntax: ProxyPassReverse path URL
Context: host
Module: mod_proxy

This directive causes Stronghold to adjust the URL in the Location header in HTTP redirect responses. When Stronghold is used as a reverse proxy, this is essential to prevent servers behind the proxy from bypassing it with HTTP redirects.

For example, suppose the local server has the address http://wibble.org/ and includes the following configuration:

ProxyPass /mirror/foo http://foo.com
ProxyPassReverse /mirror/foo http://foo.com

In this example, ProxyPass causes a local request for the
http://wibble.org/mirror/foo/bar to be internally converted into a proxy request to http://foo.com/bar. If the server foo.com redirects http://foo.com/bar to http://foo.com/quux, the ProxyPassReverse directive causes Stronghold to adjust this to http://wibble.org/mirror/foo/quux before forwarding the HTTP redirect response to the client.


Note that this directive can also by used in conjunction with mod_rewrite
because it does not depend on a
corresponding ProxyPass directive.

ProxyBlock

Syntax: ProxyBlock word1|host1|domain1 [word2|host2|domain2] ...
Context: host
Module: mod_proxy
The ProxyBlock directive specifies a list of words, hosts, or domains, separated by spaces. The proxy server blocks requests that match words, hosts, or domains in the list. The proxy module also attempts to determine IP addresses of list items, then caches them for future reference. For example:

ProxyBlock garage.com host.co.uk rocky.wotsamattau.edu

Note that "wotsamattau" would also be sufficient to match "wotsamattau.edu." Note also that setting ProxyBlock to "*" blocks connections to all sites.

NoProxy

Syntax: NoProxy domain|subnet|IP|hostname [domain|subnet|IP|hostname...]
Context: host
Module: mod_proxy

The NoProxy directive specifies a space-separated list of domain, subnets, IP addresses, and/or hosts. A request to a host which matches one or more of these is always served directly, without forwarding to the configured ProxyRemote proxy servers. For example, it is useful for preventing a proxy on an intranet from proxying requests to internal hosts:

ProxyRemote * http://firewall.mycompany.com:81
NoProxy .mycompany.com 192.168.112.0/21

The arguments can take several different forms:

In many situations, it is more effective to specify an IP address in place of a hostname, to avoid a time-consuming DNS lookup.

ProxyDomain

Syntax: ProxyDomain domain
Context: host
Module: mod_proxy
The ProxyDomain directive specifies the default domain which the proxy server belongs to. It is useful for proxy servers within intranets. A request for a host without a domain name is redirected to that same host, with the specified domain appended. For example:

ProxyRemote * http://firewall.mycompany.com:81
NoProxy .mycompany.com 192.168.112.0/21
ProxyDomain .mycompany.com

In this example, a request for the host www is redirected to www.mycompany.com

ProxyReceiveBufferSize

Syntax: ProxyReceiveBufferSize n
Context: host
Module: mod_proxy

The ProxyReceiveBufferSize directive sets the buffer size for outgoing HTTP and FTP transactions, in bytes. N must be greater than 512 bytes, or it can be set to 0 to inherit the system's default buffer size.

ProxyVia

Syntax: ProxyVia on|off|full|block
Context: host
Module: mod_proxy

HTTP 1.1 requires that proxy servers use the Via HTTP header to record the protocols and proxy hosts used between the client and the server. The ProxyVia directive controls how Stronghold treats Via headers when performing proxy transactions. Its valid values are as follows:

Value Description

on

A Via header for the current proxy host is added to each request and response.

off

No special processing is performed. If a client request or a remote server response contains a Via header, it is passed through unchanged.

full

Each generated Via header includes additional server version information in the form of a Via comment field.

block

Via header lines are stripped from each proxy request and response. No new Via header is generated (not recommended).

AllowCONNECT

Syntax: AllowCONNECT port1 [port2...]
Context: host
Module: mod_proxy

CONNECT is a generic protocol used to encapsulate SSL/TLS transactions during normal proxy service (enabled with ProxyRequests). Normally, Stronghold allows transactions using the CONNECT protocol only on ports 443 and 563. AllowCONNECT sets one or more other ports on which CONNECT is allowed.

CacheRoot

Syntax: CacheRoot directory
Context: host
Module: mod_proxy

This directive enables disk caching for proxy requests. <Directory> is the directory in which cached files are stored.


This directive must be accompanied by the other cache directives listed in this section.

CacheDirLength

Syntax: CacheDirLength n
Context: host
Module: mod_proxy

For faster retrieval, Stronghold caches files by hashing their URLs, then using the beginning of each hash as a subdirectory path within the CacheRoot directory. The remainder of the hash forms the filename. CacheDirLength sets the number of characters in each subdirectory name. The default is 1.

CacheDirLevels

Syntax: CacheDirLevels n
Context: host
Module: mod_proxy

This sets the maximum number of levels of subdirectories within the CacheRoot directory.

CacheSize

Syntax: CacheSize megabytes
Context: host
Module: mod_proxy

This directive sets the size of the disk cache in megabytes.

CacheGcInterval

Syntax: CacheGcInterval hours
Context: host
Module: mod_proxy

This directive sets the garbage collection interval, in hours. At each interval, Stronghold checks the cache for expired files and deletes them.

CacheMaxExpire

Syntax: CacheMaxExpire hours
Context: host
Module: mod_proxy

CacheMaxExpire sets the maximum expiration time for all cached files, in hours. This setting overrides any expiry time that may be set for individual cached files.

CacheLastModifiedFactor

Syntax: CacheLastModifiedFactor multiplier
Context: host
Module: mod_proxy

When it reaches a garbage collection interval, Stronghold compares two numbers:

The lesser of these two numbers is the value used to determine whether it is time to delete a given file from the cache. Multiplier is a floating point multiplier.

CacheDefaultExpire

Syntax: CacheDefaultExpire hours
Context: host
Module: mod_proxy

If Stronghold does not have information about when a cached file was last modified, it uses the value set by CacheDefaultExpire.

CacheForceCompletion

Syntax: CacheForceCompletion n
Context: host
Module: mod_proxy

If a client cancels a proxy transaction before the transaction is complete, Stronghold finishes caching the requested file if n percent is already downloaded.

NoCache

Syntax: NoCache hostname1 [hostname2 ...]
Context: host
Module: mod_proxy

This sets one or more server hosts whose responses are excluded from caching. Use this directive to prevent Stronghold from caching documents that it receives from local servers.


Logging

Stronghold uses a set of log files to record its activities, including transactions, errors, and SSL ciphers:

For more detailed information about logs, see Chapter 1 "Using Logs and Reports".

General Logs

These logs record data about non-SSL transactions.

TransferLog

Syntax: TransferLog filename
Context: host
Module: mod_log_config

This sets the path to the access log file. This is Stronghold's main log, where all normal, unsecured transactions are recorded. If this directive is not present, no log is written. If the filename does not begin with a slash (/), then it is assumed to be relative to the <ServerRoot>. If TransferLog is not accompanied by LogFormat, it follows the common log format. The default log has the following format:

LogFormat "%h %u %l %t \"%r\" %>s %b"

For a sample transfer log, see Chapter 1, "Access Logs.".

LogFormat

Syntax: LogFormat "string" [nickname]
Context: host
Module: mod_log_config

This sets a customized format for the transfer log file. It can also be used to associate a log format with a format nickname, which can be used with the CustomLog directive or other instances of LogFormat instead of a full format string.

The LogFormat values can also be used with the CustomLog directive, which establishes a separate, customized log file. String can include literal characters to copy into the log files, plus any of these variables, denoted by a percent sign

Variable Description

%a

remote IP address

%b

bytes sent in the body of the response

%f

filename of the requested file

%h

remote hostname, or "-" if the remote IP address does not resolve to a <hostname>

%l

remote log name (from identd, if supplied)

%p

the port that received the request

%P

the process ID of the child process that handled the request

%r

the first line of the request

%s

the server status code returned in the response

For internally redirected requests, this is status of the original request. Use "%>s" for the final status.

%t

the time, in the common log format time format

%T

the time elapsed between receipt of the client request and transmission of the server response

%u

the remote username, if supplied by mod_auth

The value may be invalid if the server status code is 401.

%U

the requested URL

%v

the hostname to which the request was directed

%{cipher}c

the cipher used, if this is a secure transaction

%{errcode}c

X509 verify error code

%{errstr}c

X509 verify error string

%{format}t

the time the request arrived If format is omitted, the time is given in common log format time. Format must conform to strftime(3) format.

%{header}i

the contents of the client request header specified by header

%{header}o

the contents of the server response header specified by header

%{issuerdn}c

the issuer of the client certificate

%{note}n

the contents of a note from another module, specified by note

%{subjectdn}c

the subject, or owner, of the client certificate used in a secure transaction

%{variable}e

the value of the environment variable

In variables with bracketed values, the percent sign (%) can be followed by one or more optional, comma-separated HTTP status codes as conditions of the log field. The status codes can be preceded by an exclamation point (!) to indicate "not." For example,

LogFormat "%400,501{User-agent}i"

logs the User-Agent header only for r 501 Not Implemented requests that return server status codes of 400 Bad Request or 501 Not Implemented, and

LogFormat "%!200,304,302{Referer}i"

logs the Referer header for all requests that return an irregular server status code.

Any virtual host can have its own TransferLog with its own LogFormat. If it doesn't have its own LogFormat, it inherits one from the main server. If it doesn't have its own TransferLog, it writes to the same description as the main host.

For a complete list of status codes and their meanings, see Appendix B Server Status Codes.

CustomLog

Syntax: CustomLog filename "string" env=[!]environment-variable
Context: host
Module: mod_log_config

The CustomLog directive creates a log for any purpose. Filename is a path to a log file. String is a variable string that sets the format of each log entry, and it uses the same variables as LogFormat above.

If the option env=environment-variable is given, the log line will only be written if the named environment variable is set. If an exclamation mark is given before the environment variable name then the log line is written only if the environment variable is not set. Environment variables are typically set by SetEnvIf or rewrite rules.

ErrorLog

Syntax: ErrorLog filename|syslog
Context: host
Module: core
Default: logs/error_log

The ErrorLog directive sets the path to the file used to log errors that occur during regular, unsecured transactions. If the filename does not begin with a slash (/), then it is assumed to be relative to the <ServerRoot>.Using "syslog" instead of a filename enables logging via syslogd(8), if the system supports it. For a sample error log, see Chapter 1 "Error Logs".


Be sure to check this file occasionally to make sure that the site is running smoothly.

LogLevel

Syntax: LogLevel level
Context: host
Module: core
Default: error

LogLevel sets the verbosity of the messages recorded in the error logs created by the ErrorLog directive. The following levels are available, in order of decreasing significance:

Level Descriptions Example

energ

emergencies

--system is unusable

"Child cannot open lock file. Exiting"

alert

action must be taken immediately

"Getpwuid: couldn't determine user name from uid"

crit

critical conditions

"Socket failed to get a socket, exiting child"

error

error conditions

"Premature end of script headers"

warn

warning conditions

"child process 1234 did not exit, sending another SIGHUP"

notice

normal but significant conditions

"httpd caught SIGHBUS, attempting to dump core in..."

infor

information al messages

"Server seems busy, (you may need to increase StartServers, of Min/MaxSpareServers)..."

debug

debug-level messages

"Opening config file..."

Significance

When a particular level is specified, messages from all other levels of higher significance are reported as well. For example, when LogLevel info is specified, then messages with log levels of "notice" and "warn" are also posted.


A level of "crit" or below is recommended

CookieLog

Syntax: CookieLog filename
Context: object
Module: mod_log_config
Depreciated; use CustomLog instead

HostnameLookups

Syntax: HostnameLookups on|off|double
Context: server
Module: core
Default: off

When this directive is set to "on," Stronghold logs hostnames by performing reverse lookups. When it is set to "off" or omitted, Stronghold logs only the IP address. When it is set to "double," Stronghold performs a "double-reverse" lookup by performing a reverse DNS lookup, then a forward lookup on that result; at least one of the IP address from the result of the forward lookup must match the original IP number. It is set to "off" by default to reduce unnecessary and time-consuming DNS traffic.


Regardless of how this directive is set, double-reverse DNS lookups are
performed for all requests that are subject to host-based access control.

PidFile

Syntax: PidFile filename
Context: server
Module: core
Default: logs/httpd.pid

The PidFile directive specifies the file to which the server records the process ID of the server parent process. If the filename does not begin with a slash (/), then it is assumed to be relative to the <ServerRoot>. Stronghold's bin/reload-server and bin/stop-server scripts use PidFile to signal the parent process ID.

ScoreBoardFile

Syntax: ScoreBoardFile filename
Context: server
Module: core

The ScoreBoardFile directive sets the path to the file used to store server status information. If the filename does not begin with a slash (/), then it is assumed to be relative to the <ServerRoot>. The file itself is used by child processes to write information used by the parent process to manage the children. It is also used by mod_status to construct server status reports, as described in "Server Status Reports" on page 1-10.


Operating systems with memory mapping functions do not use this directive

IdentityCheck

Syntax: IdentityCheck on|off
Context: object
Module: core
Default: off

This directive enables RFC1431-compliant logging of the remote user name for each connection, where the client machine runs identd or something similar. This information is logged in the access log.


The information should not be trusted in any way except for rudimentary usage tracking.

ExtendedStatus

Syntax: ExtendedStatus on|off
Context: server
Module: mod_status
Default: off

The ExtendedStatus directive enables and disables server status reports when mod_status is compiled into the Stronghold binary. Although mod_status is compiled into Stronghold by default, status reports are turned off to conserve server resources. Set this directive to "on" to enable them.

AddModuleInfo

Syntax: AddModuleInfo module string
Context: host
Module: mod_browser

This allows the content of string to be shown as HTML-interpreted text in the Additional Information field for the named module in the server information report. For example:

AddModuleInfo mod_auth.c

See See also "Server Information Reports" on page 1-13.

CGI Error Logs

AgentLog

Syntax: AgentLog
Context: host
Module: mod_log_agent

The AgentLog directive sets the name of the file to which the server will log the UserAgent header of incoming requests. File-pipe is one of the following:

This directive is provided for compatibility with NCSA 1.4.

RefererLog

Syntax: RefererLog file-pipe
Context: host>
Module: mod_log_referer

The refererLog directive sets the name of the file to which the server will log the Referer header of incoming requests. File_pipe is one of the following:

A new program will not be started for a virtual host if it inherits the RefererLog from the main server


If a program is used, then it will be run under the user who started the server, not the user the server runs as. For
example, this is root if the server was started by root.

This directive is provided for compatibility with NCSA 1.4.

RefererIgnore

Syntax: RefererIgnore string1 [string2...]
Context: host
Module: mod_log_referer

The RefererIgnore directive is optional and sets a list of strings to ignore in Referer headers. If any of the strings in the list is contained in the Referer header then no referer information will be logged for the request. For example,

refererIgnore www.ncsa.uiuc.edu

prevents the module from logging references form www.nsca.uiuc.edu.

SSL Logs

These logs record data about SSL transactions.

SSLLogFile

Syntax: SSLLogFile filename
Context: host
Module: mod_ssl

Stronghold stores information about each SSL-enabled connection--such as cipher and client-authentication data--in the SSLLogFile.

SSLErrorFile

Syntax: SSLErrorFile filename
Context: host
Module: mod_ssl

Stronghold uses the SSLErrorFile to record errors that occur during SSL transactions.

SSL_CertificateLogDir

Syntax: SSL_CertificateLogDir path
Context: object
Module: mod_ssl

SSL_CertificateLogDir sets the path to the directory where Stronghold logs client certificates.

SSLLog

Syntax: SSLLog filename
Context: server config, virtual host
Module: mod_ssl
Default: none
AllowOverride: AuthConfig

This directive, along with SSLLogLevel supersedes the following directives ScriptLog, ScriptLogLength and ScriptLogBuffer. See Compatibility Directives on page 7-115

If the filename does not begin with a slash ('/') then it is assumed to be relative to the <ServerRoot>. If filename begins with a bar ('|') then the following string is assumed to be a path to an executable program to which a reliable pipe can be established. The directive should occur only once per virtual server config.

Example:

SSLLog /usr/local/apache/logs/ssl_engine_log

SSLLogLevel

Syntax: SSLLogLevel level
Context: server config, virtual host
Module: mod_ssl
Default: SSLLogLevel none

This directive, along with SSLLog supersedes the following directives ScriptLog, ScriptLogLength and ScriptLogBuffer. See Compatibility Directives on page 7-115

This directive sets the verbosity degree of the dedicated SSL protocol engine logfile. The level is one of the following (in ascending order where higher levels include lower levels):

Example:

SSLLogLevel warn


Directory Tree

Stronghold Web Server 3.0 supports one directory tree directive, which sets the default index file for directories. This directive is necessary for serving error files.

These directives control

Aliases

Alias

Syntax: Alias /path/ /actual/path/
Context: host
Module: mod_alias

The alias directive maps an actual path on your server to an alias. For example, if the hostname is www.random.com and you include the line

Alias /icons/ /path/icons/

then the URL http://www.random.com/icons/ points to the directory. This means that URLs and other references do not necessarily have to refer to documents under the root document directory.

AliasMatch

Syntax: AliasMatch regex path
Context: server, host
Module: mod_alias

This directive is equivalent to Alias, but uses standard regular expressions instead of simple prefix matching. The regex is matched against the requested URL. If it matches, the server substitutes any parenthesized matches into the given string and uses it as a filename. For example, one could use the following to activate the /icons directory:

AliasMatch ^/icons(.*) /usr/local/apache/icons$1

ScriptAlias

Syntax: ScriptAlias /path/ /actual/path/
Context: server
Module: mod_alias

ScriptAlias works just like Alias, except that any file in the specified directory is a CGI script by default. This means that your scripts do not necessarily have to reside in <ServerRoot>/cgi-bin, and that any file in a ScriptAlias directory is automatically executed.

ScriptAliasMatch

Syntax: regex path
Context: server, host
Module: mod_alias

This directive is equivalent to ScriptAlias, but uses standard regular expressions instead of simple prefix matching. The regex is matched against the requested URL. If it matches, the server substitutes any parenthesized matches into the given path string and uses it as a filename. For example, one might use the following to activate the standard
/cgi-bin:

ScriptAliasMatch ^/cgi-bin(.*) /usr/local/apache/cgi-bin$1

Redirect

Syntax: Redirect type /path/URL/
Context: server
Module: mod_alias

Redirect provides aliases to other resources, whether on your host machine or a remote server, Type is one of the following:

For example,

redirect perm /secure/https://www.host.com/secure/

causes Stronghold to redirect all requests for http://www.host.com/, which simply connects the client to the same page using SSL. Stronghold will also direct any requests for http://www.host.com/secure/whatever


If URI points to a directory on your
server, avoid "loops" by making sure that URI does not point back to path

RedirectMatch

Syntax: RedirectMatch [status] regex URL
Context: server, host
Module: mod_alias

This directive is equivalent to Redirect, but uses standard regular expressions instead of simple prefix matching. The regex is matched against the requested URL. If it matches, the server substitutes any parenthesized matches into the given URL string and uses it as a filename. For example, one could use the following to redirect all GIF files to like-named JPEG files on another server:

RedirectMatch (.*)\.gif$http://www.anotherserver.com$1.jpg

RedirectTemp

Syntax: RedirectTemp URL-path URL
Context: object
Module: mod_alias

This directive is equivalent to

redirect temp

and sends the status code 302 to the client to indicate that the resource specified by URL-path has temporarily moved to URL.

RedirectPermanent

Syntax: RedirectPermanent URL-path URL
Context: object
Module: mod_alias

this directive is equivalent to

redirect perm

and sends the status code 301 to the client to indicate that the resource specified by URL-path has permanently moved to URL.

UserDir

Syntax: UserDir Directory
Context: server, host
Module: mod_userdir

The UserDir directive sets the real directory in a user's home directory to use when a request for a document for a user is received. Directory is either disabled, to disable this feature, or the name of a directory, following one of the following patterns. If not disabled, then a request for http://www.foo.com/~bob/one/two.html will be translated to:

UserDir public_html -> ~bob/public_html/one/two.html
UserDir /usr/web -> /usr/web/bob/one/two.html
UserDir /home/*/www -> /home/bob/www/one/two.html

Directory Indexing

These directives configure Stronghold's responses to requests for directories but not files. This behavior is controlled by two modules:

DirectoryIndex

Syntax: DirectoryIndex filename1 [filename2 ...] /path/to/error/page
Context: object
Module: mod-Dir
AllowOverride: indexes

This directive sets the filename of the default index file for any directory. When a client sends a request URL to a directory but not a specific file, Stronghold returns the DirectoryIndex file. You can list any number of filenames, in order of priority; Stronghold looks for each and return the first one it finds. By specifying the path to a file that contains an error message as the last item on the list, you can cause Stronghold to return that message if it finds none of the previous filenames.

For example, if this directive is set to

DirectoryIndex index.html /errors/404.html

in the global configuration, then a request for http://www.host.net/ actually returns http://www.host.net/index.html, if the index.html file exists. If it does not exist, the request returns http://www.host.net/errors/404.html. However, if it is set to

DirectoryIndex index.html

and index.html does not exist, then the request is passed to mod_autoindex, which is controlled with the remaining directives in this section.

FancyIndexing

Syntax: FancyIndexing on/off
Context: object
Module: mod_autoindex
AllowOverride: Indexes

If Stronghold finds no index file for a requested directory, it generates an HTML-formatted file list for that directory on the fly. Normally, this is just an unordered list of linked filenames. To generate icons and extra information, including modification dates, file sizes, and descriptions, set FancyIndexing to "on." Fancy indexes are also sortable. Users can click a column heading to sort by that column. Clicking the column heading again toggles between ascending and descending order. To suppress the sortable index feature, set IndexOptions to "SurpressColumnSorting"

AddIcon

Syntax: AddIcon iconfilename filename1 [fileneme2...]
Context: object
Module: mod_autoindex
AllowOverride: Indexes

With FancyIndexing set, Stronghold generates detailed file lists with an icon next to each filename. AddIcon matches one Icon file to one or more filenames that might appear in such a list. This means that Stronghold can display different icons for different files or file types. Filename can be a full filename, a wildcard expression, or a suffix, such as .bin or .exe. There are also two special names you can use for filename: "^^DIRECTORY^^" for subdirectories within the directory being listed, and "^^BLANKICON^^" for adding icons to blank lines.

To allow for browsers that have graphics turned off or do not support graphics at all, you can specify an ALT tag for each icon. The syntax for this feature is:

AddIcon (EXE, /icons/executables.gif) .exe

Where EXE is the ALT value for the icon.

AddIconByType

Syntax: AddIconByType iconfilename MIME- type1 [MIMI-type2...]
Context: object
Module: mod_autoindex
AllowOverride: Indexes

Unlike AddIcon, which maps icons to filename patterns, AddIconByType maps an icon to one or more MIME types. MIME-type can be an exact MIME type, but it can also take wildcard expressions

As with AddIcon, an ALT tag can be added to iconfilename.

AddIconByEncoding

Syntax: AddIconByEncoding iconfilename encoding -type1 [encoding-type2...]
Context: object
Module: mod_autoindex
AllowOverride: Indexes

This directive matches an icon file to one or more MIME encoding types. Stronghold uses the AddEncoding directive to determine each file's encoding type based on its filename suffix, then uses this directive to place the specified icon next to the filename in the directory index.

DefaultIcon

Syntax: DefaultIcon iconfilename
Context: object
Module: mod_autoindex
AllowOverride: Indexes

If Stronghold finds no icon specified for a file in the previous directives, it uses the icon specified by DefaultIcon.

HeaderName

Syntax: HeaderName filename
Context: object
Module: mod_autoindexes
AllowOverride: Indexes

You can place text and images at the top of a directory index by specifying a filename using the Header name directive. Whenever Stronghold generates a directory index for a directory controlled by this directive, it inserts the HTML contained in filename at the top of the generated file.

ReadmeName

Syntax: ReadmeName filename
Context: object
Module: mod_autoindex
AllowOverride: Indexes

ReadmeName is just like headerName, except that Stronghold places the HTML contained in filename at the bottom of the generated directory index as a footer.

IndexOrderDefault

Syntax: IndexOrderDefault Ascending|Descending Name|Date|Size|Description
Context: server config, virtual host, directory, .htaccess
Module: mod_autoindex
AllowOverride: Indexes

The IndexOrderDefault directive is used in combination with the FancyIndexing index option. By default, FancyIndexed directory listings are displayed in ascending order by filename; the IndexOrderDefault allows you to change this initial display order.

IndexOrderDefault takes two arguments. The first must be either Ascending or Descending, indicating the direction of the sort. The second argument must be one of the keywords Name, Date, Size, or Description, and identifies the primary key. The secondary key is always the ascending filename.

You can force a directory listing to only be displayed in a particular order by combining this directive with the "SuppressColumnSorting" index option; this will prevent the client from requesting the directory listing in a different order.

IndexIgnore

Syntax: IndexIgnore arg1 [arg2...]
Context: object
Module: mod_autoindex
AllowOverride: Indexes

IndexIgnore specifies one or more regular expressions that Stronghold uses to filter out certain files when generating a directory index. For example, it's usually a good idea to exclude files that begin with a "." by entering:

INDEXIGNORE ^\.

Use this directive carefully, as it affects which files users can access in the absence of a DirectoryIndex file.

AddDescription

Syntax: AddDescription "description" filename1 [filename2...]
Context: object
Module: mod_autoindex
AllowOverride: Indexes

When FancyIndexing is set, generated directory include a Description column. AddDescription provides a description for one or more filenames or suffixes, such as

AddDescription"Chicago, 1968" /images/convention.gif AddDescription "MEPG Movie File" .mpeg .mpg

AddAlt

Syntax: AddAlt "description" filename1[filename2...]
Context: object
Module: mod_autoindex
AllowOverride: Indexes

AddAlt specifies alternative descriptive text for one of more filenames or suffixes, which can include wildcard strings. If no AddDescription text exists for a file, the AddAlt text is used in the Description column of the directory index, assuming FancyIndexing is on.

AddAltByType

Syntax: AddByType "description" MIME-type1[MIME-type2...]
Context: object
Module: mod_autoindex
AllowOverride: Indexes

Similar to AddAlt, AddAltByType matches alternative descriptive text to one or more MIME types. Stronghold inserts this text into the Description column of the directory indexes for files of the given types, except those that already have an AddDescription or AddAlt value.

AddAltByEncoding

Syntax: AddByEncoding "description" encoding-type1 [encoding-type2...]
Context: object
Module: mod_autoindexes
AllowOverride: Indexes

AddAltByEncoding matches alternative descriptive text to one or more encoding types. Stronghold inserts this text into the Description column of directory indexes for files of the given types, except those that already have an AddDescription value.

IndexOptions

Syntax: IndexOptions option1 [option2...]
Context: object
Module: mod_autoindexes
AllowOverride: Indexes

IndexOptions is a comprehensive directory indexing directive that can take one or more of the following options:

Option Description

FancyIndexing

If Stronghold finds no index file for a requested directory, it generates an HTML-formatted file list for that directory on the fly. Normally, this is just a list of linked filenames. To generate icons and extra information such as modification dates and file sizes along with the file list, include this directive.

IconHeight=pixels

When combined with the IconWidth option, this causes Stronghold to include the height attribute in icon <IMG> tags.

IconsAreLinks

If this option is included, each icon in the directory index will be linked to the file listed beside it.

IconWidth=pixels

When combined with the IconWidth option, this causes Stronghold to include the width attribute in icon <IMG> tags.

NameWidth=Characters |*

This sets the width of the "FIlename" column, in characters, or "*" to set the column width to the width of the longest filename.

ScanHTMLTitles

For each HTML file, Stronghold can obtain the contents of the <TITLE> field, if any, and include it in the directory index. Bear in mind that this requires extra processing.

SuppressColumnSorting

This option suppresses column sorting.

SuppressDescription

This option suppresses the Description column.

SuppressHTMLPreamble

Normally, directory indexes are generated with a standard HTML preamble. When this option is set and a file specified by HeaderName exists, then Stronghold omits the preamble. In this case, the header file must include an HTML header.

SupressLastModified

This option suppresses the Last Modified column.

SuppressSize

This option suppresses the Size column.

URL Spell-Checking

When all other modules fail to fulfil a request, Stronghold passes it to mod_speling. This is a URL spell-checking module that compares the names of the requested directory or file to existing directories and files. The comparison is case-insensitive and allows up to one extraneous character, omitted character, or character transposition. If no matching document is found, the request fails with a status code of " 404 Not Found." If exactly one matching document is found, it is returned to the client with a redirection response. If more than one match is found, a list of matches is returned to the client with a status code of " 300 Multiple Choices."

CheckSpelling

Syntax: CheckSpelling on|off
Context: object
Module: mod_speling
Default: off

This directive enables or disables the URL spell-checking module. When mod_speling is enabled, keep these points in mind:


File Handling and Preprocessing

Files are handled on the basis of their filenames, which are in turn mapped to MIME types, encoding types, and handlers. Stronghold expects each filename to follow this syntax:

filename.type.language.encoding

For example,

Filetypes

Stronghold determines the MIME type of each requested file based on a mapping of MIME types to filename extensions.

MimeMagicFile

Syntax: MimeMagicFile magicfilename
Context: server, host
Module: mod_mime_magic

The mod_mime_magic module is enabled when the MimeMagicFile directive is present. By default, this directive is not included; add it to httpd.conf to enable mod_mime_magic. A default magic MIME file is located at conf/magic. Virtual hosts use the same file as the main server unless they are given their own MimeMagicFile directives.

TypesConfig

Syntax: TypesConfig filename
Context: server
Module: mod_mime

TypesConfig sets the path to the file that maps MIME types to filename suffixes. By default, it is set to mime.types in the <ServerRoot> directory. You can edit the mime.types file to add new or custom MIME types, or you can use the AddType directive.

AddType

Syntax: AddType MIME-type file-suffix
Context: object
Module: mod_mime
AllowOverride: FileInfo

With AddType, you can map MIME types to filename suffixes without editing the mime.types file.

ForceType

Syntax: ForceType type
Context: object
Module: mod_mime

ForceType forces Stronghold to treat a file or files as the specified MIME type, regardless of their filenames.

AddEncoding

Syntax: AddEncoding encoding-type file-suffix
Context: Object
Module: mod_mime
AllowOverride: FileInfo

AddEncoding matches filename suffixes to encoding types. When Stronghold sends an encoded file to a client, it includes a Content-Encoding header that gives the encoding type based on the filename's suffix. The client can then determine the type of
pre-processing required to decode the file for the user.

AddLanguage

Syntax: AddLanguage language-type filename suffix
Context: object
Module: mod_mime
AllowOverride: FileInfo

When a client requests a document, it should include the Accept-Language field in its request. The value is a two-letter abbreviation such as en, it, fr, or jp. AddLanguage maps these languages types to filename suffixes. For example, if you have files named readme.html.fr and readme.html.jp, Stronghold knows which one to send to a French client and which to send to a Japanese client when each sends a request for readme.html.

DefaultType

Syntax: DefaultType mime-type
Context: object
Module: core
Default: DefaultType text/html

There will be times when the server is asked to provide a document whose type cannot be determined by its MIME type mappings. The server must inform the client of the content-type of the document, so in the event of an unknown type it uses the DefaultType. For example,

DefaultType image/gif

Would be appropriate for a directory that contained many GIF images with filenames missing the .gif suffix.

DefaultLanguage

Syntax: DefaultLanguage MIME-lang
Context: server config, virtual host, directory, .htaccess
Module: mod_mime
AllowOverride: FileInfo

The DefaultLanguage directive tells Apache that all files in the directive's scope (e.g., all files covered by the current <Directory> container) that don't have an explicit language extension (such as .fr or.de as configured by AddLanguage) should be considered to be in the specified MIME-lang language. This allows entire directories to be marked as containing Dutch content, for instance, without having to rename each file. Note that unlike using extensions to specify languages, DefaultLanguage can only specify a single language.

If no DefaultLanguage directive is in force, and a file does not have any language extensions as configured by AddLanguage, then that file will be considered to have no language attribute.

Metainformation

Metainformation refers to information about information. In the context of a Web server, metainformation takes the form of content digests or HTTP headers. A complete list of HTTP/1.1 headers appears in Appendix B Server Status Codes.

ContentDigest

Syntax: ContentDigest yes|no
Context: server
Module: core

When ContentDigest is set to "yes," Stronghold sends a Content-MD5 digest header with each response. Clients can use the header to check the integrity of the files they receive.

MetaFiles

Syntax: MetaFiles on/off
Context: .htaccess
Module: mod_cern_meta
Default: off

MetaFiles enables and disables metafile processing on a per-directory basis.

MetaDir

Syntax: MetaDir directory-name
Context: .htaccess
Module: mod_cern_meta

This directive specified the name of the directory in which Stronghold can find meta information files. The directory is usually a "hidden" subdirectory of the directory that contains the file being access Set to "." to instruct the server to look in the directory that contains the requested file.

MetaSuffix

Syntax: MetaSuffix .htaccess
Context: object
Module: mod_cern_meta

Specifies the filename suffix for the meta information file. For example, the default values for the two directives will cause a request to DOCUMENT_ROOT/somedir/index.html to look in DOCUMRNT_ROOT/somedir/.Web/index.htm;.meta and will use its contents to generate additional HTTP header information.

ExpiresActive

Syntax: ExpiresActive on|off
Context: object
Module: mod_expires
AllowOverride: Indexes

This directive enables and disables generation of the Expires HTTP header for an object. If it is set to "off," Stronghold generates no Expires header. If it is set to "on," Stronghold uses the criteria set to ExpiresByType and ExpiresDefault to gentrate Expires headers.

ExpiresByType

Syntax: ExpiresByType mime-type CODE
Context: object
Module: mod_expires
AllowOverride: Indexes

When ExpiresActive is set to "on," ExpiresByType sets the content of the Expires header by MIME type. CODE sets the time on which the enquiry period is based, and must be one of the following:

For example,

EpiresByType image/jpeg A2592000
ExpiresByType text/html M604800

In the first instance, all JPEG files expire after one month in the client's cache. Note that if the client's cache is short-lived or the client downloads the file again, the expiry period is reset. In the second instance, all HTML files expire one week after they were last modified, regardless.

ExpiresDefault

Syntax: ExpiresDefault CODE
Context: object
Module: Mod_expires
AllowOverride: Indexes

When ExpiresActive is set to "on," ExpiresDefault sets the default content of the Expires header for all documents. ExpiresByDefault overrides ExpiresDefault for files that match the given MIME type. CODE sets the time on which the expiry period is based, and must be one of the following:

Header

Syntax: Header [set|append|add|unset]header value
Context: object
Module: mod_headers

This directive can replace, merge, or remove HTTP response headers. The action it performs is determined by the first argument, which can have one of the following values:

The second value, header, is the name of the HTTP header, with or without the final colon. Value is the value of the given header.

The header directives are processed in the following order:

Order is important. For example, these two headers have different effects if they are reversed:

header append Author "John P. Doe" Header unset Author

In this example, the Author header is not set. However, if the two are reversed, the Author header is set to "John P. Doe."

The header directives are processed just before the response is sent by their handlers. This means that some headers that are added just before the response is sent-- including the Date and Server headers--cannot be unset or overridden.

ServerTokens

Syntax: ServerToken min[imal]|os|full
Context: server
Module: core
Default: Full

This directive controls whether the Server header which is returned to clients includes a description of the generic OS-type of the server as well as information about compiled-in modules. The valid values are as follows

Value Resulting Server Header

min[imal]

Server: Stronghold/3.0 Apache/1.3.1

os

Server: Stronghold/3.0 Apache/1.3.1 (Unix)

full (or not specified)

Server: Stronghold/3.0 Apache/1.3.1 (Unix) PHP/3.0 MyMod/1.2

This setting applies to the entire server, and cannot be enabled or disabled on a host-by-host basis.

Handlers

AddHandlers

Syntax: AddHandlers handler-name filename-suffix
Context: object
Module: mod_mime
AllowOverride: FileInfo

This directive matches handlers to filename suffix and is often used in conjunction with Action. Handler-name can be the name of an existing handler or one that you create using the Stronghold API. For example, you can use Stronghold's as-is module by uncommenting this line in http.conf.

AddHandler send-as-is asis

With this handle enabled, Stronghold sends any file ending in .asis without adding an HTTP header. Your .asis files must include their own HTTP headers, followed by two carriage returns. This means that you can attach custom headers to your files without creating special CGI scripts to manage them. You can also use this directive to create special handlers specifically for the Action directive, as described as follows:

RemoveHandler

Syntax: RemoveHandler extension extension...
Context: directory, .htaccess
Module: mod_mime

The RemoveHandler directive removes any handler associations for files with the given extensions. This allows .htaccess files in subdirectories to undo any associations inherited from parent directories or the server config files. An example of its use might be:

/foo/.htaccess:
AddHandler server-parsed .html
/foo/bar/.htaccess:
RemoveHandler .html

This has the effect of returning .html files in the /foo/bar directory to being treated as normal files, rather than as candidates for parsing (see the mod_include module).

SetHandler

Syntax: SetHandler handler
Context: object
Module: mod_mime
AllowOverride: FileInfo

SetHandler specifies a handler to be used for all files in a directory or location. There is one. These are the built-in values for handler:

handler description

cgi-script


All files are treated as CGI scripts and processed by mod_cgi.

default-handler

All files are treated as static files


imap-file

All files are treated as imagemap files and processed by mod_imap


send-as-is

Stronghold send all files without appending HTTP headers.


server-info


All files are sent with server configuration information.


Server-status

All files are sent with server status information.

server-parsed

All files are treated as server-parsed HTML, for server-side includes by mod_ssi

Type-map

All files are treated as type maps for content negotiation by mod_negotiation

Handler can also be a third-party or custom handler that you add with AddHandler.

Action

Syntax: Action handler|media-type script
Context: object
Module: mod_action
AllowOverride: FileInfo

Action maps handlers or media types to the CGI scripts that process them. For example, if you do not want to use Stronghold's internal imagemap feature, you could include

Addhandler imap-file .map Action imap-fule /cgi-bin/imap.cgi

which causes Stronghold to send all files ending in .map directly to the imap.cgi script. Thus, if Stronghold receives a request for
http://www.host.com/nav.map, it behaves as if it received a request of http://www.host.com/cgi-bin/imap.cgi/nav.map instead. Action can be used with AddType in the same way.

Script

Syntax: Script method script
Context: object
Module: mod_action

The Script directive defines a request method (such as GET, PUT, or POST) and a default CGI script for that method. When a client requests and object that carries this directive, and not other handling is defined for that object, Stronghold passes the PATH_INFO and PATH_TRANSLTED environment variables. For example, you can use this directive with the PUT method to allow Navigator Gold users to publish their Web files on your server.

URL Rewriting

Stronghold includes mod_rewrite, a module that rewrites requested URLs that match a set of conditions. The rewritten request can be a URI, a URL, or a filepath with or without QUERY_STRING information. This powerful module can be used for an enormous variety of purposes, limited only by your imagination. It is documented in great detail at
http://www.engleschall.com/sw/mod_rewrite/doc/mod_rewrite/toc.html

RewriteEngine

Syntax: RewriteEngine on|off
Context: object
Module: mod_rewrite
AllowOverride: FileInfo

This directive enables or disables the rewrite module for an object, a host, or the server. If you configure mod_rewrite for an object and later change your mind, set this directive to "off" rather than commenting out the rewrite directives.

RewriteLog

Syntax: RewriteLog filename
Context: server
Module: mod_rewrite
This directive sets the filename of the log that records all rewrite actions. Make sure the directory that contains this file is not writable by anyone other than the user that starts the server, preferably root.

RewriteLogLevel

Syntax: RewriteLogLevel n
Context: server
Module: mod_rewrite

This directive sets the verbosity level of the rewrite log file, from 0 to 9. The value 0 is completely silent; use it to disable the log. The value 9 is the most verbose, but keep in mind that any value higher than 2 slows the Stronghold server substantially.

RewriteLock

Syntax: RewriteLock filename
Context: host
Module: mod_rewrite

This directive sets the filename for a synchronization lockfile which mod_rewrite needs to communicate with RewriteMap programs. Set this lockfile to a local path (not on a NFS-mounted device) when you want to use a rewriting program. It is not required for SAMP using all other types of rewriting maps.

RewriteOptions

Syntax: RewriteOptions inherit
Context: object
Module: mod_rewrite
AllowOverride: FileInfo

This directive sets special options for the rewrite configuration. Currently, there is only one option. "Inherit" forces an object to inherit the rewrite configuration of its parent. In the context of a .htaccess file, this means that the directory inherits the configuration in its parent's .htaccess file.

RewriteBase

Syntax: RewriteBase URL
Context: .htaccess only
Module: mod_rewrite
AllowOverride: FileInfo

This directive sets a base URL that mod_rewrite prepends to the result of a rewrite operation

RewriteMap

Syntax: RewriteMap mapname txt|prg:filename
Context: object
Module: mod_rewrite

This directive defines a separate file that contains a rewriting map. Mapname is a name used to denote the map file in the rule substitution strings of other directives. A format indicator is separated from the filename by a colon and must be one of the following

Format Indicator Description

rnd

randomized plain text. It contains values separated by pipes (|) meaning "or." The values constitute a set of alternatives from which the returned value is chosen randomly. This is designed for load balancing in a reverse proxy configuration where the values are server names. For example:

static www1|www2|www3|www4

dynamic www5|www6

int

internal function. The source is an internal server function. Currently, you cannot create your own, but the following functions are built-in:

toupper

Converts the key to all upper case

tolower

Converts the key to all lower case

escape

translates special characters in the looked-up ket into %-encoded form

unescape

translates %-encodings back to special characters

nocase

makes the pattern case-insensitive

nc

makes the pattern case-insensitive

txt

an ASCII file. The file can contain blank lines, comment lines beginning with a hash (#) character, and key-value pair lines like this:

key substitute

The key uniquely denotes the line, and substitute is the substitution pattern to use when the key is called.

dbm

a binary NDBM file, which you can create with an NDBM tool or the src/util/dbmmanage utility

prg

a UNIX executable, either an object-code program or a script that begins with this magic cookie line:

#!/path/to/interpreter

RewriteCond

Syntax: RewriteCond test-string condition-pattern
Context: object
Module: mod_rewrite
AllowOverride: FileInfo

RewriteCond defines a rule condition and always precedes a RewriteRule directive. The rule given RewriteRule applies only if the conditions given in RewriteCond are met. The rewrite module evaluates the test-string and matches it against condition-pattern. If they match, it applies the rule given in RewriteRule.

Test-string contains one or more of the following server variables:

HTTP_USER_AGENT
HTTP_REFERER
HTTP_FORWARDED
HTTP_HOST
HTTP_PROXY_CONNECTION
HTTP_ACCEPT
REMOTE_ADDR
REMOTE_HOST
REMOTE_USER
REMOTE_IDENT
REQUEST_METHOD
SCRIPT_FILENAME
PATH_INFO
QUERY_STRING
AUTH_TYPE
DOCUMENT_ROOT
SERVER_ADMIN
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
SERVER_SOFTWARE
SERVER_VERSION
TIME_YEAR
TIME_MON
TIME_DAY
TIME_HOUR
TIME_MIN
TIME_SEC
TIME_WDAY
API_VERSION
THE_REQUEST
REQUEST_URI
REQUEST_FILENAME
IS_SUBREQ

Condition-pattern is a standard, extended regular expression that mod_rewrite applies to an instance of the test-string. It can be preceded by an exclamation mark (!) to indicate a non-matching pattern, or substituted with one of the following flags:

Any of these flags can also be prepended by and exclamation mark (!).
Condition-pattern can also be appended by a comma-separated, bracketed list of one of the following flags:

For example:

RewriteCond $(REMOTE_HOST) ^host1.* [or]
RewriteCond
${REMOTE_HOST) ^host2.* [or]
$(REMOTE_HOST) ^host3.*

RewriteRule

Syntax: RewriteRule pattern substitute
Context: object
Module: mod_rewrite
AllowOverride: FileInfo

RewriteRule defines the actual rules used to rewrite requested URLs that match conditions defined by RewriteCond. It can be used more than once, and multiple instances are evaluated in the order in which they appear.

Pattern is a POSIX regular expression that mod_rewrite applies to the current URL, whether it is the originally requested URL or a URL that has already been transformed by previous instances of RewriteRule. It may be prepended by an exclamation mark (!) to indicate a non-matching pattern, but a non-matching pattern cannot contain grouped wildcards. Substitute is the string that mod_rewrite substitutes for any URL that matches the pattern. it can consist of:

You can set special options for substitute by appending a comma-separated, bracketed list of these flags:

Flag Description

redirect [status-code]

Sends a status code between 300 and 400, specified by status-code. The default is 302.

R[=status-code]

Same as "redirect".

forbidden

Forces Stronghold to return a status code of 403 (forbidden). This flag is useful for conditionally URL's.

F

Same as "forbidden".

gone

Forces Stronghold to return a status code of 410 (Gone)

G

Same as "gone".

proxy

Forces the substitution part through the proxy module. The substitution string must be a valid URL. This is useful as a sophisticated alternative to the ProxyPass directive.

P

Same as "proxy".

last

Forces the rewrite to end here.

L

Same as "last".

chain

Chains the current rule with the next rule, specified MIME type.

C

Same as "chain".


type=mime-type

Forces Stronghold to return the file as the specified MIME type.

T=mime-type

Same as "type".

nosubreq

Indicates that the current rule applies only if the current request is not an internal subrequest.

NS

Same as "nosubreq".

passthrough

Passes the substitution to the next handler, which should immediately follow the current RewriteRule.

PT

Same as "passthrough".

skip=n

Skips the next n rules in a sequence if the current rule matches.

s=n

Same as "skip".

env=VARIABLE:VALUE

Sets the environment variable VARIABLE to the value VALUE.

E=VARIABLE:VALUE

Same as "env"


Content Delivery

Content delivery refers to the way Stronghold manipulates and delivers your site's content, the media that end users experience. This section lists directives that control client request security and several forms of content delivery:

Client Request Security

By flooding a server with useless requests, a client can create a denial-of-service attack. These directives help prevent this type of attack by limiting the amount of data that the server accepts in any single client request.

LimitRequestBody

Syntax: LimitRequestBody n
Context: server
Module: core

The LimitRequestBody directive sets the maximum size of the message body of a client request, in bytes. A request that includes a message body larger than n bytes is discarded, and Stronghold responds with status code 413 Request Entity Too Large. N must be an integer between 0 (meaning unlimited) and 2147483647 (2GB).

LimitRequestFields

Syntax: LimitRequestFields n
Context: server
Module: core

The LimitRequestFields directive sets the maximum number of request header fields allowed in any single request. If a request includes more than n headers, the request is discarded and Stronghold responds with status code 400 Bad Request. N must be an integer between 0 (meaning unlimited) and 32767. If this directive is not present, the default is 100 bytes.

LimitRequestFieldSize

Syntax: LimitRequestFieldSize n
Context: server
Module: core

The LimitRequestFieldSize directive sets the maximum size for all request headers, in bytes. If a request includes a header field larger than n bytes, the request is discarded and Stronghold responds with status code 400 Bad Request. "n" must be an integer between 0 (meaning unlimited) and the value of the compile-time constant DEFAULT_LIMIT_REQUEST_FIELDSIZE. The default value of this constant is 8190.

LimitRequestLine

Syntax: LimitRequestLine n
Context: server
Module: core

The LimitRequestLine directive sets the maximum size of the first line of any request, in bytes. The first line consists of an HTTP request method, a URI, and the HTTP version. For example:

GET /index.html HTTP/1.1

If this line is larger than n bytes, the request is discarded and Stronghold responds with status code 414 Request-URI Too Long. n must be an integer between 0 (meaning unlimited) and value of the compile-time constant DEFAULT_LIMIT_REQUEST_LINE. The default value of this constant is 8190.

Content Negotiation

In any document request, most clients have the ability to specify what kinds of files they can accept. When a server such as Stronghold uses this information to provide the most appropriate format for the client, this is called content-negotiation. With this feature, you can build a flexible, intelligent site. However, content negotiation does entail considerable content management work, since separate versions of the same material must be organized and maintained. "Content Negotiation" on page 9-6 provides a more details discussion of how content negotiation works.

CachNegotiatedDocs

Syntax: CacheNegotiatedDocs
Context: server
Module: mod_negotiation

Normally Stronghold does not cache content-negotiated documents. Including this directive allows it to cache them when acting as a proxy server.

LanguagePriority

Syntax: LamguagePriority language-type1 [language-type2...]
Context: object
Module: mod_negotiation
AllowOverride: FileInfo

If a client does not send an Accept-language header in its request, Stronghold uses this directive to determine which order it should use in trying different language versions of the same file. For example, if this directive is set to:

LanguagePriority en fr jp it

then Stronghold will first offer an English version of the file. If the client rejects this version, the server will try French, and so on.

Session Tracking

The mod_usertrack modules uses Netscape cookies to track sessions. The directives in this section enable tracking and set cookie expiration times. For more information about session tracking, see "Tracking Sessions" on page 1-17

CookieTracking

Syntax: CookieTracking on|off
Context: object
Module: mod_usertrack
AllowOverride: fileInfo

CookieTracking enables or disables session tracking for an object or host, or for the whole server.

CookieExpires

Syntax: CookieExpires expiry-period
Context: host
Module: mod_usertrack

By default, cookies are valid only for the current session. The CookieExpires directive sets a different expiration period. Expiry-period is either an integer representing a number of seconds for which a cookie is valid, or a quoted string consisting of integers and one or more of the following units:

For example:

CookieExpires "6 months 2 weeks 7 hours"

Imagemaps

Stronghold handles imagemaps internally, without the aid of CGI programs. For details information about the imagemap module, see "Server-Side Imagemaps" on page 9-2

ImapMenu

Syntax: ImapMenu Option
Context: object
Module: mod_imap
AllowOverride: Indexes

If a user clicks a point on an imagemap that does not match any valid coordinates in the imagemap file, Stronghold can generate a menu of the links contained in the imagemap. This menu has four formatting options:

Option Description

none

No menu is generated, and Stronghold takes the action specified by IMapDefault instead.

formatted

Stronghold generates a formatted menu that includes a list of available links.

semiformatted

Stronghold generates a menu that includes a list of available links and comments from the imagemap file, separated by simple line breaks.

unformatted

Stronghold generates a menu that consists of the unformatted text of the imagemap file

ImapDefault

Syntax: ImapDefault action\URL
Context: object
Module: mod_map
AllowOverride: indexes

ImapDefault specifies the action Stronghold takes if:

The value for ImapDefault cam be a URL, or one of the following options:

Option Description

error

Stronghold returns a 500 (Server Error) status code.

nocontent

Stronghold returns a 204 (No Content) status code, and the client takes no action.

map

Stronghold uses the imagemap file to generate a menu.

referer

Stronghold instructs the client to return to the referring document, or to the root document for the site if no Referer header was included with the request.

ImapBase

Syntax: ImapBase option\URL
Context: object
Module: mod_map
AllowOverride: Indexes

ImapBase sets the base URL for al relative paths in imagemap files. A base directive in an imagemap file overrides ImapBase.

The value can be a URL, or one of the following options:

Server-Side Includes

Server-side includes (SSIs) are simple, HTML-embedded commands that the server parses before it delivers the HTML file. SSIs are explained in detail in "Server-Side Includes" on page 9-7

XBitHack

Syntax: XBithack off|on|full
Context: object
Module: mod_include
AllowOverride: Options
Default: off

This directive is used with file permissions to indicate which files have server-side includes. Stronghold uses this directive to determine which files to parse before delivery. The values are as follows:

Value Description

off

No special parsing of executable files.

on

Files with the user-execute bit set are treated as server-parsed HTML.

full

Files with the user-execute bit set are treated as server-parsed HTML. If a file has the group-execute by set, the last modified date is included in the HTTP header, if such data exists.

PHP/FI 3.0 Embedded Scripting

The PHP module performs HTML-embedded scripting for dynamic content. you can place PHP configuration directives in httpd.conf and in .htaccess files. If you use PHP, be sure to use the AddType directive to include PHP files. Chapter 3 "Tutorial: Access control" explains PHP in detail.

phpShowInfo

Syntax: phpShowInfo on|off
Context: object
Module: mod_php
AllowOverride: FileInfo

When this directive is turned on, access information footers are added to each PHP-parsed file.

phpLastModified

Syntax: phpLastModified on|off
Context: object
Module: mod_php
AllowOverride: FileInfo

Since PHP pages are dynamic, they are processed and sent to the browser each time you access them. However, if your source pages do not change, you may want to avoid the server overhead of page regeneration and reloading. If phpLastModified is turned on, Stronghold sends the Last-Modified header to the browser so that the page is only reloaded when it changes.


If you are using page logging, multiple accesses will not be logged

phpLogging

Syntax: phpLogging on|off

Context: object
Module: mod_php
AllowOverride: FileInfo

When this directive is turned on, Stronghold logs PHP activity.

phpDebug

Syntax: phpDebug on|off
Context: object
Module: mod_php
AllowOverride: FileInfo

This directive toggles the automatic fileinfo debugging screen on or off. The default is off.

phpUploadTmpDir

Syntax: phpUploadTmpDir directory
Context: object
Module: mod_php
AllowOverride: FileInfo

This directive sets the temporary directory for user-upload files.

phpDbmLogDir

Syntax: phpDbmLogDir directory
Context: object
Module: mod_php
AllowOverride: FileInfo

This directive sets the directory for DBM log files that record (H) activity, assuming phpLogging is turned on.

phpSQLLogHost

Syntax: phpSQLLogHost hostname
Context: object
Module: mod_php
AllowOverride: FileInfo

This directive sets the hostname where PHP can find the SQL logging database.

phpSQLLogDB

Syntax: phpSQLLogDB database
Context: object
Module: mod_php
AllowOverride: FileInfo

This directive sets the name of the SQL logging database.

phpMsqlLoghost

Syntax: phpMsqlLoghost hostname
Context: object
Module: mod_php
AllowOverride: fileInfo

This directive sets the hostname where PHP can find the mSQL logging database.

phpMsqlLogDB

Syntax: phpMsqlLogDB database
Context: object
Module: mod_php
AllowOverride: FileInfo

This directive sets the name of the mSQL logging database.

phpAccessDir

Syntax: phpAccessDir directory
Context: object
Module: mod_php
AllowOverride: FileInfo

This directive sets the directory for PHP access control files.

phpmaxDataSpace

Syntax: phpmaxDataSpace kilobytes
Context: object
Module: mod_php
AllowOverride: FileInfo

This directive sets the maximum size, in kilobytes, of a sub-pool in the PHP module.

phpIncludePath

Syntax: phpIncludePath1[:path2.path3...]
Context: object
Module: mod_php
AllowOverride: FileInfo

This is a colon-separated list of absolute paths to directories where PHP can find files when implementing its include() function.

phpAutoPrependFile

Syntax: phpAutoPrependFile filename
Context: object
Module: mod_php
AllowOverride: FileInfo

The file specified by phpAutoPrependFile is parsed before the requested file using PHP's include function. phpIncludePath applies. keep in mind that an auto-prepended file makes it difficult for you t used the header function in the requested file.

phpAutoAppendFile

Syntax: phpAutoAppendFile filename
Context: object
Module: mod_php
AllowOverride: FileInfo

Similar to phpAutoPrependFile, this directive specifies the name of a file to parse after the requested PHP file has been parsed.

phpAdaDefDB

Syntax: phpAdaDefDB database
Context: object
Module: mod_php
AllowOverride: FileInfo

This is the AdBase database

phpAdaUser

Syntax: phpAdaUser username
Context: object
Module: mod_php
AllowOverride: FileInfo

This is the default Adabas database user.

phpAdaPW

Syntax: phpAdaPW password
Context: object
Module: mod_php
AllowOverride: FileInfo

This is the default Adabas database password.

phpEngine

Syntax: phpEngine on|off
Context: object
Module: mod_php
AllowOverride: FileInfo

This directive turns PHP parsing on or off. The default is on and this directive is only useful if you want to set to "FileInfo" and still disallow PHP parsing.

phpXBithack

Syntax: phpXBithack on|off
Context: object
Module: mod_php
AllowOverride: FileInfo

When php XBitHack is set to "on," the PHP module parses all files with the user-execute bit set, even if they do not have the .php filename extension.


Client Authentication and Access Control

Stronghold Web Server 3.0 comes with a variety of client authentication and access control options. SSL certificates provide the most reliable means of accomplishing both, but other options are also useful for low-security applications or in tandem with SSL. These directives configure

Authentication Mode

This directive sets the authentication mode. The other authentication directives that you use depend on how this directive is set.

AuthType

Syntax: AuthType Basic| Digest|Cert
Context: object
Module: core

This directive activates basic, digest, or certificate authentication for a directory. In order to work, it must be accompanied by AuthName and Require, plus AuthUserFile if the value is "basic." Basic authentication uses only a user ID and password, and digest authentication encrypts both the user ID and password for added security. Certificate authentication uses SSL client certificates.

Basic Authentication

Basic authentication uses text files to authenticate users with simple logins and passwords. Users can be grouped for access control purposes.

AuthName

Syntax: AuthName auth-domain
Context: object
Module: core

This directive sets the name of the authorization realm for a directory. This realm is given to the client so that the user knows which certificate or username and password to send. It must be accompanied by AuthType and Require directives, and either AuthUserFile or AuthGroupFile.

Require

Syntax: Require entity-name entity1 [entity2 ...]
Context: object
Module: core
AllowOverride: AuthConfig

This directive selects which authenticated users can access an object. The allowed values are

Value Description

Require user
userid userid ...

Only the named users can access the directory.

Require group group-name group-name ...

Only users in the named groups can access the directory.

Require valid-user

All valid users can access the directory.

If Require appears in a <Limit> container, then it restricts access to the named methods. If Require appears in a <LimitExcept> then it restricts access to all methods except those named. Otherwise it restricts access for all methods. Require must be accompanied by AuthName and AuthType directives and directives such as AuthUserFile and AuthGroupFile (to define users and groups) in order to work correctly. For example:

AuthType Basic
AuthName somedomain
AuthUserFile /web/users
AuthGroupFile /web/groups
require group admin

AuthGroupFile

Syntax: AuthGroupFile filename
Context: object
Module: mod_auth
AllowOverride: FileInfo

AuthGroupFile specifies the filename that contains the list of authentication groups and the users they include.

AuthUserFile

Syntax: AuthUserFile filename
Context: object
Module: mod_auth
AllowOverride: FileInfo

AuthUserFile specifies the filename that contains the list of authenticated users and their crypt()-encrypted passwords.

AuthAuthoritive

Syntax: AuthAuthoritive on|off
Context: object
Module: mod_auth
AllowOverride: AuthConfig

Setting the AuthAuthoritive directive to "off," allows authentication and authorization to be passes to lower level modules If there is no user ID or rule matching the supplied user ID. If there is a user ID and/or rule specified, the usual password and access checks are applied and a failure gives 401 Unauthorized reply.

If a userID appears in the database of more than one module, or if a valid require directive applies to more than one module, then the first module verifies the credentials and no access is passed on, regardless of the AuthAuthoritive setting. A common use for this is in conjunction with one of the database modules, such as mod_auth_db, mod_auth_dbm, and mod_auth_anon. These modules supply the bulk of the user credential checking, but a few (administrator) related accesses fall through to a lower level with a well-protected AuthUserFile. By default, AuthAuthoriatative is set to "on," and an unknown user ID or rule results in a 40 Unauthorized reply. Setting it to "off," keeps the system secure and forces NSCA-compliant behavior.

Be sure to consider the implications of allowing a user to permit fall-through in and .htaccess file and verify that this is really what you want. Generally, it is easier to just secure a single.htpassword file than it is to secure a database. Make sure that the AuthUserFile is stored outside the DocumentRoot, do not put it in the directory that it protects. Otherwise, clients will be able to download the AuthUserFile.

Berkeley Database Authentication

These directives control user authentication and access control with Berkeley database files. The Berkeley database library is distributed at http//:www.sleepycat.com/

AuthDBGroupFile

Syntax: AuthDBGroupFIle filename
Context: object
Module: mod_auth_db
AllowOverride: AuthConfig

The AuthDBGroupFile directive sets the name of a DB file containing the list of user groups for user authentication. Filename is the absolute path to the file.

The group file is keyed on the username. The value for a user is a comma-separated list of the groups to which the user belongs. The value cannot contain spaces or colons.


Make sure that the
AuthDBGroupFile is stored outside the document tree of the Web
server, and do not put it in the directory that it protects. Otherwise, clients will be able to download the
AuthDBGroupFile.

AuthDBUserFile

Syntax: AuthDBUserFile filename
Context: object
Module: mod_auth_db
AllowOverride: AuthConfig

The AuthBDUserFile directive sets the name of the DB file containing the list of user and passwords for user authentication. Filename is the absolute path to the user file.
The user file is keyed on username.The value for a user is a password encrypted with Crypt(), optionally followed by a colon and arbitrary data. The colon and data that follow it will be ignored. by the server.


Make sure that the AuthDBUserFile is stored outside the document tree of the Web server, and do not put it in the directory that it protects. Otherwise, clients will be able to download the AuthDBUserFile.

AuthDBAthoritative

Syntax: AuthDBAuthoritive yes|no
Context: object
Module: mod_auth_db

If more than one authentication method is configured for the same object, including DB authentication, then AuthSBAthoritative sets whether DB is the authoritative authentication method. By default, Stronghold executes authentication methods in the reverse order of the <ServerRoot>/scr/Configuration module list

Use this directive to override this behavior. For Example, if AuthDBAuthoritative is set to "no" and authentication fails, then Stronghold attempts authentication using the method implemented by the next highest authentication module in the Configuration list. If it is set to "yes" and authentication fails, Stronghold ends the authentication process and returns a status code of 403 (forbidden).

Database Manager Authentication

These directives control user authentication and access control using a database manager (DBM).

AuthDBMGroupFile

Syntax: AuthDBMGroupFile filename
Context: Object
Module: mod_auth_dbm
AllowOverride: AuthConfig

The AuthDBMGroupFile directive sets the name of a DBM file containing the list of user groups for user authentication. Filename is the absolute path to the group file.

The group file is keyed on the username. The value for a user is a comma-separated list of the groups to which the user belongs. The value cannot include spaces or colons.


Make sure that the
AuthDBMGroupFile is stored
outside the document tree of the Web server, and do not put it in the directory that it protects. Otherwise, clients will be able to download the
AuthDBMGroupFile.

AuthDBMuserFile

Syntax: AuthDBMuserFile filename
Context: object
Module: mod_auth_dbm
AllowOverride: AuthConfig

The AuthDBMuserFile directive sets the name of a DBM file containing the list of users and passwords for user authentication. Filename is the absolute path to the user file.

The user file is keyed on the username. The value for a user is a password encrypted with crypt(), optionally followed by a colon and arbitrary data. The colon and the data following it will be ignored by the server.


Make sure that the AuthDBMUserFile is stored outside the document tree of the Web server, and do not put it in the directory that it protects. Otherwise, clients will be able to download the AuthDBMUserFile.

AuthDBMAuthoritative

Syntax: AuthDBMAuthoritive yes|no
Context: object
Module: mos_auth_db

If more than one authentication method is configured for the same object, including DBM authentication, then AuthDBMAuthoritative sets whether DBM is the authoritative authentication method. By default, Stronghold executes authentication methods in the recers order of the ServerRood/scr/Configuration module list. Use this directive to override this behavior.

For example, if AuthDBMAuthoritative is set to "no" and authentication fails, then Stronghold attempts authentication using the method implemented by the next highest authentication module in the Configuration list. If it is set to "yes" and authentication fails, Stronghold ends the authentication process and returns a status code of 403 (forbidden).

Digest Authentication

These directives perform MD5 digest authentication. When AuthType is set to "digest". Stronghold uses the AuthDigestFile for authentication. Digest authentication provides a more secure password system, but only works with supporting browsers.

AuthDigestFile

Syntax: AuthDigestFile filename
Context: object
Module: mod_digest
AllowOverride: AuthConfig

When AuthType is set to Digest, AuthDigestFile sets the text file containing the list of user ID/password checksums for digest authentication. Filename is the absolute path to that file. The digest file uses a special format and can be created using the <ServerRoot>/bin/ht/digest utility.

SSL Certificate Authentication and Access Control

When AuthType is set to "cert," Stronghold performs SSL certificate authentication based on the parameters specified by these directives. Client authentication is discussed in detail in Chapter 2, "Authentication and Encryption.".

SSLCACertificatePath

Syntax: SSLCACertificatePath directory
Context: server config, virtual host
Module: mod_ssl
Default: none

This directive sets the directory where you keep the Certificates of Certification Authorities (CAs) whose clients you deal with. These are used to verify the client certificate on Client Authentication.

The files in this directory have to be PEM-encoded and are accessed through hash filenames. So usually you can't just place the Certificate files there: you also have to create symbolic links named hash-value.N. And you should always make sure this directory contains the appropriate symbolic links.

Use the Makefile which comes with mod_ssl to accomplish this task.

Example:

SSLCACertificatePath /usr/local/apache/conf/ssl.crt/

SSLCACertificatFile

Syntax: SSLCACertificateFile
Context: server config, virtual host
Module: mod_ssl
Default: none

This directive sets the all-in-one file where you can assemble the Certificates of Certification Authorities (CA) whose clients you deal with. These are used for Client Authentication. Such a file is simply the concatenation of the various PEM-encoded Certificate files, in order of preference. This can be used alternatively and/or additionally to SSLCACertificatePath.

Example:

SSLCACertificateFile /usr/local/apache/conf/ssl.crt/ca-bundle-client.crt

SSLVerifyClient

Syntax: SSLCVerifyClient level
Context: server config, virtual host, directory, .htaccess
Module: mod_ssl
Default: none
AllowOverride: AuthConfig

This directive sets the Certificate verification level for the Client Authentication. Notice that this directive can be used both in per-server and per-directory context. In per-server context it applies to the client authentication process used in the standard SSL handshake when a connection is established. In per-directory context it forces a SSL renegotation with the reconfigured client verification level after the HTTP request was read but before the HTTP response is sent.

The following levels are available for level:

In practice only levels none and require are really interesting, because level optional doesn't work with all browsers and level optional_no_ca is actually against the idea of authentication (but can be used to establish SSL test pages, etc.)

Example:

SSLVerifyClient require

SSLVerifyDepth

Syntax: SSLVerifyDepth number
Context: server config, virtual host, directory, .htaccess
Module: mod_ssl
Default: SSLVerifyDepth 1
<>AllowOverride: AuthConfig

This directive sets how deeply mod_ssl should verify before deciding that the clients don't have a valid certificate. Notice that this directive can be used both in per-server and per-directory context. In per-server context it applies to the client authentication process used in the standard SSL handshake when a connection is established. In per-directory context it forces a SSL renegotation with the reconfigured client verification depth after the HTTP request was read but before the HTTP response is sent.

The depth actually is the maximum number of intermediate certificate issuers, i.e. the number of CA certificates which are max allowed to be followed while verifying the client certificate. A depth of 0 means that self-signed client certificates are accepted only, the default depth of 1 means the client certificate can be self-signed or has to be signed by a CA which is directly known to the server (i.e. the CA's certificate is under SSLCACertificatePath), etc.

Example:

SSLVerifyDepth 10

SSLRequireSSL

Syntax: SSLRequireSSL
Context: directory, .htaccess
Module: mod_ssl
Default: none
AllowOverride: Options

This directive forbids access unless HTTP over SSL (i.e. HTTPS) is enabled for the current connection. This is very handy inside the SSL-enabled virtual host or directories for defending against configuration errors that expose stuff that should be protected. When this directive is present all requests are denied which are not using SSL.

Example:

SSLRequireSSL

SSLRequire

Syntax: SSLRequire expression
Context: sirectory, .htaccess
Module: mod_ssl
Default: none
AllowOverride: AuthConfig

This directive specifies a general access requirement which has to be fulfilled in order to allow access. It's a very powerful directive because the requirement specification is an arbitrarily complex boolean expression containing any number of access checks.

The expression must match the following syntax (given as a BNF grammar notation):

expr ::= "true" | "false"
| "!" expr
| expr "&&" expr
| expr "||" expr
| "(" expr ")"
| comp
comp ::= word "==" word | word "eq" word
| word "!=" word | word "ne" word
| word "<" word | word "lt" word
| word "<=" word | word "le" word
| word ">" word | word "gt" word
| word ">=" word | word "ge" wordly decided that
| word "in" "{" wordlist "}"
| word "=~" regex
| word "!~" regex
wordlist ::= word
| wordlist "," word
word ::= digit
| cstring
| variable
| function
digit ::= [0-9]+
cstring ::= "..."
variable ::= "%{" varname "}"
function ::= funcname "(" funcargs ")"

While for varname any variable from Table 3 can be used. Finally for funcname the following functions are available:

Notice that expression is first parsed into an internal machine representation and then evaluated in a second step. Actually, in Global and Per-Server Class context expression is parsed at startup time and at runtime only the machine representation is executed. For Per-Directory context this is different: here expression has to be parsed and immediately executed for every request.

Example:

SSLRequire ( %{SSL_CIPHER} !~ m/^(EXP|NULL)-/ \
and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20 ) \
or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/

Standard CGI/1.0 and Apache variables:




HTTP_USER_AGENT

PATH_INFO

AUTH_TYPE

HTTP_REFERER

QUERY_STRING

SERVER_SOFTWARE

HTTP_COOKIE

REMOTE_HOST

API_VERSION

HTTP_FORWARD

REMOTE_IDENT

TIME_YEAR

HTTP_HOST

IS_SUBREQ

TIME_MON

HTTP_PROXY_CONNECTION

DOCUMENT_ROOT

TIME_DAY

HTTP_ACCEPT

SERVER_ADMIN

TIME_HOUR

HTTP:headername

SERVER_NAME

TIME_MIN

THE_REQUEST

SERVER-PORT

TIME_SEC

REQUEST_METHOD

SERVER_PROTOCOL

TIME_WDAY

REQUEST_SCHEME

REMOTE_ADDR

TIME

REQUEST_URI

REMOTE-USER

ENV:variablename

REQUEST_FILENAME




HTTPS

SSL_CLIENT_M_VERSION

SSL_SERVER_M_VERSION

SSL_CLIENT_M_SERIAL

SSL_SERVER_M_SERIAL

SSL_PROTOCOL

SSL_CLIENT_V_START

SSL_SERVER_V_START

SSL_SESSION_ID

SSL_CLIENT_V_END

SSL_SERVER_S_DN

SSL_CIPHER

SSL_CLIENT_S_DN

SSL_SERVER_S_DN

SSL_CIPHER_EXPORT

SSL_CLIENT_S_DN_C

SSL_SERVER_S_DN_C

SSL_CIPHER_USEKEYSIZE

SSL_CLIENT_S_DN_L

SSL_SERVER_S_DN_L

SSL_VERSION_LIBRARY

SSL_CLIENT_S_DN_O

SSL_SERVER_S_DN_O

SSL_VERSION_INTERFACE

SSL_CLIENT_S_DN_OU

SSL_SERVER_S_DN_OU

SSL_CLIENT_S_DN_CN

SSL_SERVER_S_DN_CN

SSL_CLIENT_S_DN_T

SSL_SERVER_S_DN_T

SSL_CLIENT_S_DN_I

SSL_SERVER_S_DN_I

SSL_CLIENT_S_DN_G

SSL_SERVER_S_DN_G

SSL_CLIENT_S_DN_S

SSL_SERVER_S_DN_S

SSL_CLIENT_S_DN_D

SSL_SERVER_S_DN_D

SSL_CLIENT_S_DN_UID

SSL_SERVER_S_DN_UID

SSL_CLIENT_S_DN_Email

SSL_SERVER_S_DN_Email

SSL_CLIENT_I_DN

SSL_SERVER_I_DN

SSL_CLIENT_I_DN_C

SSL_SERVER_I_DN_C

SSL_CLIENT_I_DN_ST

SSL_SERVER_I_DN_ST

SSL_CLIENT_I_DN_L

SSL_SERVER_I_DN_L

SSL_CLIENT_I_DN_O

SSL_SERVER_I_DN_O

SSL_CLIENT_I_DN_OU

SSL_SERVER_I_DN_OU

SSL_CLIENT_I_DN_CN

SSL_SERVER_I_DN_CN

SSL_CLIENT_I_DN_T

SSL_SERVER_I_DN_T

SSL_CLIENT_I_DN_I

SSL_SERVER_I_DN_I

SSL_CLIENT_I_DN_G

SSL_SERVER_I_DN_G

SSL_CLIENT_I_DN_S

SSL_SERVER_I_DN_S

SSL_CLIENT_I_DN_D

SSL_SERVER_I_DN_D

SSL_CLIENT_I_DN_UID

SSL_SERVER_I_DN_UID

SSL_CLIENT_I_DN_Email

SSL_SERVER_I_DN_Email

SSL_CLIENT_A_SIG

SSL_SERVER_A_SIG

SSL_CLIENT_A_KEY

SSL_SERVER_A_KEY

SSL_CLIENT_CERT

SSL_SERVER_CERT

SSL_CLIENT_CERT_CHAINn

SSL_CLIENT_VERIFY

Table 3: Available Variables for SSLRequire

SSL_Group

Syntax: SSL_Group groupname "field operator match"
SSL_Group creates aliases that you can use to group client certificates that receive identical treatment from SSL. For example, you can create groups of certificates whose Organizational Unit fields are identical, then use SSL_Require to indicate that only certificates in that group can access the virtual host assigned to the organization unit:

SSL_Group AdminGroup "ou EQ Administration"

<VirtualHost 140.233.117.80:443>
<Location />
SSL_Require AdminGroup
</Location>
</VirtualHost>

SSLFakeBasicAuth

Syntax: SSLFakeBasicAuth

SSLFakeBasicAuth is not recommended.

Host-Based Access Control

In many cases, you may want to allow only certain hosts to access your hosts, directories, or files. The mod_access modules allow you to control access based on IP address and hostnames, as well as environment variables. For example:

BrowserMatch ^KnockKnock/2.0 let_me_in
<Directory /docroot>
order deny,allow
deny from all
allow from env=let_me_in
</Directory>

In this example, all browsers with the User-Agent string "KnockKnock/2.0" are allowed access, and all others are denied.

Host-based access control is not as reliable as certificate authentication, because hackers can "spoof" hosts, pretending to send requests from one of the hosts you allow. However, we do recommend you use these directives to control access to server status and configuration information, like this:

<Location /Stronghold-status>
order deny, allow
deny from all
allow from Yourhost.com
<Location>

<Location /Stronghold-info>
order deny, allow
deny from all
allow from yourhost.com
<Location>

With this configuration, only users on your host can access server information.

order

Syntax: order allow,deny|deny,a,low|mutual-failure
Context: object
Module: mod_access
AllowOverride: Limit

Order, used in conjuction with allow and deny, provides host-based access control The value is a coma-separated list that indicates which directive takes priority. The one that does not have priority usually takes the value "all." for example,

order allow,deny

allows access from a few hosts and deny access from all other hosts. If you enter

order deny,allow

then you can deny access from a few hosts and allow access from all others. The order you choose depends on the nature of your site. If the value is "mutual-failure," then access is limited to hosts that appear in the allow list and not in the deny list.

satisfy

Syntax: satisfy any|all
Context: object
Module: core
AllowOverride: AuthConfig

This directive sets the access policy if both allow and Require are used. The value can be either "all" or "any."

allow

Syntax: allow from all|env=variable|host1[host2...]
Context: object
Module: mod_access
AllowOverride: Limit

The value for the allow directive can either be "all" to allow access from all hosts not excluded by the deny directive, "env=cariable" to allow access based on the existence of an environment variable, or a list of hosts which are allowed to access your server.

A host can be designated by

A CIDR specification is similar to a network/submask pair except that it consists of an network IP and an IP prefix. For example,

allow from 10.1.0.0/16

is the same as

allow from 10.1.0.0/255.255.0.0

For more information about classless inter-domain routing, see the CIDR FAQ at
http://www.ibm.net.il/~hank/cidr.html

deny

Syntax: deny from all|env=variable|hostname1[hostname2...]
Context: object
Module: mod-access
AllowOverride: Limit

The value for the deny directive can either be "all" to deny access from all hosts not included by the allow directive, "env=cariable" to allow access based on the existence of an environment variable, or a list of hosts which are denied access to your server.

A host can be designated by

For more information about classless inter-domain routing, see the CIDR FAQ at
http://www.ibm.net.il/~hank/cidr.html

Anonymous Logins

The decision to allow anonymous logins with mod_auth_anon depends on your security policy. Although anonymous logins do not provide access control in the strict sense, they can provide an effective user tracking mechanism. User IDs do not need to correspond to logins on the server machine (thus the magic "anonymous" user ID), and the only password required is a valid email address.

Anonymous

Syntax: Anonymous UserID1[userID2...]
Context: object
Module: mod_auth_anon
AllowOverride: AuthConfig

Anonymous gives a list of one or more user IDs that are allowed for anonymous logins. "Anonymous," "anonymous," and "ANONYMOUS" should be among these.

Anonymous_MustGiveEmail

Syntax: Anonymous_MustGiveEmail on|off
Context: object
Module: mod_auth_anon
AllowOverride: AuthConfig

When set to "on," this directive requires all users who enter a valid value for Anonymous in the User field to also enter an email address in the Password field.

Anonymous_LogEmail

Syntax: Anonymous_LogEmail on|off
Context: object
Module: mod_auth_anon
AllowOverride: AuthConfig

When this directive is on, the anonymous "password" (usually an email address) is logged to the user ID field of the access log.

Anonymous_VerifyEmail

Syntax: Anonymous_VerifyEmail on|off
Context: object
Module: mod_auth_anon
AllowOverride: AuthConfig

When this directive is on, Stronghold checks the "Password." If it does not contain at least on "@" and a ".", Stronghold rejects it and the client prompts the user to try again. Although this check isn't foolproof, it encourages user to enter valid email addresses.

Anonymous_NoUserID

Syntax: Anonymous_NoUserID on|off
Context: object
Module: mod_auth_anon
AllowOverride: AuthConfig

When this directive is on, users ar allowed to leave the user ID field empty and enter only an email address.

Anonymous_Authoritative

Syntax: Anonymous_Authoritative on|off
Context: object
Module: mod_auth_anon
AllowOverride: AuthConfig

When this directive is on, access is denied of the given user ID does not match one of the values for Anonymous. If user ID fails, Stronghold resorts to the authorization method specified by AuthType.


Server Authentication

These directives controls the authentication of your hosts. Server authentication occurs at the start of every SSL transactions, regardless of whether client authentication is enabled. Each host on the server must provide a valid certificate for each SSL session. There are two kinds of server authentication:

Site Authentication

Site authentication refers to the client-side authentication of your server hosts. Site authentication is required for all SSL transactions.

SSLCertificateFile

Syntax: SSLCertificateFile filename
Context: server config, virtual host
Module: mod_ssl
Default: none

This directive points to the PEM-encoded Certificate file for the server and optionally also to the corresponding RSA or DSA Private Key file for it (contained in the same file). If the contained Private Key is encrypted the passphrase dialog is forced at startup time. This directive can be used up to two times (referencing different filenames) when both a RSA and a DSA based server certificate is used in parallel.

Example:

SSLCertificateFile /usr/local/apache/conf/ssl.crt/server.crt

SSLCertificateKeyFile

Syntax: SSLCertificateKeyFile filename
Context: server config, virtual host
Module: mod_ssl
Default: none

This directive points to the PEM-encoded Private Key file for the server. If the Private Key is not combined with the Certificate in the SSLCertificateFile, use this additional directive to point to the file with the stand-alone Private Key. When SSLCertificateFile is used and the file contains both the Certificate and the Private Key this directive need not be used. But we strongly discourage this practice.

Instead we recommend you to separate the Certificate and the Private Key. If the contained Private Key is encrypted, thepassphrase dialog is forced at startup time. This directive can be used up to two times (referencing different filenames) when both a RSA and a DSA based private key is used in parallel.

Example:

SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/server.key

SSLCertificateChainFile

Syntax: SSLCertificateChainFile filename
Context: server config, virtual host
Module: mod_ssl
Default: none

This directive sets the optional all-in-one file where you can assemble the certificates of Certification Authorities (CA) which form the certificate chain of the server certificate. This starts with the issuing CA certificate of of the server certificate and can range up to the root CA certificate. Such a file is simply the concatenation of the various PEM-encoded CA Certificate files, usually in certificate chain order.

This should be used alternatively and/or additionally to SSLCACertificatePath for explicitly constructing the server certificate chain which is sent to the browser in addition to the server certificate. It is especially useful to avoid conflicts with CA certificates when using client authentication.

Because although placing a CA certificate of the server certificate chain into SSLCACertificatePath has the same effect for the certificate chain construction, it has the side-effect that client certificates issued by this same CA certificate are also accepted on client authentication. That's usually not one expect.

But be careful: Providing the certificate chain works only if you are using a single (either RSA or DSA) based server certificate. If you are using a coupled RSA+DSA certificate pair, this will work only if actually both certificates use the same certificate chain. Else the browsers will be confused in this situation.

Example:

SSLCertificateChainFile /usr/local/apache/conf/ssl.crt/ca.crt

Proxy Authentication

These directives control server-side authentication during mirror proxy transactions. On the server side of a mirror proxy transaction, the server uses client certificates. Proxy authentication is discussed in greater detail in "Proxy Authentication" on page 2-19


Never use any client certificate other than one specifically created for the proxy server. Do not use a certificate created for a browser.

SSLProxyMachineCertPath path

Syntax: SSLProxyMachineCertPath path

Context: server

Module: mod_ssl

When Stronghold Web Server needs a proxy client certificate to connect to a remote server, it draws clientcertificates and thier keys from the directory specified by SSLProxyMachineCertPath. If you want to prioritize the certificates you send to remote servers, use SSLProxyMachineCertFile instead.

SSLProxyMachineCertFile

Syntax: SSLProxyMachineCertFile
Context: server
Module: mod_ssl

When Stronghold Web Server needs a proxy client certificate to connect to a remote server, it draws client certificates and thier keys from the file specified by SSLProxyMachineCertFile. The file contains one or more PEM-encoded client certificates, in order of preference. When a remote server requires a proxy client certificate, it sends a list of CAs whose signatures it accepts. Stronghold Web Server searches the SSLProxyMachineCertFile for certificates signed by those CAs and sends the first one it finds.

SSLProxyCACertificatePath

Syntax: SSLProxyCACertificatePath path
Context: host
Module: mod_ssl

This directive sets the path to the directory where trusted CA root certificates are kept. Store the CA root certificates for server certification here.

SSLProxyCACertificateFile

Syntax: SSLProxyCACertificateFile filename
Context: host
Module: mod_ssl

This directive sets the trusted CA root certificate file. Unlike SSLProxyCACertificatePath, it specifies a certificate file rather than a certificate directory. The file contains one or more PEM-encoded CA certificates.

SSLProxyVerifyDepth

Syntax: SSLProxyVerifyDepth n
Context: host
Module: mod-ssl

Certification Authorities are certified by other CAs, forming a chain of certificates that the server can follow for progressively decisive verification. SSLProxyVerifyDepth sets the number of CAs the server will follow in this chain when verifying server certificates.


Encryption

Encryption directives set the acceptable parameters for ciphers. Use these directives to configure Stronghold Web Server 3.0 to use only the ciphers that comply with your security policy.

Stronghold Web Server 3.0 interoperates with the following ciphers

Cipher-Type Security Description

DES-CBC3-MD5

Strong

3DES in CBC, MD5 hash, 168-bit key

DES-CBC3-SHA

Strong

3DES in CBC, SHA hash, 168-bit key

EDH-RSA-DES-CBC3-SHA

Strong

Ephemeral Diffie-Helman with RSA authentication, 3DES in CBC, SHA hash, 168-bit key

EDH-DSS-DES-CBC3-SHA

Strong

Ephemeral Diffie-Helman with DSS authentication, 3DES in CBC, SHA hash, 168-bit key

RC4-MD5

Moderate

RC4 cipher, MD5 hash, 128-bit key

RC4-SHA

Moderate

RC4 cipher, SHA hash, 128-bit key (SSLv3/TLSv1 only)

RC2-CBC-MD5

Moderate

RC2-compatible cipher in CBC mode, MD5 hash, 128-bit key

DES-CBC-MD5

Moderate

DES in CBC, MD5 hash, 56-bit key

DES-CBC-SHA

Moderate

DES in CBC, SHA hash, 56-bit key

EDH-RSA-DES-CBC-SHA

Moderate

Ephemeral Diffie-Helman with RSA authentication, DES in CBC, SHA hash, 56-bit key

EDH-DSS-DES-CBC-SHA

Moderate

Ephemeral Diffie-Helman with DSS authentication, DES in CBC, SHA hash, 56-bit key

EXP-DES-CBC-SHA

Weak

DES in CBC, SHA hash, 40-bit key (SSLv3/TLSv1 only)

EXP-RC4-MD5

Weak

Weakened for export, RC4 cipher, MD5 hash, 40-bit key

EXP-RC2-CBC-MD5

Weak

Weakened for export, RC2-compatible cipher in CBC mode, MD5 hash, 40-bit key

EXP-EDH-RSA-DES-CBC

Weak

Weakened for export, Ephemeral Diffie-Helman with RSA authentication, DES in CBC, 40-bit key

EXP-EDH-DSS-DES-CBC-SHA

Weak

Weakened for export, Ephemeral Diffie-Helman with DSS authentication, DES in CBC, 40-bit key

Notice that some ciphers are only compatible with SSLv3 and TLSv1. In order to use those ciphers, you must enable one or both of those protocols using the SSLRoot directive.

The values for the encryption directives (except SSLRequireCipher, which can also take aliases as values) are colon-separated lists of cipher names, as they appear in the table above.

You can see the default list of ciphers by running the following command:

OpenSSL ciphers -v

SSLCipherSuite

Syntax: SSLSCipherSuite cipher-spec
Context: server config, vortual host, directory, .htaccess
Module: mod_ssl
Default: SSLCipherSuite
All: !ADH:RC4+RSA:+HIGH:+MEDIUM:+SSLv2:+EXP
AllowOverride: AuthConfig
Compatibility: This supercedes SSLCipherList See Compatibility Directives on page 7-115

This complex directive uses a colon-separated cipher-spec string consisting of OpenSSL cipher specifications to configure the Cipher Suite the client is permitted to negotiate in the SSL handshake phase. Notice that this directive can be used both in per-server and per-directory context. In per-server context it applies to the standard SSL handshake when a connection is established. In per-directory context it forces a SSL renegotation with the reconfigured Cipher Suite after the HTTP request was read but before the HTTP response is sent. An SSL cipher specification in cipher-spec is composed of 4 major attributes plus a few extra minor ones:

An SSL cipher can also be an export cipher and is either a SSLv2 or SSLv3/TLSv1 cipher (here TLSv1 is equivalent to SSLv3). To specify which ciphers to use, one can either specify all the Ciphers, one at a time, or use aliases to specify the preference and order for the ciphers.

Now where this becomes interesting is that these can be put together to specify the order and ciphers you wish to use. To speed this up there are also aliases (SSLv2, SSLv3, EXP, LOW, MEDIUM, HIGH) for certain groups of ciphers. These tags can be joined together with prefixes to form the cipher-spec. Available prefixes are:

A simpler way to look at all of this is to use the "openssl ciphers -v" command which provides a nice way to successively create the correct cipher-spec string. The default cipher-spec string is "ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP" which means the following: first, remove from consideration any ciphers that do not authenticate, i.e. for SSL only the Anonymous Diffie-Hellman ciphers. Next, use ciphers using RC4 and RSA. Next include the high, medium and then the low security ciphers. Finally pull all SSLv2 and export ciphers to the end of the list.

$ openssl ciphers -v 'ALL:!ADH:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP'
NULL-SHA SSLv3 Kx=RSA Au=RSA Enc=None Mac=SHA1
NULL-MD5 SSLv3 Kx=RSA Au=RSA Enc=None Mac=MD5
EDH-RSA-DES-CBC3-SHA SSLv3 Kx=DH Au=RSA Enc=3DES(168) Mac=SHA1
... ... ... ... ...
EXP-RC4-MD5 SSLv3 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export
EXP-RC2-CBC-MD5 SSLv2 Kx=RSA(512) Au=RSA Enc=RC2(40) Mac=MD5 export
EXP-RC4-MD5 SSLv2 Kx=RSA(512) Au=RSA Enc=RC4(40) Mac=MD5 export

The complete list of particular RSA & DH ciphers for SSL is given in Table 2.

Example:

SSLCipherSuite RSA:!EXP:!NULL:+HIGH:+MEDIUM:-LOW

Cipher-Tag protocol Key Ex. Auth. En. MAC Type

RSA Ciphers:





DES-CBC3-SHA

SSLv3


RSA

RSA 3DES(168)

SHA1


DES-CBC3-MD5

SSLv2

RSA


RSA 3DES(168)

MD5


IDEA-CBC-SHA

SSLv3

RSA

RSAIDEA(128)

SHAI


RC4-SHA

SSLv3

RSA

RSA RC4(128)

SHAI


RC4-MD5

SSLv3

RSA

RSA RC4(128)

MD5


IDEA-CBC-MD5

SSLv2

RSA

RSA IDEA(128)

MD5


RC2-CBC-MD5

SSLv2

RSA

RSA RC2(128)

MD5


RC4-MD5

SSLv2

RSA

RSA RC4(128)

MD5


DES-CBC-SHA

SSLv3

RSA

RSA DES(56)

SHAI


RC4-64-MD5

SSLv2

RSA

RSA RC4(64)

MD5


DES-CBC-MD5

SSLv2

RSA

RSA DES(56)

MD5


EXP-DES-CBC-SHA

SSLv3

RSA(512)

RSA DES(40)

SHAI

export

EXP-RC2-CBC-MD5

SSLv3

RSA(512)

RSA RC2(40)

MD5

export

EXP-RC4-MD5

SSLv3

RSA(512)

RSA RC4(40)

MD5

export

EXP-RC2-CBC-MD5

SSLv2

RSA(512)

RSA RC2(40)

MD5

export

EXP-RC4-MD5

SSLv2

RSA(512)

RSA RC4(40)

MD5

export

NULL-SHA

SSLv3

RSA

RSA None

SHAI


NULL-MD5

SSlv3

RSA

RSA None

MD5


Diffe-Hellman Ciphers:






ADH-DES-CB3-SHa

SSLv3

DH

None 3DES(168)

SHAI


ADH-DES-CBC-SHA

SSLv3

DH

None DES(56)

SHAI


ADH-RC4-MD5

SSLv3

DH

None RC4(128)

MD5


EDH-DSS-DES-SBC3-SHA

SSLv3

DH

RSA 3DES(168)

SHAI


EDH-DSS-DES-CBC3-SHA

SSLv3

DH

3DES(168)

SHAI


EDH-RSA-DES-CBC-SHA

SSLv3

DH

RSA DES(56)

SHAI


EDH-DSS-DES-CBC-SHA

SSLv3

DH

DSS DES(56)

SHAI


EXP-EDH-RSA-DES-CBC-SHA

SSLv3

DH(512)

RSA DES(40)

SHAI

export

EXP-EDH-DSS-DES-CBC-SHA

SSLv3

DH(512)

DSS DES(40)

SHAI

export

EXP-ADH-DES-CBC-SHA

SSLv3

DH(512)

NONe DES(40)

SHAI

export

EXP-ADH-RC4-MD5

SSLv3

DH(512)

None(40)

MD5

export

SSLProxyCipherList

Syntax: SSLProxyCipherList cipher 1[:cipher2:cipher3...]
Context: host
Module: mod_ssl

This directive specifies a list of permitted cipher types for server-side SSL proxy transactions, in order of preference. If the server does not support any of the specified cipher-types, it returns an error message. The value for cipher can be:

  • a cipher name
  • a cipher alias

    SSLRequireCipher

    Syntax: SSLRequireCipher cipher
    Context: object
    Module: mod_ssl

    SSLRequireCipher specifies a cipher type that is required for access to a directory or other object. Each SSLRequireCipher directive takes only one argument; enter multiple SSLRequireCipher directives on seperate lines for multiple required cipher types. If the client dies not support any of the required cipher types, the server returns an error message.

    SSLBanCipher

    Syntax: SSLBanCipher cipher
    Context: object
    Module: mod_ssl

    Some cipher types may not meet the security requirements for certain server directories. This directive specifies ciphers that are unacceptable to the object. Each SSLBanCipher directive takes only one argument; enter multiple SSLBanCipher directives on separate lines for multiple cipher types that are not acceptable.


    Compatibility Directives

    SSLFlag

    Syntax: SSLFlag on|off
    Context: host
    Module: mod_ssl

    This directive is replaced with SSLEngine

    When SSLFlag is set to "on," SSL and TLS functionality is enabled for a host or for the entire server. Set this directive to "off" to temporarily deactivate SSL.

    ScriptLog

    Syntax: ScriptLog filename
    Context: server
    Module: mod_cgi

    This directive is replaced with SSLLog and SSLLogLevel

    This directive specifies the CGI error log file. If it is absent, CGI does not log errors. Filename can be an absolute path, or a path relative to <ServerRoot>.

    ScriptLogLength

    Syntax: ScriptLogLength bytes
    Context: server
    Module: mod_cgi

    This directive is replaced with SSLLog and SSLLogLevel

    ScriptLogLength limits the size of the CGI error log in bytes. when the log file reaches this size, CGI error logging stops. When this occurs, you must move the old log file, CGI then creates a new one and continues logging errors.

    ScriptLogBuffer

    Syntax: ScriptLogBuffer bytes
    Context: server
    Module: mod_cgi

    This directive is replaced with SSLLog and SSLLogLevel

    This directive limits the size of individual error log entries in bytes to prevent the log file from becoming bloated when it receives large entity bodies.

    SSLSessionLockFile

    Syntax: SSLSessionLockFile filename
    Context: server
    Module: mod_ssl

    This directive is replaced with SSLMutex

    SSLSessionLockFile sets the location of the SSL session cache locking file.

    SSLCipherList

    Syntax: SSLCipher cipher1[:cipher2:cipher3 ...]
    Context: host
    Module: mod_ssl
    Default: This is replaced with SSLCipherSuite

    This directive (also formerly SSLRequireCipher) specifies a list of permitted cipher types for initial SSL transmissions, in order of preference. This list applies only when the requested object does not have its own SSLRequireCipher or SSLBanCipher directives. As of Stronghold 3.0, SSLCipherSuite is the recommended way to specify ciphers.

    SSL_Connect

    Syntax: SSL_Connect on|off
    Context: host
    Module: mod_ssl

    This directive is equivalent to SSLFlag when set to "on", It enables SSL transactions fro the server.

    SSL_KeyFile

    Syntax: SSL_KeyFile filename
    Context: host
    Module: mod_ssl

    This directive is equivalent to SSLCertificateKeyFile, and it sets the filename of the key pair for a host.

    SSL_CertFile

    Syntax: SSL_CertFile filename
    Context: host
    Module: mod_ssl

    This directive is equivalent to SSLCertificateFile, and it sets the filename of the certificate file for a host.

    SSL_CipherSuite

    Syntax: SSL_CipherSuite cipher1[:cipher2...]
    Context: host
    Module: mod_ssl

    This directive is equivalent to SSLRequireCipher, and its value is a colon-separated list of ciphers that are acceptale for an object or host.

    SSL_ClientAUth

    Syntax: SSL_ClientAuth off|requested|required|paranoid
    Context: host
    Module: mod_ssl

    This directive is equivalent to SSLVerifyClient, and it sets the degree of client authentication required for an object or host.

    SSL_X0509VerifyDepth

    Syntax: SSL_X0509VerifyDepth
    Context: host
    Module: mod_ssl

    This directive is equivalent to SSLVerifyDepth, and it sets the number of CAs the server will verify when verifying client certificates..