Server configuration files
——————————————————————

Chapter 5 - Server Configuration Files
Apache Server Unleashed
by Rich Bowen and Ken Coar

——————————————————————

(*)Server configuration files

The behavior of the Apache server is defined in the server configuration file httpd.conf. This chapter covers all of the directives that can go into that configuration file, and what the do to the server.

——————————————————————

(*)1 file vs 3

Traditionally (since the NCSA days), the configuration was split into three configurations files -- httpd.conf, access.conf, and srm.conf -- but, over time, the distinction between what went into one file or another got increasingly blurred, and so, as of Apache version 1.3.4, the three files are merged into one configuration file. You can still use three files if you really want to, but there's not much point unless you are upgrading from an existing installation and just want to keep your configuration files.

It is typically not such a great idea to use your old configuration files, because you might either miss out on a feature addition between versions, or use syntax for a directive that has been changed for the new version.

In the former way of doing things, httpd.conf was the main server configuration file, access.conf was the file defining access permissions, and srm.conf defined server resources, such as directory mappings, icons, etc. Older server documentation will refer to these files, so it's nice to know what they were for. But even if you have an older version of Apache, and, for some reason, you don't want to upgrade, you can still use the 1-file configuration, by simply concatenating the three files into httpd.conf, and simply keeping empty files called srm.conf and access.conf in the conf directory.

You may also find, if you are running Red Hat Linux, that even with later (> 1.3.4) versions of Apache, they still ship with the 3-file configuration, presumably for backwards compatibility. This is completely unnecessary, and you can go to a 1-file configuration by simply concatenating the three files, and then either have empty files called srm.conf and access.conf, or override the locations of these files with the ResourceConfig and AccessConfig directives, and have it point to /dev/null, or, the NT equivalent, nul.

See http://www.apache.org/info/three-config-files.html for more discussion of this topic.

——————————————————————

(*)Configuration file syntax

There are three types of syntax that go into the Apache configuration files: directives, containers, and comments. directives look like:
DirectiveName parameter1 parameter2 ...

Each directive has a specific purpose, and its own set of directives.

Containers, or sections, are a special case of directives, and are referred to by a variety of names in the documentation. A container looks like an HTML tag. It has an opening tag, such as , and a closing tag, such as . All directives contained within this pair affect the set of files or directories defined by the container, and usually also affect all subdirectories thereof.

An example of a container is shown below.

... directives go here ...

All directives between the two container tags affect the directory /home/httpd/htdocs, and all subdirectories thereof, unless specifically overridden later in the configuration file, or with a .htaccess file.

Comments are any line beginning with the # character. These lines are completely ignored when the file is parsed and loaded into the server. These comments can be as log as you like, in order to conven information about what the configuration file is doing.

——————————————————————

(*)Core and base Configuration directives

There are 192 Apache directives listed in the Apache 1.3 documentation. Most of these are not used in the default configuration files, so if you just use the defaults, you will miss out on a lot of the cool features available.

The following are the available configuration directives which are classified as core or base. In other words, these are all the directives that are available to you if you have a standard installation of Apache, and have not included any non-standard modules.

For each of these directives, the following will be defined:

Syntax: The format of the directive, as it should appear in the configuration file.

Default: The default value of the setting, if any.

Context: Which of the configuration files the directive can appear in. There are 4 possible locations that can be listed here, or some combination of these locations, if they are permitted in more than one location. Note that if you put a directive somewhere it is not permitted, the server will not function correctly, and may not even start. The 4 possible locations are:

(*)server config

The directive may appear in the server configuration files, but not within or sections.

(*)virtual host

The directive may appear in sections.

(*)directory

The directive may appear in sections.

(*).htaccess

The directive may appear in .htaccess files. Depending on override settings that are in effect for the relevant directory, it may or may not actually be honored. Override: Indicates which override must be in effect for the directive to be honored in a .htaccess file. This is, of course, only relevant for directives that are permitted in .htaccess files. See the AllowOverride directive for more details.

Status: Indicates whether this directive is part of the core Apache code, or part of an add-on module. Possible values are:

(*)Core

Indicates that the directive is part of the core Apache code, and so is always available.

(*)Base

Indicates that the directive is part of one of the modules that are usually compiled into the server by default, and so are usually available unless you intentionally removed it.

(*)Extension

Indicates that the directive is part of one of the modules that is available with Apache, but is not compiled in my default, so will not be available unless you intentionally added that module.

(*)Experimental

Indicates that the directive is available with Apache, but it is not really recommended that you use it on a production server, since it is not really supported. For this chapter, we will be focusing on only those directives that are classified as core and base. For other directives, you should see the chapters relating to the modules in which those directives are defined. For a full list of available directives, see the file mod/directives.html in HTML documentation that came with your Apache installation.

Module: Indicates which module defines the directive. Compatibility: Indicates which versions of Apache can be expected to support this directive.

This notation is the same as that used in the Apache documentation, for the sake of consistency.

Keep backup copies of your configuration files before you experiment!

——————————————————————

(*)AccessConfig
Syntax: AccessConfig filename
Default: AccessConfig conf/access.conf
Context: server config, virtual host
Status: core

This directive indicates the location of the access configuration file. The file name is assumed to be relative to the ServerRoot (see ServerRoot) unless an absolute path is specified. The AccessConfig file is read and parsed after the ResourceConfig file. (see ResourceConfig).

If you want to disable this feature, use the following:
AccessConfig /dev/null

or, for Apache on NT,
AccessConfig nul

The default configuration is to have the file actually exist, but contain nothing but a comment explaining that it is there just as a placeholder. Historically, access.conf contained sections that set server configurations on a per-directory basis, but it can actually contain any of the directives that are valid in any server configuration file.

——————————————————————

(*)AccessFileName
Syntax: AccessFileName filename filename ...
Default: AccessFileName .htaccess
Context: server config, virtual host
Status: core
Compatibility: Listing multiple filenames only works in version 1.3 and later.

When serving any document, the server looks for this file in the directory containing the document being served, and in every directory in the path leading up to the file, if access control files are permitted for that directory. For this reason, it is much more efficient to have these settings in the main server configuration files, rather than in these access control files. For example, if you have the following directive:
AccessFileName .control

and are serving the file /docs/modules/core/index.html, the server will read in the files /.control, /docs/.control, /docs/modules/.control, and /docs/modules/core/.control, looking for directives, before serving the file. Directives are overriden by directives in subdirectories.

To disallow the use of access control files, use:

AllowOverride None

Or, you can disallow their use only for a particular portion of your site with:

AllowOverride None

You might want to set this directive to something other than the default value if you are using Apache on NT, as some NT applications have some difficulty with the filename .htaccess. A good alternative is htaccess (without the leading .). Depending on what application you are using to edit your configuration files, this may not matter.

——————————————————————

(*)Action
Syntax: Action action-type cgi-script
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_actions
Compatibility: Action is only available in Apache 1.1 and later

The Action directive allows you to specify a CGI program that will be invoked whenever a file of a particular type is requested. This could be used to process files in a particular way for display. For example, if you had company press releases that had to be displayed in a particular template, you could simply store the text of the press release in a .release file, and then call a formatting CGI program whenever on of these files was requested. To do this, you might put the following directives in your .htaccess file:
AddType text/press-release .release
Action text/press-release /cgi-bin/press_releases/formatter.pl

Each time a .release file is requested, the specified CGI program is called. The particular file requested can be determined by the PATH_INFO and/or PATH_TRANSLATED variables.

——————————————————————

(*)AddAlt
Syntax: AddAlt string file file...
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

This directive is used, when FancyIndexing is turned on, to specify the alternative text that will be displayed, in place of an icon, for an automatically generated index of file names. The file parameter here is a file extension, a partial file name, a wild-card expression, or an actual file name, for which this text is to be displayed. This text is displayed for clients which cannot display images, or which have image loading disabled. AddAlt ``Perl program'' .pl

——————————————————————

(*)AddAltByEncoding
Syntax: AddAltByEncoding string MIME-encoding MIME-encoding...
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

Much like AddAlt, AddAltByEncoding specifies text that will be displayed, in place of an icon, in automatically generated file listings when FancyIndexing is turned on. The MIME-encoding parameter is any valid MIME content-encoding, such as x-texinfo or x-realaudio. This text is displayed for clients which cannot display images, or which have image loading disabled.
AddAltByEncoding "Macintosh compressed file" x-stuffit

——————————————————————

(*)AddAltByType
Syntax: AddAltByType string MIME-type MIME-type ...
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

This sets the alternative text to be displayed in place of an icon in an automatically generated index of files. The MIME-type is any valid content-type, such as image/png or text/html. This text is displayed for clients which cannot display images, or which have image loading disabled.
AddAltByType "Chess portable game notation file" application/x-chess-pgn

——————————————————————

(*)AddDescription
Syntax: AddDescription string file file...
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

Provide a description for individual files in indexes generated by FancyIndexing. The file parameter can be a file extension, a wild-card, a partial file name, or a whole file name.
AddDescription "My ugly mug" /images/photos/rich.jpg

The length of the description parameter is limited to 23 characters because FancyIndexing generates fixed-width columns to display the index information. This number can be increased by an additional 7 characters if IndexOptions SuppressSize is turned on, and another 19 characters if IndexOptions SuppressLastModified is on, for a maximum total of 49 characters.

——————————————————————

(*)AddEncoding
Syntax: AddEncoding MIME-enc extension extension...
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_mime

Map the specified file extensions to the specified MIME-encoding. That is, files with these extensions will be marked as being encoded using that encoding.
AddEncoding x-gzip gz

The above example marks files with the gz file extension as having the x-gzip encoding.

——————————————————————

(*)AddHandler
Syntax: AddHandler handler-name extension extension...
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_mime
Compatibility: AddHandler is only available in Apache 1.1 and later

This directive adds a handler to files with a particular extension. See chapter XX, Handlers.
AddHandler cgi-script pl

The above example adds the handler cgi-script to all files with the extension .pl, which means that all files with that extension are treated as CGI programs, regardless of what directory they appear in.

——————————————————————

(*)AddIcon
Syntax: AddIcon icon name name ...
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

