[Top] [Prev] [Next] [Last]
Download PDF:   US   UK
Download Postscript:   US   UK
Stronghold Web Server 2.4.1 Administration Guide

Chapter 7

Configuration Reference

Once you've installed Stronghold Web Server, you can configure it to suit your unique site. This chapter provides a quick reference to all configuration directives for the core server, its precompiled modules, and its optional modules. The directives control different aspects of server behavior, including

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

For each directive, the Context field gives one of three possible contexts, each denoting a level in the configuration hierarchy:

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

Each directive listing also specifies the module controlled by that directive. If a directive applies to the core Apache server and not to any module, "core" is listed instead of a module name. If you add or remove modules, be sure to comment out the directives that pertain to it, or use the <IfModule> container to configure modules conditionally.




New Directives in Stronghold 2.4.1

The following directives are new in version 2.4.1 of Stronghold Web Server:




General Configuration

Stronghold Web Server's general directives control the most fundamental aspects of the server and its virtual hosts. The server cannot function without these directives:



Server Setup Directives

Most server setup directives are set by the INSTALL.sh script when you install Stronghold Web Server, but you can change them at any time. They are not associated with any modules, but only with Stronghold's server core.



StrongholdLicenseFile



DocumentRoot



ErrorDocument



Listen



Port



User



Group



Options



ServerAdmin



ServerRoot



Include



ServerSignature



Virtual Hosts

Virtual host directives control basic, host-specific attributes of virtual hosts. For more information about virtual host configuration, see "Configuring Virtual Hosts" on page 6-9.



ServerName



NameVirtualHost



ServerAlias



UseCanonicalName



ServerPath



SSL Setup

These directives are necessary 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-105 for the required server authentication directives.



SSLFlag



SSLProtocol



SSLRoot



SSLSessionLockFile



.htaccess Configuration

Although the httpd.conf file can control all aspects of the server, some directives can also reside in per-directory configuration files, usually called .htaccess files. This configuration can be useful if you need to move directories frequently, or if you want 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-directory 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 per-directory configuration files are listed with an "AllowOverride" field. This field gives the value for AllowOverride that enables the use of a particular directive in per-directory configuration files. Directives that are listed with no "AllowOverride" field are never valid in per-directory configuration files.



AccessFileName



AllowOverride



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



SetEnv



SetEnvIf



SetEnvIfNoCase



UnSetEnv



BrowserMatch



BrowserMatchNoCase




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



ServerType



CoreDumpDirectory



SendBufferSize



TimeOut



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, you can use Stronghold's keepalive feature to reserve an open connection for a series of requests and responses. These directives set the parameters of Stronghold's keepalive functionality.



KeepAlive



MaxKeepAliveRequests



KeepAliveTimeout



Process Control

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



ListenBacklog



LockFile



MaxClients



MaxRequestsPerChild



MaxSpareServers



MinSpareServers



StartServers



Resources

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



RLimitCPU



RLimitMEM



RLimitNPROC



Dynamic Shared Objects

The dynamic shared object module, mod_so, allows the server to load shared object code, including shared object modules, at startup. These directives designate shared object code to be loaded at startup. For more information about using mod_so, see "Dynamic Shared Object Support" on page 8-6.



LoadModule



LoadFile



Dynamic Module Linking

By default, all modules compiled into Stronghold are active, meaning that they all start with the server and can be invoked at any time. However, you can also use Stronghold's dynamic module system by applying the directives in this section. With dynamic modules, you can change the list of active modules without recompiling the server, simply by modifying httpd.conf and restarting Stronghold.



ClearModuleList



AddModule




Proxy Service and Caching

Stronghold can act as a proxy server using mod_proxy. The proxy module is described in more detail in Chapter 4.



ProxyRequests



ProxyRemote



ProxyPass



ProxyPassReverse



ProxyBlock



NoProxy



ProxyDomain



ProxyReceiveBufferSize



ProxyVia



AllowCONNECT



CacheRoot



CacheDirLength



CacheDirLevels



CacheSize



CacheGcInterval



CacheMaxExpire



CacheLastModifiedFactor



CacheDefaultExpire



CacheForceCompletion



NoCache




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 "Using Logs and Reports" on page 1-5.



General Logs

These logs record data about non-SSL transactions.



TransferLog



LogFormat



CustomLog



ErrorLog



LogLevel



CookieLog



HostnameLookups



PidFile



ScoreBoardFile



IdentityCheck



ExtendedStatus



AddModuleInfo



SSL Logs

These logs record data about SSL transactions.



SSLLogFile



SSLErrorFile



SSL_CertificateLogDir



CGI Error Logs



ScriptLog



ScriptLogLength