AddIcon sets a particular icon to be displayed in automatically generated directory indexes, when the FancyIndexing directive is in effect. icon should be either a relative URL for the icon, or the format (alttext,url), where alttext is the alternative text that is to appear for clients that do not display graphics. name is either a file extension, a wildcard expression, a partial filename, or a complete filename. It can also be ^^DIRECTORY^^ for directories, or ^^BLANKICON^^ for blank lines. The following examples are from the default httpd.conf.
AddIcon /icons/bomb.gif core
AddIcon /icons/folder.gif ^^DIRECTORY^^
AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip

——————————————————————

(*)AddIconByEncoding
Syntax: AddIconByEncoding icon MIME-encoding MIME-encoding ...
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

This directive sets the icon that will be displayed in automatically generated directory listings, when FancyIndexing is in effect. Unlike AddIcon, which sets icons based on file name, AddIconByEncoding adds icons based on the MIME-encoding of the files. This directive should be used in preference to AddIcon whenever possible.
AddIconByEncoding /icons/compress.xbm x-compress

——————————————————————

(*)AddIconByType
Syntax: AddIconByType icon MIME-type MIME-type ...
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

This sets the icon to display for files of a particular MIME- type, when FancyIndexing is in effect. As with AddIcon, icon is either a relative URL to the icon to be displayed, or the format (alttext, url), where alttext is the alternative text to be displayed in browsers that are not able to display graphics.
AddIconByType (SND,/icons/sound2.gif) audio/*

——————————————————————

(*)AddLanguage
Syntax: AddLanguage MIME-lang extension extension...
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_mime

Maps the given file extensions to a particular language. This is most commonly used for content negotiation, where the server returns the document that most closely matched the preferences set by the client - in this case, the client't preferred language.
AddLanguage en .en
AddLanguage fr .fr

This is set in addition to any encoding set for the file, so that files with multiple file extensions end up doing the right thing.

For example:
AddEncoding AddEncoding x-gzip gz
AddLanguage es .es

With the above directives, the file fubar.gz.es will be seen by the server as a gzip'ed Spanish file, and so will the file fubar.es.gz.

For multilingual sites, you might put several versions of the same file in a directory, distinguishing them with these file extensions. Content negotiation will cause the correct file to be served to the client, based on the language preference set on the client.

See the documentation on mod_negotiation.

——————————————————————

(*)AddModule
Syntax: AddModule module module ...
Context: server config
Status: core
Compatibility: AddModule is only available in Apache 1.2 and later

Activates a module. Some modules are compiled into the server, but are not necessarily loaded.

——————————————————————

(*)AddType
Syntax: AddType MIME-type extension extension...
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_mime

Sets files with particular extensions to the specified MIME-type. This overrides any settings already in effect.
AddType file/download .dnl

You should use this directive rather than editing the mime.types file.

——————————————————————

(*)Alias
Syntax: Alias url-path directory-filename
Context: server config, virtual host
Status: Base
Module: mod_alias

Allows you to place web content in a directory outside of the ordinary DocumentRoot directory. URLs beginning with the specified url-path will be served from the specified directory.
Alias /perldocs /usr/docs/perl/html

For CGI directories, you need to use ScriptAlias.

——————————————————————

(*)AliasMatch
Syntax: AliasMatch regex directory-filename
Context: server config, virtual host
Status: Base
Module: mod_alias
Compatibility: Available in Apache 1.3 and later

This is roughly equivalent to Alias (qv) except that instead of a specific url-path, you can redirect anything that matches a given regular expression. This allows for aliasing several possible spellings (or misspellings) of a URL. The following example provides an alias for /pix, /pics, /pictures, and several other combinations that I might not have anticipates, as long as they begin with ``pix'' or ``pic''.
AliasMatch ^/pi(c|x)(.*) /home/ftp/pub/images

——————————————————————

(*)allow

Notice that there are two forms of this directive - allow and allow from env= - which provide two different (although similar) functions
Syntax: allow from host host ...
Context: directory, .htaccess
Override: Limit
Status: Base
Module: mod_access

Limits which hosts can request content from a particular directory. host can be one of the following: all - All hosts are permitted.
allow from all

A domain name - All hosts that match, or end in, the given string, are permitted. This compares the whole name, so that bowen.com does not match rcbowen.com.
allow from .mk.net

An IP address - A host with that exact IP address is permitted
allow from 192.101.203.72

A partial IP address - The first 1 to 3 bytes of an IP address. All hosts in that subnet are permitted access
allow from 192.101.203

A network and a netmask - Hosts on the included subnets are permitted.
allow from 192.101.0.0/255.255.0.0

A network and a netmask in terms of number of high-order bits.
allow from 192.101.0.0/16

See also deny.

——————————————————————

(*)allow from env=
Syntax: allow from env=variablename
Context: directory, .htaccess
Override: Limit
Status: Base
Module: mod_access
Compatibility: Apache 1.2 and above

Similar to allow, this permits hosts that have a certain environment variable set. This is usually used in conjunction with BrowserMatch or SetEnvIf to allow access to directories based on certain non-obvious requirements. The following example denies access to a directory for all clients except those with a UserAgent string containg 'MSIE'.
BrowserMatch MSIE ie

order deny,allow
deny from all
allow from env=ie

See also deny, BrowserMatch, order, and

——————————————————————

(*)AllowOverride
Syntax: AllowOverride override override ...
Default: AllowOverride All
Context: directory
Status: core

Specifies what parts of the configuration can be overidden in .htaccess files. This can be set to all, in which case all settings in .htaccess files are honored, or none, in which case the file is not even read, or it can be set to any combination of the following.

(*)AuthConfig

Allow use of authorization directives - that is, any directive specifying who can get access to a directory.

(*)FileInfo

Allow use of directives setting document types. Indexes - Allow use of directives controlling automatically generated directory indexes.

(*)Limit

Allow use of directives controlling host access (allow, deny, and order).

(*)Options

Allow use of directives controlling specific directory features (Options and XBitHack).

If you intend to make all configuration settings for the whole server in the configuration files, you should set AllowOverride none. However, if you will have anyone else providing web site content, it is very convenient for them to be able to change directory settings without having access to the configuration files. It also allows you make configuration changes on a per- directory basis without restarting the server.

——————————————————————

(*)AuthAuthoritatived
Syntax: AuthAuthoritative on|off
Context: directory, .htaccess
Default: AuthAuthoritative on
Override: AuthConfig
Status: Base
Module: mod_auth

This says whether the standard authentication rules are autoritative, or if control should be passed to one of the lower lever authentication modules such as mod_auth_db, mod_auth_msql, mod_auth_anon, or mod_auth_dbm.

You should not set this to off unless you are sure that you know what you are doing, as it circumvents the normal methods of protecting web site content. See Chapter XX, Authentication.

——————————————————————

(*)AuthDigestFile
Syntax: AuthDigestFile filename
Context: directory, .htaccess
Override: AuthConfig
Status: Base
Module: mod_digest

Sets the location of the file containg the userIDs and encrypted passwords for authentication using MD5 Digest authentication. See Chapter XX, Authentication.
AuthDigestFile /home/httpd/passwd/.htdigest

You should place this file outside of the document root, so that someone cannot download the file to crack at their leisure.

——————————————————————

(*)AuthGroupFile
Syntax: AuthGroupFile filename
Context: directory, .htaccess
Override: AuthConfig
Status: Base
Module: mod_auth

Sets the location of the file containing group definitions for user authentication. Groups are specified by the group name, followed by a colon, followed by the list of users, separated by spaces.
authgroup: rich tim eddie carol

Each username should correspond to a user in the password file specified by AuthUserFile or AuthDigestFile.

Note that for very large groups, you should consider using AuthDBMGroupFile, which is much more efficient. See Chapter XX, Authentication.
AuthGroupFile /home/httpd/passwd/.htgroup

——————————————————————

(*)AuthType
Syntax: AuthType type
Context: directory, .htaccess
Override: AuthConfig
Status: core

Specifies the type of authentication that is to be used. This should be one of Basic or Digest. Since Digest is not supported by most available browsers, it is recommended that you use Basic for public Internet sites.

head3 AuthUserFile
Syntax: AuthUserFile filename
Context: directory, .htaccess
Override: AuthConfig
Status: Base
Module: mod_auth

Sets the location of the file containing the userIDs and encrypted passwords of users that are to be allowed access to this directory. For very large sets of users, you are encouraged to use AuthDBMUserFile. See Chapter XX, Authentication.

Make sure that the user file is placed outside of the DocumentRoot, otherwise, someone could download the file to crack at their leisure.

——————————————————————

(*)BindAddressd
Syntax: BindAddress address
Default: BindAddress *
Context: server config
Status: core

Specifies which IP address the server should watch for connections. By default, if the machine has multiple IP addresses, the server will listen on all of them for HTTP requests. address can be either *, to listen to all addresses, an IP address, or a fully qualified domain name.
BindAddress www.mk.net

See also Listen

——————————————————————

(*)BrowserMatch
Syntax: BrowserMatch regex envar[=value] [...]
Default: none
Context: server config
Override: none
Status: Base
Module: mod_setenvif
Compatibility: Apache 1.2 and above (in Apache 1.2 this
directive was found in the now-obsolete mod_browser module)

Defines one or more environment variables based on text found in the User-Agent HTTP header. This is useful for directives such as allow if env=, deny if env=, and can also be used in CGI programs.

The same effect can be attained with the SetEnvIf directive.
BrowserMatch MSIE InternetExplorer=yes

Note that the regular expression matching here is case-sensitive.

For case insensitive matching, see BrowserMatchNoCase.

——————————————————————

(*)BrowserMatchNoCase
Syntax: BrowserMatchNoCase regex envar[=value] [...]
Default: none
Context: server config
Override: none
Status: Base
Module: mod_setenvif
Compatibility: Apache 1.2 and above (in Apache 1.2 this
directive was found in the now-obsolete mod_browser module)

This is the same as the BrowserMatch directive (qv) except that the regular expression is matched with case insensitive matching.
BrowserMatchNoCase compatible Mozilla=spoof

——————————————————————

(*)CheckSpelling
Syntax: CheckSpelling on/off
Default: CheckSpelling Off
Context: server config, virtual host, directory, .htaccess
Override: Options
Status: Base
Module: mod_speling
Compatibility: CheckSpelling was available as a separately
available module for Apache 1.1, but was limited to
miscapitalizations. As of Apache 1.3, it is part of the
Apache distribution. Prior to Apache 1.3.2, the
CheckSpelling directive was only available in the "server"
and "virtual host" contexts.

When set to on, CheckSpelling tries to correct spelling errors, and redirects to the corect URL. For example, mistyping a URL such as http://www.mk.net/palns.html would redirect to the correct URL http://www.mk.net/plans.html. CheckSpelling also corrects miscapitalization.

This correction is accomplished by scanning the current directory for files with similar spelling, and picks the one that best matches the URL requested. With that in mind, don't enable this directive for directories containing confidential file that might accidentally be matched and served to the user.

In the case that two or more files are possible matches, a menu of options is presented to the user.
CheckSpelling on

——————————————————————

(*)ClearModuleList
Syntax: ClearModuleList
Context: server config
Status: core
Compatibility: ClearModuleList is only available in Apache 1.2 and later

Clears the list of currently loaded modules. You should then load a new list of modules using the AddModule directive.

——————————————————————

(*)CoreDumpDirectory
Syntax: CoreDumpDirectory directory
Default: the same location as ServerRoot
Context: server config
Status: core

Sets the location where the server will attempt to put a core dump. The default location is the ServerRoot, so a core dump will ordinarily not get written, since that directory is usually not writable by the user the server runs as.
CoreDumpDirectory /tmp

——————————————————————

(*)CustomLog
Syntax: CustomLog file-pipe format-or-nickname
Context: server config, virtual host
Status: Base
Compatibility: Nickname only available in Apache 1.3 or later
Module: mod_log_config

Defines a log file. See Chapter XX, Logging.

——————————————————————

(*)DefaultIcon
Syntax: DefaultIcon url
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

For use with FancyIndexing, this sets the icon to be displayed in automatically generated indexes for files of unknown type. url is the URL of the icon file.
DefaultIcon /icons/default.gif

——————————————————————

(*)DefaultLanguage
Syntax: DefaultLanguage MIME-lang
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_mime

Indicates that documents not explicitly marked with a language extension are to be considered this language type. This might permit you do designate a particular portion of you site as a particular language without having to add the filename extension (such as .en or .fr) to each file. See the AddLanguage directive.

——————————————————————

(*)DefaultType
Syntax: DefaultType MIME-type
Default: DefaultType text/html
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: core

Sets the MIME type to be used for files whose type cannot be determined by the file name. For example, if you have a directory full of postscript files that do not have file name extensions, you might use the following for that directory.
DefaultType application/postscript

——————————————————————

(*)deny
Syntax: deny from host host ...
Context: directory, .htaccess
Override: Limit
Status: Base
Module: mod_access

See allow and order. Denys access to a particular directory based on the address of the host, where host can be one of the following:

all - All hosts are denied access.
deny from all

A domain name - All hosts that match, or end in, the given string, are denied access. This compares the whole name, so that bowen.com does not match rcbowen.com.
deny from .microsoft.com

An IP address - A host with that exact IP address is denied access.
deny from 192.101.203.76

A partial IP address - The first 1 to 3 bytes of an IP address. All hosts in that subnet are denied access
deny from 192.101.210

A network and a netmask - Hosts on the included subnets are denied access.
allow from 192.101.0.0/255.255.0.0

A network and a netmask in terms of number of high-order bits.
deny from 192.101.0.0/16

——————————————————————

(*)
Syntax: ...
Context: server config, virtual host
Status: Core.

Used to enclose one or more directives that are applied only to the specified directory, and subdirectories thereof. If this chapter indicates that a directive is permitted in directory context, it is permitted in one of these directory containers. The directory name can be one of the following.

A directory name: The absolute path to a particular directory.

DefaultType image/gif

A wild-card string: With the use of various characters, you can indicate several directories that might match the wildcard.

(*)?

Matches any single character
•

Matches any sequence of characters

(*)[ ]

In Apache 1.3 or later, can be used to enclose a character range.

None of the wildcard characters match the '/' character. The following example forbids the use of .htaccess files in user directories.

AllowOverride None

A regular expression: With Apache version 1.2 and later, you can use regular expression matching to indicate which directories are to get the directives. You need to add the ~ character to the directive to indicate that you are using this feature.

directives

The above example matches all directories that contain the string ``pressrelease'', and applies a set of directives to those directories.

——————————————————————

(*)
Syntax: ...
Context: server config, virtual host
Status: Core.
Compatibility: Available in Apache 1.3 and later

See also . works exactly the same as , except that it takes a regular expression as the argument. So, it is exactly the same as with the regular expression option.

——————————————————————

(*)DirectoryIndex
Syntax: DirectoryIndex url url ...
Default: DirectoryIndex index.html
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_dir

Sets the default document to be displayed when a URL requests a directory. For example, if the URL http://www.rcbowen.com/imho/ is requested, the server will consult the DirectoryIndex directive for that directory, and serve that file out of that directory. If DirectoryIndex is set to index.html, then this request would be equivalent to http://www.rcbowen.com/imho/index.html.

url must be a URL on the local server, but it need not be a file in the current directory. That is, it can be a relative URL to elsewhere on the site.

Several urls can be provided, and the server will use the first on that it is actually able to locate. For example:
DirectoryIndex index.html index.shtml /errors/no_index.html

In the above example, the server will first attempt to serve the file index.html. If that file it is not found in the directory, it will then try to serve the file index.shtml. Finally, if that file is not found, it will serve the URL /errors/no_index.html. If none of the files listed in this directive are found, what is to be served will fall through to the automatic indexing directives. If none of those are set, the server will display an error message, indicating that access to that directory is forbidden.

——————————————————————

(*)DocumentRoot
Syntax: DocumentRoot directory-filename
Default: DocumentRoot /usr/local/apache/htdocs
Context: server config, virtual host
Status: core

Sets the directory from which your HTML files will be served. Other directories containing HTML files can be set with the Alias directive.

The following example is the default setting if you installed from the RedHat RPM.
DocumentRoot /home/httpd/html

——————————————————————

(*)ErrorDocument
Syntax: ErrorDocument error-code document
Context: server config, virtual host, directory, .htaccess
Status: core
Override: FileInfo
Compatibility: The directory and .htaccess contexts are only
available in Apache 1.1 and later.

ErrorDocument provides for customizable error messages when something goes wrong on the server. By default, the user is presented with unfriendly, cryptic messages that leave them thinking that they did something wrong. With ErrorDocument, you can explain what happened, what they can do about it, and who to contact about the problem. Or you can redirect to a CGI program that logs the problem or notifies someone about it. error_code is the 4xx or 5xx error status returned by the server. document is one of the following. A text message.
ErrorDocument 404 "That document does not exist, or has been moved.

The text message is simply returned to the browser.

A local or external URL T hese can be HTML pages, or CGI programs that handle the error in some way.
ErrorDocument 404 http://cgi.databeam.com/cgi-bin/not_found.pl
ErrorDocument 401 /createaccount.html
ErrorDocument 500 /cgi-bin/report_error.pl

When an ErrorDocument directive redirects to a local URL, a special set of environment variables are sent with the redirect, so that a CGI program can try to find out more about the error. These environment variables consist of all the environment variables that were available prior to the redirect, with REDIRECT_ prepended. For example, REQUEST_METHOD would become REDIRECT_ REQUEST_METHOD. In addition to these variables, two new variables are created - REDIRECT_URL and REDIRECT_STATUS. REDIRECT_URL contains the URL that was originally requested. REDIRECT_STATUS contains the error status code that caused the redirect.

When redirecting to external URLs, these special environment variables are not available. Be careful - ``external'' means any URL that begins with ``http://'', even if it actually points to the local server.

——————————————————————

(*)ErrorLog
Syntax: ErrorLog filename|syslog[:facility]
Default: ErrorLog logs/error_log (Unix)
Default: ErrorLog logs/error.log (Windows and OS/2)
Context: server config, virtual host
Status: core

Sets the location of the error log. See chapter XX, Logging. See also the LogLevel directive. filename can be an actual file name, or, if it begins with a pipe (|), a command that will be launched to process error log entries. Unless the file name begins with a /, it is appended to the value of ServerRoot.

As of Apache 1.3, you can log to syslog, for those systems that support this.
ErrorLog /var/log/httpd/error_log

For more information, see chapter 12, Logging.

——————————————————————

(*)ExtendedStatus
Syntax: ExtendedStatus On|Off
Default: ExtendedStatus Off
Context: server config
Status: Base
Module: mod_status
Compatibility: ExtendedStatus is only available in Apache 1.3.2 and later.

Turns on extended information tracking for each server request. mod_status is not turned on by default, and you must turn it on in order to use this directive.

——————————————————————

(*)FancyIndexing
Syntax: FancyIndexing boolean
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

Turns the FancyIndexing directive on or off.
FancyIndexing on

You should use the IndexOptions directive instead.

——————————————————————

(*)
Syntax: ...
Context: server config, virtual host, .htaccess
Status: core
Compatibility: only available in Apache 1.2 and above.

Allows configuration directives to be applied based on file names. This is analagous to the directive, except that it can be used in .htaccess files. This is a great way for users to specify options in their directory, on a file-by-file basis.

Like the directive, you can use either wildcards, or extended regular expressions, to specify a group of files.

Wildcards:

? - Matches any single character * - Matches any sequence of characters [] - In Apache 1.3 or later, can be used to enclose a character range.

The following example will restrict access to files with names that look like 'Jan', followed by two characters, followed by '.htm', optionally followed by anything else. These files will only be viewable by clients from hosts on the mk.net network. All other clients will get an ``access denied'' error message.

order deny,allow
deny from all
allow from mk.net

Regular Expressions:

By prepending the ~ character, you enable matching via regular expressions. This gives a little more flexibility than the wildcards approach. This functionality is also available in the directive, which is preferred. The following example will apply the directives to files with names such as 'Jan.htm', 'january.html', 'jan1999.htm', and so on.

...

For a more complete treatment of Regular Expressions, you may want to see Jeffrey Friedl's excellent book ``Mastering Regular Expressions.''

——————————————————————

(*)
Syntax: ...
Context: server config, virtual host, .htaccess
Status: core
Compatibility: only available in Apache 1.3 and above.

The directive supercedes the ~ Regular Expression functionality of the directive. It permits the application of directives to files matching arbitrary Regular Expressions.

The following example will apply the directives to files with names such as 'Jan.htm', 'january.html', 'jan1999.htm', and so on.

...

——————————————————————

(*)ForceType
Syntax: ForceType media type
Context: directory, .htaccess
Status: Base
Module: mod_mime
Compatibility: ForceType is only available in Apache 1.1 and later.

Forces all files in a particular directory to be served with the specified MIME type. This is similar to the DefaultType directive, in that it will cause files with an unknown file extension to be served with the specified MIME type. However, it also overrided files that have an extension that would otherwise determine the file type.

This example will cause all files in a directory to be served with the application/unknown MIME type. This is very useful if you have a directory of files that you want people to be able to dowload, as it will ask the user if they want to save the file, rather than displaying it in the browser window.
ForceType application/unknown

——————————————————————

(*)Group
Syntax: Group unix-group
Default: Group #-1
Context: server config, virtual host
Status: core

Sets the group under which the server process will execute. This is only meaningful on Unix systems. This is used in conjunction with the User directive to specify the permissions with which the server runs. It is recommended that this Group (and the User) have limited permissions. See Chapter 16, Security, for further discussion of security issues.

——————————————————————

(*)HeaderName
Syntax: HeaderName filename
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

This directive is to be used in conjunction with automatically generated indexes. It specifies a file that will be displayed at the top of the directory listing. This is useful for providing informational messages, or a description of the contents of the directory.

The server first looks for filename.html, and, if that is not found, it will look for filename. The following directive, for example, will cause the file info.html to be displayed at the top of directory listings, if it exists, or the file info to be displayed otherwise. If neither file exists, nothing will be displayed.
HeaderName info

The ReadmeName directive is used to display something at the bottom of the directory listing.

——————————————————————

(*)HostNameLookups
Syntax: HostNameLookups on | off | double
Default: HostNameLookups off
Context: server config, virtual host, directory
Status: core
Compatibility: double available only in Apache 1.3 and
above.
Compatibility: Default was on prior to Apache 1.3.

Turns name lookups on or off. When set to off, client names will appear in the logs, and be passed to CGI in the REMOTE_HOST environment variable, as just an IP address. When set to on, the server will do a DNS lookup on every client access to get the hostname. Since this requires one DNS lookup for every document that the client requests, this can significantly slow things down. Don't turn this on unless you actually have a good reason for doing so.

The double setting causes the server to perform double-reverse lookups, which means that after a name lookup has been performed, a lookup is then performed on that name, and the resulting IP address must match the original client address. This is sometimes done for security reasons.

——————————————————————

(*)IdentityCheck
Syntax: IdentityCheck on | off
Default: IdentityCheck off
Context: server config, virtual host, directory
Status: core

When turned on, the server can log the remote user's username. This username is obtained from the client machine via identd, or other similar method. Long, long ago, when the WWW was young, a lot of browsers would pass the user's email address for this value. This feature was quickly abused by shameless marketing types, and has been removed from every major browser.

The information obtained from this directive is not reliable in any useful way, and so it is seldom worthwhile to turn this on.

This might possibly be useful in an Intranet setting, but on the Internet, the latency introduced by having this directive turned on would far outweigh any benefits.

——————————————————————

(*)
Syntax: ...
Default: None
Context: all
Status: Core
Compatibility: is only available in 1.3.1 and later.

Used to enclose a directive, or set of directives, which will be processed only if the parameter was specified when the server was started up. If the ! is used, the enclosed directive(s) will be processed only if the parameter was not specified.

A parameter is specified on the command line, when the server is started, with -Dparameter-name. For example, the parameter dolookups might be specified by starting the server with the following command line.
httpd -Ddolookups

You might then turn on the HostNameLookups directive, only if that parameter was specified, with the following directives.

HostNameLookups on

This allows you to define custom server configurations within the same configuration file, and turn various features on and off via the startup command. You can nest IfDefine directives to test more than one condition.

——————————————————————

(*)
Syntax: ...
Default: None
Context: all
Status: Core
Compatibility: IfModule is only available in 1.2 and later.

Used to enclose a directive, or set of directives, which will be processed only if the named module is compiled into Apache. If the ! is used, the enclosed directive(s) will be processed only if the module is not compiled in to Apache.

The following directive will turn on the spelling correction feature of mod_speling, if that module is compiled in.

CheckSpelling on

——————————————————————

(*)Include
Syntax: Include filename
Context: server config
Status: Core
Compatibility: Include is only available in Apache 1.3 and
later.

Includes another file into the configuration file. This could be useful for keeping several different server configuration files, and switching between them. The desired configuration directives might be loaded with an directive, and enabled with a command line parameter.

include config1.conf

——————————————————————

(*)IndexIgnore
Syntax: IndexIgnore file file ...
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

This directive is used in conjunction with automatically generated directory listings. It specifies the list of files to ignore when building those listings.
IndexIgnore README .htaccess *.stub *.cfm

——————————————————————

(*)IndexOptions
Syntax: IndexOptions [+|-]option [+|-]option
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

IndexOptions is used to configure the options available with the automatic indexing functions of the mod_autoindex module. option can be any of the following:

(*)FancyIndexing

Turns on ``fancy'' indexing of directories. If FancyIndexing is not turned on, the directory listing is simply a bulleted list of file names, and none of the rest of these options make any difference. This should be used in preference to the FancyIndexing directive

(*)IconHeight[=pixels]

Tells the server to use the HEIGHT attribute in the HTML IMG tag when displaying the file icon for items in the index listing. If you don't specify a value for the pixels option, Apache will just use the standard height of the icons that ship with Apache (22 pixels high).

(*)IconsAreLinks

Turns the file icons into a link to the file. By default, icons are not links.

(*)IconWidth[=pixels]

Tells the server to use the WIDTH attribute in the HTML IMG tag when displaying the file icon for items in the index listing. If you don't specify a value for the pixels option, Apache will just use the standard width of the icons that ship with Apache (20 pixels wide).

(*)NameWidth=[n | *]

Specifies how many characters wide the filename column will be. If the file name is longer than the number specified, the name will be truncated at n-3 characters, and the last three characters will be displayed as ..> to indicate that the name has been truncated. If the value is set to *, the column is set to the length of the longest filename.b

(*)ScanHTMLTitles

Scans each HTML file and uses the contents of the HTML
tag in the description column, if that file does not have a description given by an AddDescription directive. As you can imagine, this slows things down considerably, as Apache has to open and read every HTML file individually.

(*)SuppressColumnSorting

The default behavior of FancyIndexing is to make each column header a link which you can click on to sort by that column. This turns off that behavior.

(*)SuppressDescription

Turns off the displaying of the description column in directory listings.

(*)SuppressHTMLPreamble

Apache will usually begin automatically generated index pages with an HTML ``preamble'', which looks something like the following:

If the directory contains a file specified by the HeaderName directive, the contents of that file will then be displayed here. If no such file exists, Apache will then insert a header indicating the name of the directory that is being indexed, such as the following:

Index of /products

With the SuppressHTMLPreamble option turned on, this HTML preamble will be skipped, and the page generated will start with the contents of the file specified by the HeaderName directive. If there is no such file, the preamble will be generated as usual.

(*)SuppressLastModified - Turns off the display of the last modification date of the file.

(*)SuppressSize - Turns off the display of the size of the file.

——————————————————————

(*)KeepAlive
Syntax: KeepAlive on/off
Default: KeepAlive On
Context: server config
Status: Core
Compatibility: KeepAlive is only available in Apache 1.1 and
later.

Turns on (or off) the ability to serve more than one request on the same connection. This speeds up response, since the client does not need to open a new connection for every request. For example, if a web page contains 5 images, that's 6 requests - one for the page, and then one for each of the images.

See also the MaxKeepAliveRequests directive.

——————————————————————

(*)KeepAliveTimeout
Syntax: KeepAliveTimeout seconds
Default: KeepAliveTimeout 15
Context: server config
Status: Core
Compatibility: KeepAliveTimeout is only available in Apache
1.1 and later.
Specifies the number of seconds to wait for another request
before closing the connection.

——————————————————————

(*)LanguagePriority
Syntax: LanguagePriority MIME-lang MIME-lang...
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_negotiation

Lists, in decreasing order, the language preference for negotiated documents. See the the chapter on mod_negotiation, in the Modules chapter.
LanguagePriority en fr de

——————————————————————

(*)
Syntax: ...
Context: any
Status: core

Directives included in a container apply only to the HTTP methods specified. Valid HTTP methods are GET, POST, PUT, DELETE, CONNECT and OPTIONS, and they are case-sensitive. HEAD requests are included in GET requests. The example below requires a valid username and password for POST and PUT requests, but will allow GET requests through unauthenticated.

require valid-user

——————————————————————

(*)
Syntax: ...
Context: any
Status: core
Compatibility: Available in Apache 1.3.5 and later

This is the opposite of the directive. Directives appearing inside a container will apply to all methods except those specified. See for more information.

——————————————————————

(*)LimitRequestBody
Syntax: LimitRequestBody number
Default: LimitRequestBody 0
Context: server config, virtual host, directory, .htaccess
Status: core
Compatibility: LimitRequestBody is only available in Apache
1.3.2 and later.

Specifies the maximum size of a client request body. The body of the request is used to send the contents of HTML forms, or for file uploads using a PUT request. The number specified can be anywhere from 0 (meaning unlimited size) to 2147483647 (2 GB).

This is a convenient way to restrict the size of files that can be uploaded to a server, or for avoiding denial-of-service attacks where the client attempts to overwhelm the server with an enormous request body.

——————————————————————

(*)LimitRequestFields
Syntax: LimitRequestFields number
Default: LimitRequestFields 100
Context: server config
Status: core
Compatibility: LimitRequestFields is only available in
Apache 1.3.2 and later.

Specifies the maximum number of HTTP header fields will be accepted from a client. number can be anywhere from 0, meaning unlimited, to 32767. This might be useful in avoiding denial-of- service attacks where the client attempts to overwhelm the server by sending an enormous amount of data in the form of HTTP headers.

——————————————————————

(*)LimitRequestFieldsize
Syntax: LimitRequestFieldsize number
Default: LimitRequestFieldsize 8190
Context: server config
Status: core
Compatibility: LimitRequestFieldsize is only available in
Apache 1.3.2 and later.

Sets a limit on the size of any individual HTTP header. This should usually not be changed from the default setting.

——————————————————————

(*)LimitRequestLine
Syntax: LimitRequestLine number
Default: LimitRequestLine 8190
Context: server config
Status: core
Compatibility: LimitRequestLine is only available in Apache
1.3.2 and later.

Sets a limit on the length of a HTTP request. This needs to be long enough that any possible URL on your server can fit into this many characters, including any data that might come in as part of a GET request.

This limit might prevent certain kinds of denial-of-service attacks where the client attempts to overwhelm the server with an enormous request line.

This should usually not be changed from the default setting.

——————————————————————

(*)Listen
Syntax: Listen [IP address:]port number
Context: server config
Status: core
Compatibility: Listen is only available in Apache 1.1 and
later.

Tells the server to listen for requests on more than one IP address and/or TCP/IP port. By default, Apache listens on all network interfaces, but only on the one port specified by the Port directive.

If a port number is specified without an IP address, as in the following example, Apache listens on that port on all interfaces.
listen 80
listen 8081
listen 1352

If an IP address is specified as well as a port, as in the following example, then Apache listens on just that specific IP address/port combination.
listen 192.168.1.1:80
listen 9.95.147.22:999

You should try to avoid using ports that might already be in use for other purposes, since this will cause the server to fail to start up, as it will be unable to bind to the port.

——————————————————————

(*)ListenBacklog
Syntax: ListenBacklog backlog
Default: ListenBacklog 511
Context: server config
Status: Core
Compatibility: ListenBacklog is only available in Apache
versions after 1.2.0.

Sets the maximum number of requests to keep in the queue to be serviced. This will only be relevant on extremely busy site, and in most cases, this number does not need to be changed.

——————————————————————

(*)LoadFile
Syntax: LoadFile filename filename ...
Context: server config
Status: Base
Module: mod_so

Links in the named object files or libraries when the server is started. filename is either an absolute path, or a path relative to ServerRoot.

——————————————————————

(*)LoadModule
Syntax: LoadModule module filename
Context: server config
Status: Base
Module: mod_so

Loads the named module, contained in the named filename. This will look different on Windows and Unix systems, as show in the examples below.

On Unix:
LoadModule speling_module modules/mod_speling.so

On Windows:
LoadModule speling_module modules/ApacheModuleSpeling.dll

——————————————————————

(*)
Syntax: ...
Context: server config, virtual host
Status: core
Compatibility: Location is only available in Apache 1.1 and
later.

The container defines directives based on URL. It is very similar in syntax and behavior to the directive, but does not necessarily have anything to do with directories. Wildcards may be used in the URL. ? matches any single character, and * matches any sequence of characters.

Like the directive, with the addition of the ~ character, regular expressions may be used to match a variety of URLs. The following example would match URLs that contain the string ``/products/hypercal'' or ``/download/hypercal''.

You can also achieve this behavior with the directive.

The directive is used in the default configuration file in an example involving the SetHandler directive. In this example, a URL is created that maps to a handler, rather than to a directory and files.

SetHandler server-status
order deny,allow
deny from all
allow from .mk.net

The above example provides for clients from hosts only on the mk.net network to access the URL /status to view server status reports.

——————————————————————

(*)
Syntax: ...
Context: server config, virtual host
Status: core
Compatibility: LocationMatch is only available in Apache 1.3
and later.

Provides the same functionality as the directive, with a regular expression matching instead of just a string for the URL. This should be used in preference to the ~ option with .

——————————————————————

(*)LockFile
Syntax: LockFile filename
Default: LockFile logs/accept.lock
Context: server config
Status: core

Specifies the location of the lockfile user by Apache if it is compiled with either USE_FCNTL_SERIALIZED_ACCEPT or USE_FLOCK_SERIALIZED_ACCEPT. This file must be stored on a local drive.

——————————————————————

(*)LogFormat
Syntax: LogFormat format [nickname]
Default: LogFormat "%h %l %u %t \"%r\" %s %b"
Context: server config, virtual host
Status: Base
Compatibility: Nickname only available in Apache 1.3 or
later
Module: mod_log_config

Defines a logging format, and a nickname by which that format can be called. See the chapter on Logging for more information on this directive.

——————————————————————

(*)LogLevel
Syntax: LogLevel level
Default: LogLevel error
Context: server config, virtual host
Status: core
Compatibility: LogLevel is only available in 1.3 or later.

Sets the level of error messages that are to appear in the error log, from debug, which gets all messages, to emerg, which gets only the most dire of messages. Setting this directive to somewhere in the middle makes the most sense. The possible values for this directive are shown in the table below.

LevelDescription
emerg Emergencies - system is unusable.
Example: "Child cannot open lock file. Exiting"
alert Action must be taken immediately.
Example: "getpwuid: couldn't determine user name from uid"
crit Critical Conditions.
Example: "socket: Failed to get a socket, exiting child"
error Error conditions.
Example: "Premature end of script headers"
warn Warning conditions.
Example: "child process 1234 did not exit, sending another SIGHUP"
notice Normal but significant condition.
Example: "httpd: caught SIGBUS, attempting to dump core in ..."
info Informational.
Example: "Server seems busy, (you may need to increase StartServers, or Min/MaxSpareServers)..."
debug Debug-level messages
Example: "Opening config file ..."

See the chapter on Logging for more information on this directive.

——————————————————————

(*)MaxClients
Syntax: MaxClients number
Default: MaxClients 256
Context: server config
Status: core

Sets the maximum number of simultaneous client requests that will be served. See also the ListenBacklog directive.
MaxClients 100

——————————————————————

(*)MaxKeepAliveRequests
Syntax: MaxKeepAliveRequests number
Default: MaxKeepAliveRequests 100
Context: server config
Status: core
Compatibility: Only available in Apache 1.2 and later.

Sets the maximum number of requests that will be served for one connection, when KeepAlive is enabled. See also the KeepAlive directive. If MaxKeepAliveRequests is set to 0, this will be unlimited.
MaxKeepAliveRequests 200

——————————————————————

(*)MaxRequestsPerChild
Syntax: MaxRequestsPerChild number
Default: MaxRequestsPerChild 0
Context: server config
Status: core

Sets the number of requests that will be served by a single child process before the child process will exit. When set to 0, child processes never exit.

This directive does not affect the Win32 server, which handles additional requests with threads within one child process, rather than by forking additional child processes. See the ThreadsPerChild directive for the equivalent directive for Windows.
MaxRequestsPerChild 500

——————————————————————

(*)MaxSpareServers
Syntax: MaxSpareServers number
Default: MaxSpareServers 10
Context: server config
Status: core

Sets the maximum number of idle child processes that are permitted. If more processes than this go idle, they will be killed off.

This directive does not affect the Win32 server.
MaxSpareServers 5

——————————————————————

(*)MetaDir
Syntax: MetaDir directory name
Default: MetaDir .web
Context: .htaccess
Status: Base
Module: mod_cern_meta
Compatibility: MetaDir is only available in Apache 1.1 and
later.

Specifies the name of the directory in which Apache can find meta information files. See the section on mod_cern_meta in the Modules chapter.
MetaDir .

——————————————————————

(*)MetaFiles
Syntax: MetaFiles on/off
Default: MetaFiles off
Context: per-directory config
Status: Base
Module: mod_cern_meta
Compatibility: MetaFiles is only available in Apache 1.3 and
later.

Turns on meta file processing on a perl-directory basis.

——————————————————————

(*)MetaSuffix
Syntax: MetaSuffix suffix
Default: MetaSuffix .meta
Context: .htaccess
Status: Base
Module: mod_cern_meta
Compatibility: MetaSuffix is only available in Apache 1.1
and later.

Sets the filename extension for files containing meta information. The following example will cause Apache to look for a file called foo.html.meta when a file called foo.html is served. It will use the contents of that file generate additional MIME header information for that HTML file.
MetaSuffix .meta

——————————————————————

(*)MimeMagicFile
Syntax: MimeMagicFile magic-file-name
Default: none
Context: server config, virtual host
Status: Extension
Module: mod_mime_magic

Used to enable the mod_mime_magic module.
MimeMagicFile conf/magic

——————————————————————

(*)MinSpareServers
Syntax: MinSpareServers number
Default: MinSpareServers 5
Context: server config
Status: core

Sets the minimum number of idle child processes should be running at any time. If there are fewer than this, Apache will create additional child processes to handle future requests.

This directive does not affect the Win32 server.
MinSpareServers 5

——————————————————————

(*)NameVirtualHost
Syntax: NameVirtualHost addr[:port]
Context: server config
Status: core
Compatibility: NameVirtualHost is only available in Apache
1.3 and later

Tells Apache that requests on the specified address should be served documents based on the server name requested. Name-based virtual host are used when there is more than one cname on the address specified, and each cname is to be treated as a separate virtual host. See the chapter on Virtual Hosts.
NameVirtualHost 192.101.205.15

——————————————————————

(*)NoCache
Syntax: NoCache
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Base
Module: mod_proxy
Compatibility: NoCache is only available in Apache 1.1 and
later.

To be used in conjunction with the caching proxy server implemented in the mod_proxy module, this directive turns of caching on all files, accessed through the proxy, which match the words in the list. The following example will disable caching for any URL containing the substring ``cgi-bin'', or the substring ``cgi.databeam.com''. The latter will presumably disable caching from any file fetched from the machine called cgi.databeam.com, but more generally, it is for any URL at all containing that substring.
NoCache cgi-bin cgi.databeam.com

Note: NoCache * will disable all caching.

——————————————————————

(*)Options
Syntax: Options [+|-]option [+|-]option ...
Context: server config, virtual host, directory, .htaccess
Default: Options All
Override: Options
Status: core

Enables (or disabled) server features for a particular directory, and all subdirectories thereof. The options can be any of the following.

(*)None

Don't allow any of these options in the specified directory.

(*)All

All options except for MultiViews.

(*)ExecCGI

CGI programs may be executed within this directory. You can also use the ScriptAlias directive to enable this, but using the Options directive to accomplish this is especially useful for user directories, so that the user can enable these options without the assistance of the server administrator.

(*)FollowSymLinks

The server will follow symbolic links in this directory. This is generally a bad idea, from a security perspective, since it potentially allows a web client to ``escape'' from the web document directory and explore the entire file system. Consider using the SymLinksIfOwnerMatch option. Includes - Server-side includes are permitted. Be careful with this, since includes are a potential security risk. Consider using the IncludesNOEXEC option instead if you are not confident of your users' ability and trustworthiness. See the chapter on SSI.

(*)IncludesNOEXEC

Server-side includes are permitted, but the #exec command and #include of CGI scripts are disabled.

(*)Indexes

If a directory is requested, and there is no file in that directory matching the DirectoryIndex directive, a listing of available files will be presented to the client. MultiViews - Content negotiated MultiViews are allowed.

(*)SymLinksIfOwnerMatch

Symboloc lines may be followed only if the target of the symlink is owned by the same user as the directory itself. This gets around some of the insecurity intrinsic to FollowSymLinks.

The FollowSymLinks and SymLinksIfOwnerMatch options are not available on Win32 system.

If all options specified are preceeded by a + or a -, then they will be added to options already in force. In the following example, FollowSymLinks is enabled for the directory /www/htdocs/fubar, and FollowSymLinks and ExecCGI are both enabled for the directory /www/htdocs/fubar/subdir, because the directives in the original section apply to all subdirectories.

Example:

Options FollowSymLinks

Options +ExecCGI

If options are not preceeded by these characters, then the options listed completely override those already in effect. In the following example, the directives in the second section completely override those in the first, and the directory /www/htdocs/fubar/subdir has only the Includes option enabled.

Options FollowSymLinks

Options Includes

——————————————————————

(*)order
Syntax: order ordering
Default: order deny,allow
Context: directory, .htaccess
Override: Limit
Status: Base
Module: mod_access

Specifies the order in which allow and deny directives are to be processed. The directive look like any one of the following. order deny,allow

deny directives are processed first, and then allow directives. This permits overriding a general deny directive with a very specific allow directive. The following example permits only hosts from mk.net to access the specified directory.

Example:
order deny,allow
deny from all
allow from mk.net

There is no space between deny and allow, just a comma. A common error is to use put a space in there, between the comma and allow, but this will cause a startup error.
order allow,deny

allow directives are processed first, and then deny directives. This lets you use a general allow statement, and then exclude certain hosts with deny statements. This is a good way to keep certain people out, such as folks that you know are trying to hack your site.

Example:
order allow,deny
allow from all
deny from dialup3.hacker.net
deny from s.ms.uky.edu

——————————————————————

(*)PassEnv
Syntax: PassEnv variable variable ...
Context: server config, virtual host
Status: Base
Module: mod_env
Compatibility: PassEnv is only available in Apache 1.1 and
later.

Specifies environment variables that should be passed to CGI programs, in addition to the standard set of variables.
PassEnv PATH

——————————————————————

(*)PidFile
Syntax: PidFile filename
Default: PidFile logs/httpd.pid
Context: server config
Status: core

Specifies the location of the file containing the server pid (process ID) number. This file may not contain meaningful information on Win32 systems.

——————————————————————

(*)Port
Syntax: Port number
Default: Port 80
Context: server config
Status: core

Tells the server which TCP/IP port on which it should listen for HTTP connections. This should be some number between 0 and 65535.

Ports numbered less than 1024 are reserved ports, and you must start the server as root in order to be able to bind to these ports. If for some reason, you need to start the server as some user other than root, pick a port number higher than 1024, otherwise Apache will complain that it cannot bind to the specified port, and startup will fail.
Example: Port 8080

——————————————————————

(*)ProxyBlock
Syntax: ProxyBlock
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Base
Module: mod_proxy
Compatibility: ProxyBlock is only available in Apache 1.2
and later.

URLs which contain any of the substrings specified in the word list will be blocked by the proxy. This is an easy way to filter out undesirable sites using a proxy server. Of course, you have to be using the proxy server in order for this directive to be meaningful. See the chapter on proxying.
ProxyBolck undesirable.site.com badword spammersite.com

——————————————————————

(*)ProxyPass
Syntax: ProxyPass
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Base
Module: mod_proxy
Compatibility: ProxyPass is only available in Apache 1.1 and
later.

Causes the server to appear as a mirror of an external site. When a reqest is received for the specified path, Apache proxies the document from the remote site, but appears to serve it from the local server, so that the server appears to be a mirror of the remote site.
ProxyPass /mirror/CPAN/ http://www.cpan.org/

——————————————————————

(*)ProxyPassReverse
Syntax: ProxyPassReverse
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Base
Module: mod_proxy
Compatibility: ProxyPassReverse is only available in Apache
1.3b6 and later.

Provides much the same functionality as ProxyPass, but also extends to any places where the initial URL may redirect the client.
ProxyPassReverse /mirror/CPAN/ http://www.cpan.org/

——————————————————————

(*)ProxyReceiveBufferSize
Syntax: ProxyReceiveBufferSize
Default: None
Context: server config, virtual host
Override: Not applicable
Status: Base
Module: mod_proxy
Compatibility: ProxyReceiveBufferSize is only available in
Apache 1.3 and later.

Specifies network buffer size for outgoing HTTP and FTP connections. See the chapter on proxying. This must be larger than 512. If it is set to 0, it indicates that the system default should be used for the buffer size.
ProxyReceiveBufferSize 1024

——————————————————————

(*)ProxyRemote
Syntax: ProxyRemote
Default: None
Context: server config, virtual host
Status: Base
Module: mod_proxy
Compatibility: ProxyRemote is only available in Apache 1.1
and later.

Indicates another proxy server that should be used. The parameter indicates what URLs should be sent through that proxy server. This can be either a tranfer protocol, such as http or ftp, or it can be a partial URL for which requests should be forwarded to another proxy server.

Examples:
ProxyRemote ftp http://socks.mk.net/

Forwards all FTP requests
through the server socks.mk.net. This might be useful if, for
some reason, you had separate FTP and HTTP proxy servers.

ProxyRemote http://databeam.com/ http://proxy.databeam.com/

forwards all requests for documents on the databeam.com server through the proxy server on proxy.databeam.com. This mightbe useful for proxying requests to a machine that is outside a firewall.
ProxyRemote * http://proxyserver.net/

Pass the buck. *
indicates that all requests are to be forwarded to the specified
proxy server. This might also be useful for a paranoid firewalled
environment: users can communicate with the internal proxy
server, which, in turn, can communicate with the external
firewall server, but nothing else is opened through the firewall.

——————————————————————

(*)ProxyRequests
Syntax: ProxyRequests on/off
Default: ProxyRequests Off
Context: server config, virtual host
Status: Base
Module: mod_proxy
Compatibility: ProxyRequests is only available in Apache 1.1
and later.

Turns on, or off, Apache's ability to perform as a proxy server.
ProxyRequests on

——————————————————————

(*)ProxyVia
Syntax: ProxyVia < off | on | full | block >
Default: ProxyVia off
Context: server config, virtual host
Override: Not applicable
Status: Base
Module: mod_proxy
Compatibility: ProxyVia is only available in Apache 1.3.2
and later.

The Via: HTTP header is defined in RFC2068 (the HTTP/1.1 specification), and provides tracking of requests that are passed through a chain of proxy servers. This directive controls Apache's behavior with respect to producing those headers. The possible values for this directive are:

off - Do not add a Via: header to the request.

on - Add a Via: header to the request, indicating that the request was passed through this proxy server.

full - Add the Via: header, and also add the Apache version number to that header.

block - Remove all Via: headers from the request, and do not add a Via: header to the request.

——————————————————————

(*)ReadmeName
Syntax: ReadmeName filename
Context: server config, virtual host, directory, .htaccess
Override: Indexes
Status: Base
Module: mod_autoindex

Specifies the name of the file that should be appended to automatically generated index listings. The server will first look for a file called filename.html, and, if that is not found, it will look for filename. If neither file is found, nothing will be appended to the listing.
ReadmeName README

The HeaderName directive is used to display a file at the top of the directory listing.

——————————————————————

(*)Redirect
Syntax: Redirect [ status ] url-path url
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_alias
Compatibility: The directory and .htaccess contexts are
only available in versions 1.1 and later. The status
argument is only available in Apache 1.2 or later.

Tells the server to redirect requests for a particular URL to some other location. The optional status argument has the server additionally pass a status code to the client. The status can be one of the following:

permanent - Returns a 301 status code, indicating that the resource has permanently moved.

temp - Returns a 302 status code, indicating that the resource has only been temporarily moved. This is the default value if no status argument is provided.

seeother - Returns a 303 status code, indicating that the resource has been replaced by some other resource.

gone - Returns a 410 status code, indicating that the resource is gone - that is, that it has been permanently removed. In this case, the redirect URL should not be provided.

Other status codes can be specified by using the numerical status code. These should be 3xx or 4xx status codes. If a 3xx status code is used, a URL must be provided for redirection. If a 4xx status code is used, the URL must be omitted.

The following example will redirect all requests for URLs beginning with /Help to another server, helpdesk.databeam.com.
Redirect seeother /Help http://helpdesk.databeam.com/

——————————————————————

(*)RedirectMatch
Syntax: RedirectMatch [status] regex url
Context: server config, virtual host
Override: FileInfo
Status: Base
Module: mod_alias
Compatibility: Available in Apache 1.3 and later

This directive is the same as the Redirect directive, except that the URL to be directed can be specified as a regular expression. The following example will redirect URLs beginning with either /help or /Help to another server, helpdesk.databeam.com.
RedirectMatch /[hH]elp http://helpdesk.databeam.com/

——————————————————————

(*)RedirectPermanent
Syntax: RedirectPermanent url-path url
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_alias
Compatibility: This directive is only available in 1.2

Redirects a URL and tells the client that the redirect is permanent. This is identical to using the Redirect directive with the permanent argument.

——————————————————————

(*)RedirectTemp
Syntax: RedirectTemp url-path url
Context: server config, virtual host, directory, .htaccess
Override: FileInfo
Status: Base
Module: mod_alias
Compatibility: This directive is only available in 1.2

Redirects a URL and tells the client that the redirect is temporary. This is identical to using the Redirect directive with the temp argument. In fact, since temp is the default value of the status argument for the Redirect directive, this is equivalent to using the Redirect directive with no status argument.

——————————————————————

(*)require
Syntax: require entity-name entity entity...
Context: directory, .htaccess
Override: AuthConfig
Status: core

Specifies which authenticated users can access the directory. The entity-name can be one of the following:

group - Indicates that a group of users, defined in a group file somewhere, can access the directory

user - Indicates that only the specified user(s) can access the directory. These users, and their passwords, should be defined in a user file somewhere.

valid-users - Indicates that any user with a valid username and password can access the directory.

This directive is to be used in conjunction with several other directives that specify the location of the group and user files, what type of authentication is to be used, and what methods are to be restricted.

Example:
AuthType Basic
AuthName admins
AuthUserFile /etc/httpd/passwd/users
AuthGroupFile /etc/httpd/passwd/groups

require group admins

For more details on these directives, see the chapter on Authentication.

——————————————————————

(*)ResourceConfig
Syntax: ResourceConfig filename
Default: ResourceConfig conf/srm.conf
Context: server config, virtual host
Status: core

Indicates the location of the resource configuration file, which is read for additional configuration options after loading the httpd.conf file. The filename, unless it has a leading slash, is assumed to be relative to the ServerRoot. If you wish to put all of your configuration directives in one file, you can disable the loading of a ResourceConfiguration file with the following directive:
ResourceConfig /dev/null

The equivalent line on NT is simply the following:
ResourceConfig nul

See also the AccessConfig directive.

——————————————————————

(*)RLimitCPU
Syntax: RLimitCPU # or 'max' [# or 'max']
Default: Unset; uses operating system defaults
Context: server config, virtual host
Status: core
Compatibility: RLimitCPU is only available in Apache 1.2 and
later

Limits CPU resources used. The first argument is a limit for all processes, and the second argument is the maximum resource limit. A value of max indicates that the limit should be set to the maximum allowed by the operating system.

——————————————————————

(*)RLimitMEM
Syntax: RLimitMEM # or 'max' [# or 'max']
Default: Unset; uses operating system defaults
Context: server config, virtual host
Status: core
Compatibility: RLimitMEM is only available in Apache 1.2 and
later

Limits memory used. The first argument is a limit for all processes, and the second argument is the maximum resource limit. A value of max indicates that the limit should be set to the maximum allowed by the operating system.

——————————————————————

(*)RLimitNPROC
Syntax: RLimitNPROC # or 'max' [# or 'max']
Default: Unset; uses operating system defaults
Context: server config, virtual host
Status: core
Compatibility: RLimitNPROC is only available in Apache 1.2
and later

Limits the number of processes used. The first argument is a limit for all processes, and the second argument is the maximum resource limit. A value of max indicates that the limit should be set to the maximum allowed by the operating system.

——————————————————————

(*)Satisfy Syntax: Satisfy Default: Satisfy all Context: directory, .htaccess Status: core Compatibility: Satisfy is only available in Apache 1.2 and later

When more than one criterion is set on access to a directory - such as username/password, and hostname, for example - Satisfy indicates whether all of the requirements have to be satisfied, or just one of them.

Example:

order deny allow
deny from all
allow from databeam.com
require user rbowen
Satisfy any

In this example, the client must come from the databeam.com network, or authenticate with the username rbowen, but not necessarily both. If the Satisfy directive is set to all, then both criteria must be satisfied in order for access to be granted.

——————————————————————

(*)ScoreBoardFile
Syntax: ScoreBoardFile filename
Default: ScoreBoardFile logs/apache_status
Context: server config
Status: core

On some operating systems, this directive is required to create a file that is used to communicate between the parent server process and its children. You can determine if this is required on your platform by simply setting this directive to something, and seeing if the file gets created.
ScoreBoardFile logs/apache_status

——————————————————————

(*)Script
Syntax: Script method cgi-script
Context: server config, virtual host, directory
Status: Base
Module: mod_actions
Compatibility: Script is only available in Apache 1.1 and
later

Causes a CGI program to be invoked when a particular HTTP method is used. Valid HTTP methods are GET, POST, PUT, or DELETE. If the method is GET, the CGI program will be called only if there is a QUERY_STRING on the URL - that is, if there is a question mark at the end, followed by one or more arguments.
Script GET /cgi-bin/search.pl

——————————————————————

(*)ScriptAlias
Syntax: ScriptAlias url-path directory-filename
Context: server config, virtual host
Status: Base
Module: mod_alias

See also the Alias directive. ScriptAlias does two things. First, it causes any URLs beginning with the specified url-path to be served out of the specified directory-filename. Secondly, it causes all files within that directory to be treated as CGI programs.
ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/

——————————————————————

(*)ScriptAliasMatch Syntax: ScriptAliasMatch regex directory-filename Context: server config, virtual host Status: Base Module: mod_alias Compatibility: Available in Apache 1.3 and later

ScriptAliasMatch is to ScriptAlias as AliasMatch is to Alias. ScriptAliasMatch functions exactly the same was as ScriptAlias except that the url path is specified as a regular expression.
ScriptAliasMatch /(cgi|scripts|progs)/ /www/cgi-bin/

——————————————————————

(*)ScriptInterpreterSource
Syntax: ScriptInterpreterSource
Default: ScriptInterpreterSource script
Context: directory, .htaccess
Status: core (Windows only)

This is a Windows-only directive. Traditionally, the location of the interpreter used to run an interpreted CGI program (``script'') is contained in the first line of that program, in a #! (often pronounced ``she-bang'') line, such as #!/usr/bin/perl. When Apache first became available for Windows, this same method was used, but some Windows users, used to file extensions determining file type, found this behavior confusing. When it was suggested that the interpreter would be determined solely on the basis of the file extension, that was met by some resistance from folks that wanted to be able to move code from Windows machines to Unix machines, and vice versa. The ScriptInterpreterSource directive permits the server administrator to determine whether the interpreter will be determined from the file extension, or based on a #! line. If this is set to registry, Apache will search the registry to find out what application is associated with the file extension of the CGI program. If it is set to script, Apache will use the #! line to figure this out.

——————————————————————

(*)ScriptLog
Syntax: ScriptLog filename
Default: none
Context: server config
Status: mod_cgi

Sets the location of a log file used to log error messages from CGI programs. This is intended for debugging purposes only, and should not be implemented on an actual production server, since it will degrade performance, and may produce a very large log file. The generated file will contain all the request headers, and all the program output, of all CGI programs. This is very useful for trying to figure out what went wrong with your CGI program.

See the ScriptLogLength and ScriptLogBuffer directives.
ScriptLog logs/script_log

——————————————————————

(*)ScriptLogBuffer
Syntax: ScriptLogBuffer size
Default: 1024
Context: server config
Status: mod_cgi

Limits the rate of growth of the ScriptLog by limiting the size of POST or PUT bodies that are logged to the file. Remember that all of the headers and the entire body are posted to the ScriptLog file, and the file could become very large without this directive set at a reasonable value.

See the ScriptLog and ScriptLogLength directives.
ScriptLogBuffer 2048

——————————————————————

(*)ScriptLogLength
Syntax: ScriptLogLength size
Default: 10385760
Context: server config
Status: mod_cgi

Limits the total size of the ScriptLog file. If the file exceeds this size, data will simply cease to be written to the file.

See the ScriptLog and ScriptLogBuffer directives.
ScriptLogLength 10385760

——————————————————————

(*)SendBufferSize
Syntax: SendBufferSize bytes
Context: server config
Status: core

Sets the TCP buffer size to the number of bytes specified.
SendBufferSize 1024

——————————————————————

(*)ServerAdmin
Syntax: ServerAdmin email-address
Context: server config, virtual host
Status: core

The email address of the person responsible for the server. This address is included in the error messages automatically generated by the server.
ServerAdmin webmaster@rcbowen.com

——————————————————————

(*)ServerAlias
Syntax: ServerAlias host1 host2 ...
Context: virtual host
Status: core
Compatibility: ServerAlias is only available in Apache 1.1
and later.

When you are using name-based virtual hosts, this directive allows you to specify various alternative names for the server, without having to set up a separate virtual host declaration for each name. This is useful, for example, in an intranet setting, where users might use the fully qualified domain name (fqdn) of the server, or might just use the machine name.

Example:

ServerName beamer.databeam.com
ServerAlias beamer
DocumentRoot /home/httpd/html/beamer/

——————————————————————

(*)ServerName
Syntax: ServerName fully-qualified domain name
Context: server config, virtual host
Status: core

The name of the server, used when the server is constructing redirect addresses. If this is not specified, the server will try to figure it out itself, based on DNS lookups. However, this may not return the desired name. For example, the machine that I would like the world to think of as www.rcbowen.com actually resolves in DNS as 209-249-98-74-virt-ip.mk.net.
ServerName www.rcbowen.com

——————————————————————

(*)ServerPath
Syntax: ServerPath pathname
Context: virtual host
Status: core
Compatibility: ServerPath is only available in Apache 1.1
and later.

Sets a path to access virtual host data on name-based hosts. This is for older browsers that do not send the correct information to tell the server which virtual host they are trying to access, and so always get the data from the primary host. See the chapter on Virtual Hosts for more information.

In the following example clients that are not able to access the server by the alias, that is, as http://user2.mk.net/, can access this host with the primary name of the server, with the ServerPath appended: http://www.mk.net/user2/. It is useful to put a link to this alternative address on the primary site for those users that have attempted to access the secondary site with an older browser.

This directive is seldom used in practice, as most webmasters assume that users will have newer browsers.

Example:

DocumentRoot /home/user2/html
ServerName user2.mk.net
ServerPath /user2/

——————————————————————

(*)ServerRoot
Syntax: ServerRoot directory-filename
Default: ServerRoot /usr/local/apache
Context: server config
Status: core

Sets the directory in which the server's files will be stored. Most directives specifying a path to a file or directory will be assumed to be given relative to this directive, unless they have a leading slash. Directories that are typically located in this ServerRoot directory are conf/ and logs/. It can also be useful to create symlinks in this directory to the various other server directories, such as the document directory and bin directory.
ServerRoot /usr/local/httpd
This directive can also be set with the -d command line option on
startup.

httpd -d /home/apache

——————————————————————

(*)ServerSignature
Syntax: ServerSignature
Default: ServerSignature Off
Context: server config, virtual host, directory, .htaccess
Status: core
Compatibility: ServerSignature is only available in Apache
1.3 and later.

Configures whether Apache will add a ``signature'' line to automatically generated error message pages. If the directive is set to On, this signature will be appended, and will include the name of the server, and the server version number. If the directive is set to Email, the server will additionally display a mailto: link for sending email to the ServerAdmin. With this directive set to Off, no signature will be appended.

——————————————————————

(*)ServerTokens
Syntax: ServerTokens Minimal|OS|Full
Default: ServerTokens Full
Context: server config
Status: core
Compatibility: ServerTokens is only available in Apache 1.3
and later

Configures whether the the Server HTTP response header will contain information about the operating system on which the server is running.

Set to Minimal, Apache returns just the version number of the server. Minimal can also be written as Min.

Example:
ServerTokens Minimal

returns
Server: Apache/1.3.6

Set to OS, Apache returns the generic OS type that the server is running on.

Example:
ServerTokens OS

returns
Server: Apache/1.3.6 (Win32)

Set to Full, Apache returns any additional information about add- on packages that the server is running.

Example:
ServerTokens: Full

returns
Server: Apache/1.3.6 (Unix) PHP/4.0Beta2

——————————————————————

(*)ServerType
Syntax: ServerType
Default: ServerType standalone
Context: server config
Status: core

This directive specifies how the server is to run.

If set to Inetd, the server will be run by the Inetd process, meaning that Inetd will listen on port 80, and each time that there is a request on that port, a new copy of Apache will be fired up to handle that request. This is extremely slow and inefficient. Almost the only time you should even consider using this setting is if you are testing configuration file changes - this setting ensures that the newest version of the config files will be used, and they are reloaded each time Inetd launches the server. This setting is not supported on NT, since NT has no Inetd process.

standalone is the more common setting. One parent copy of Apache is launched, and multiple child processes are then spawned off to handle requests. This is much faster and more efficient, as you don't have to pay the startup costs each time a request is made to the server.

——————————————————————

(*)SetEnv
Syntax: SetEnv variable value
Context: server config, virtual host
Status: Base
Module: mod_env
Compatibility: SetEnv is only available in Apache 1.1 and
later.

Sets an environment variable which is then passed to CGI programs.
SetEnv PerlVersion 5.005

——————————————————————

(*)SetEnvIf
Syntax: SetEnvIf attribute regex envar[=value] [...]
Default: none
Context: server config
Override: none
Status: Base
Module: mod_setenvif
Compatibility: Apache 1.3 and above

Sets an environment variable if an attribute of the request matches a certain regular expression. The attribute can be any of the HTTP headers. See the chapter on HTTP for a listing of available HTTP headers. Additionally, some browsers pass HTTP headers that are not part of the standard list, and any of these can be used also.

The following example sets the Admin environment variable if the authenticated username is either ``rbowen'' or ``tpowell''.
SetEnvIf Remote_User "(rbowen)|(tpowell)" Admin

——————————————————————

(*)SetEnvIfNoCase
Syntax: SetEnvIfNoCase attribute regex envar[=value] [...]
Default: none
Context: server config
Override: none
Status: Base
Module: mod_setenvif
Compatibility: Apache 1.3 and above

This directive is identical to the SetEnvIf directive except that regular expression matching is performed in a case-insensitive manner. This might be useful if you are not sure whether a particular value might be uppercase, lowercase, or some combination.

The following example will set the environment variable Admin if the authenticated username is rbowen, but will also set it if the username is Rbowen or RBowen, for example.
SetEnvIfNocase Remote_User rbowen Admin

——————————————————————

(*)SetHandler
Syntax: SetHandler handler-name
Context: directory, .htaccess
Status: Base
Module: mod_mime
Compatibility: SetHandler is only available in Apache 1.1
and later.

Sets a handler that is to handle requests to a particular directory. See the chapter on Handlers for more information on some of the things you can do with handlers.
SetHandler cgi-script

See also the AddHandler directive.

——————————————————————

(*)StartServers
Syntax: StartServers number
Default: StartServers 5
Context: server config
Status: core

Specifies the number of child processes to start on startup of the server. The actual number of child processes running at any one time is managed by the server depending on the load, and based on the MaxSpareServers and MinSpareServers directives, so there is not much point changing this value.

Note that on Windows, this directive has no effect, as there is always only one child process, and requests are handled by different threads within that child, rather than by forking additional child processes. See the ThreadsPerChild directive for more information.

——————————————————————

(*)ThreadsPerChild
Syntax: ThreadsPerChild number
Default: ThreadsPerChild 50
Context: server config
Status: core (Windows)
Compatibility: Available only with Apache 1.3 and later with
Windows

This directive is valid only on Windows systems, where it takes the place of the MaxRequestsPerChild directive.

——————————————————————

(*)TimeOut
Syntax: TimeOut number
Default: TimeOut 300
Context: server config
Status: core

Sets the timeout value for communication with the client. Specifically, it is the time for one of the following three events:

•

The total time to receive a GET request.
•

The time between packets on a PUT or POST request.
•

The amount of time between ACKs on transmission of packets in responses.

In the future, these are expected to be three separate configuration options.
TimeOut 150

——————————————————————

(*)TransferLog
Syntax: TransferLog file-pipe
Default: none
Context: server config, virtual host
Status: Base
Module: mod_log_config

Tells the server where to write out the log file. file-pipe can be either a file path, or a '|' followed by a command that the log information is to be piped to. The command will receive this information on standard input.

Note that the program will run as the user that started the server, which is usually root. Make sure that the program is secure.

Example 1
TransferLog logs/access_log
Example 2

TransferLog | /usr/bin/loghandler.pl

You can also use the LogFormat and CustomLog directives to set the location of the transfer log. This is the way that it is handled in the default configuration file.

——————————————————————

(*)TypesConfig
Syntax: TypesConfig filename
Default: TypesConfig conf/MIME.types
Context: server config
Status: Base
Module: mod_mime

The location of the MIME.type file, relative to the ServerRoot. This file contains the MIME-type mappings to filename extensions. It is recommended that you do not modify the MIME.types file, but instead all MIME types with the AddTypes directive.

——————————————————————

(*)UnsetEnv
Syntax: UnsetEnv variable variable ...
Context: server config, virtual host
Status: Base
Module: mod_env
Compatibility: UnsetEnv is only available in Apache 1.1 and
later.

Removes environment variables from those sent to CGI programs.
UnsetEnv LD_LIBRARY_PATH

Note that not all environment variables can be unset. Some of them are required by the CGI specification. See the chapter on CGI programming for more details.

——————————————————————

(*)UseCanonicalName
Syntax: UseCanonicalName
Default: UseCanonicalName on
Context: server config, virtual host, directory, .htaccess
Override: Options
Compatibility: UseCanonicalName is only available in
Apache 1.3 and later

If set to on, this directive will cause Apache to use the values of the ServerName and Port directives when it constructs redirect URLs, and for what it passes to CGI programs. If this directive is set to off, the server will continue to use whatever the cliet passes in.

——————————————————————

(*)User
Syntax: User unix-userid
Default: User #-1
Context: server config, virtual host
Status: core

Sets the user as which the server will run. Unless you are sure you know what you are doing, this should be set to some user with little or no priveleges on your system. Although you generally must be root to start the server, immediately after starting, the server changes to this user. All child processes will run as this user.

——————————————————————

(*)UserDir
Syntax: UserDir directory/filename
Default: UserDir public_html
Context: server config, virtual host
Status: Base
Module: mod_userdir
Compatibility: All forms except the UserDir public_html form
are only available in Apache 1.1 or above. Use of
the enabled keyword, or disabled with a list of usernames,
is only available in Apache 1.3 and above.

In its simplest form, this directive sets the subdirectory of a user's home directory out of which documents will be served if a request is received for a user. User requests look like http://www.mk.net/~rbowen/ - a server url with a username preceeded by a tilde (~).
UserDir htmldocs

With the above setting, http://www.mk.net/~rbowen/test.html would be mapped to the file /home/rbowen/htmldocs/test.html.

UserDir can also be used to redirect to a URL, if your user pages are housed on an entirely different server. You can use an asterisk (*) as a placeholder for the username.
UserDir http://users.mk.net/*/