ScriptLogBuffer



Special Logs

Although the modules that generate these logs are compiled into Stronghold by default, we recommend that you use the CustomLog directive instead.



AgentLog



RefererLog



RefererIgnore




Directory Tree

These directives control



Aliases



Alias



AliasMatch



ScriptAlias



ScriptAliasMatch



Redirect



RedirectMatch



RedirectTemp



RedirectPermanent



UserDir



Directory Indexing

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



DirectoryIndex



FancyIndexing



AddIcon



AddIconByType



AddIconByEncoding



DefaultIcon



HeaderName



ReadmeName



IndexIgnore



AddDescription



AddAlt



AddAltByType



AddAltByEncoding



IndexOptions



URL Spell-Checking

When all other modules fail to fulfill 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




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,

index.html.en.gz

denotes an HTML file in English, with gzip encoding. This naming scheme allows Stronghold to interpret filenames and carry out the file handling directives in this section:



Filetypes

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



MimeMagicFile



TypesConfig



AddType



ForceType



AddEncoding



AddLanguage



DefaultType



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 A.



ContentDigest



MetaFiles



MetaDir



MetaSuffix



ExpiresActive



ExpiresByType



ExpiresDefault



Header



ServerTokens



Handlers



AddHandler



SetHandler



Action



Script



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.engelschall.com/sw/mod_rewrite/doc/mod_rewrite/toc.html.



RewriteEngine



RewriteLog



RewriteLogLevel



RewriteLock



RewriteOptions



RewriteBase



RewriteMap



RewriteCond



RewriteRule




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



LimitRequestFields



LimitRequestFieldSize



LimitRequestLine



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 considerably content management work, since separate versions of the same material must be organized and maintained.

"Content Negotiation" on page 9-4 provides a more detailed discussion of how content negotiation works.



CacheNegotiatedDocs



LanguagePriority



Session Tracking

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



CookieTracking



CookieExpires



Imagemaps

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



ImapMenu



ImapDefault



ImapBase



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-6.



XBitHack



PHP/FI 2.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 11 explains PHP in detail.



phpShowInfo



phpLastModified



phpLogging



phpDebug



phpUploadTmpDir



phpDbmLogDir



phpSQLLogHost



phpSQLLogDB



phpMsqlLogHost



phpMsqlLogDB



phpAccessDir



phpMaxDataSpace



phpIncludePath



phpAutoPrependFile



phpAutoAppendFile



phpAdaDefDB



phpAdaUser



phpAdaPW



phpEngine



phpXBitHack




Client Authentication and Access Control

Stronghold Web Server 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



Basic Authentication

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



AuthName



Require



AuthGroupFile



AuthUserFile



AuthAuthoritative



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



AuthDBUserFile



AuthDBAuthoritative



Database Manager Authentication

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



AuthDBMGroupFile



AuthDBMUserFile



AuthDBMAuthoritative



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



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 "Client Authentication" on page 2-14.



SSLCACertificatePath



SSLCACertificateFile



SSLVerifyClient



SSLVerifyDepth



RequireSSL



SSL_Require



SSL_Group



SSLFakeBasicAuth



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 allows you to control access based on IP numbers 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 that 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



satisfy



allow



deny



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



Anonymous_MustGiveEmail



Anonymous_LogEmail



Anonymous_VerifyEmail



Anonymous_NoUserID



Anonymous_Authoritative




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



SSLCertificateKeyFile



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-17.

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



SSLProxyMachineCertPath



SSLProxyMachineCertFile



SSLProxyCACertificatePath



SSLProxyCACertificateFile



SSLProxyVerifyDepth




Encryption

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

Stronghold Web Server 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 SSLProtocol directive.

The values for the encryption directives (except SSLRequiredCiphers, 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:

# ssleay ciphers -v



SSLCipherList



SSLProxyCipherList



SSLRequireCipher



SSLBanCipher




Sioux-Compatible Directives

Configuration directives for Sioux servers are compatible with Stronghold Web Server, with three exceptions: SSL_KeyFileType, SSL_CertFileType, and SSL_FetchKeyPhraseFrom. Although you can keep these directives in your configuration file, they serve no purpose with Stronghold Web Server. The directives in this section are supported by Stronghold Web Server, but have Stronghold-native equivalents that are listed above.

The following Sioux directives are also supported, but their role under Stronghold Web Server is not yet documented:



SSL_Connect



SSL_KeyFile



SSL_CertFile



SSL_CipherSuite



SSL_ClientAuth



SSL_X509VerifyDepth






[Top] [Prev] [Next] [Last]
© 1998 C2Net International
Feedback: stronghold-docs@c2.net
C2Net Logo