With the above setting, a request for http://www.mk.net/~rbowen/test.html would be mapped to the URL
http://users.mk.net/rbowen/test.html.

In addition to these settings, the directive values disabled and enabled can also be used to turn user directory handling on or off, either globally, or for particular users. The value disabled turns off all user directory handling, except for users specifically listed with the enabled value.
UserDir disabled

The value disabled followed by a list of usernames, turns off user directory mapping for those users, even if they are listed as enabled.
UserDir disabled tpowell dpitts krietz

The value enabled followed by a list of users turns on username directory mapping for those users, even if a global disabled is in effect, but not if those users are listed as disabled.
UserDir enabled rbowen cbowen sbowen

——————————————————————

(*)
Syntax: ...
Context: server config
Status: Core.
Compatibility: Non-IP address-based Virtual Hosting only
available in Apache 1.1 and later.
Compatibility: Multiple address support only available in
Apache 1.2 and later.

See the chapter on Virtual Hosts for more details. This directive is used to define a virtual host, and what settings will apply to that virtual host.

Example:

ServerName beamer.databeam.com
ServerAlias beamer
DocumentRoot /home/beamer/htmldocs

——————————————————————

(*)XBitHack
Syntax: XBitHack
Default: XBitHack off
Context: server config, virtual host, directory, .htaccess
Override: Options
Status: Base
Module: mod_include

Allows the execute bit on an HTML file to determine whether that file will be parsed for server-side directives. When set to on, any file with the user execute bit set will be parsed for server- side content. When set to full, the same will happen, but, in addition, the Last-modified date of the document will be returned as the last-modified date of the file itself, allowing proxies to cache the resulting page. If set to off, no processing is done.

See the chapter on SSI for more information.

——————————————————————

(*)Conclusion

In addition to these base and code directives, there are a number of other directives dealing with other extension modules. These directives will be handled in the chapter on Modules, in the specific section about the module.

Apache gives the server administrator an enormous amount of control over the specifics of how the server will operate, letting you control everything from what error messages look like to the total amount of CPU time that the server is allowed to consume. In most cases, the default values for most things will be adequate, but go ahead and experiment with some of these parameters, and see what it does for your site. Make sure you save a backup copy before you start tinkering.
<(*)>