configuration files are <a href="#allowoverride">enabled for that
directory</a>. For example:</p>
- <highlight language="config">AccessFileName .acl</highlight>
+ <highlight language="config">
+AccessFileName .acl
+ </highlight>
<p>Before returning the document
<code>/usr/local/web/index.html</code>, the server will read
charset values</a> for use in Internet media types (MIME types).
For example:</p>
- <highlight language="config">AddDefaultCharset utf-8</highlight>
+ <highlight language="config">
+AddDefaultCharset utf-8
+ </highlight>
<p><directive>AddDefaultCharset</directive> should only be used when all
of the text resources to which it applies are known to be in that
<p>When this directive is set to <code>None</code> and <directive
module="core">AllowOverrideList</directive> is set to
- <code>None</code> <a href="#accessfilename">.htaccess</a>, files are
+ <code>None</code>, <a href="#accessfilename">.htaccess</a> files are
completely ignored. In this case, the server will not even attempt
to read <code>.htaccess</code> files in the filesystem.</p>
Allow use of the directives controlling specific directory
features (<directive module="core">Options</directive> and
<directive module="mod_include">XBitHack</directive>).
- An equal sign may be given followed by a comma-separated list, without spaces,
- of options that may be set using the <directive
+ An equal sign may be given followed by a comma-separated list, without
+ spaces, of options that may be set using the <directive
module="core">Options</directive> command.
<note><title>Implicit disabling of Options</title>
<p>Example:</p>
- <highlight language="config">AllowOverride AuthConfig Indexes</highlight>
+ <highlight language="config">
+AllowOverride AuthConfig Indexes
+ </highlight>
<p>In the example above, all directives that are neither in the group
<code>AuthConfig</code> nor <code>Indexes</code> cause an internal
of configuration files, it may be specified with the value
<code>none</code>, meaning no default media type. For example:</p>
- <highlight language="config">DefaultType None</highlight>
+ <highlight language="config">
+DefaultType None
+ </highlight>
<p><code>DefaultType None</code> is only available in
httpd-2.2.7 and later.</p>
<name>Directory</name>
<description>Enclose a group of directives that apply only to the
named file-system directory, sub-directories, and their contents.</description>
-<syntax><Directory "<var>directory-path</var>">
+<syntax><Directory <var>directory-path</var>>
... </Directory></syntax>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<Directory ~ "^/www/[0-9]{3}">
</Directory>
-</highlight>
+ </highlight>
<p>would match directories in <code>/www/</code> that consisted of
three numbers.</p>
<DirectoryMatch "^/www/(.+/)?[0-9]{3}/">
# ...
</DirectoryMatch>
-</highlight>
+ </highlight>
<p>matches directories in <code>/www/</code> (or any subdirectory thereof)
that consist of three numbers.</p>
<module>mod_rewrite</module>. In order to prevent confusion, numbered
(unnamed) backreferences are ignored. Use named groups instead.</p>
-<highlight language="config">
+ <highlight language="config">
<DirectoryMatch "^/var/www/combined/(?<sitename>[^/]+)">
Require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example
</DirectoryMatch>
-</highlight>
+ </highlight>
</usage>
<seealso><directive type="section" module="core">Directory</directive> for
a description of how regular expressions are mixed in with normal
path from the requested URL to the document root to make the
path to the document. Example:</p>
- <highlight language="config">DocumentRoot "/usr/web"</highlight>
+ <highlight language="config">
+DocumentRoot "/usr/web"
+ </highlight>
<p>then an access to
<code>http://my.example.com/index.html</code> refers to
<p>For server configurations that are vulnerable to these problems,
you should disable memory-mapping of delivered files by specifying:</p>
- <highlight language="config">EnableMMAP Off</highlight>
+ <highlight language="config">
+EnableMMAP Off
+ </highlight>
<p>For NFS mounted files, this feature may be disabled explicitly for
the offending files by specifying:</p>
<p>For server configurations that are not vulnerable to these problems,
you may enable this feature by specifying:</p>
- <highlight language="config">EnableSendfile On</highlight>
+ <highlight language="config">
+EnableSendfile On
+ </highlight>
<p>For network mounted files, this feature may be disabled explicitly
for the offending files by specifying:</p>
the <var>file-path</var> is not absolute then it is assumed to be
relative to the <directive module="core">ServerRoot</directive>.</p>
- <highlight language="config">ErrorLog "/var/log/httpd/error_log"</highlight>
+ <highlight language="config">
+ErrorLog "/var/log/httpd/error_log"
+ </highlight>
<p>If the <var>file-path</var>
begins with a pipe character "<code>|</code>" then it is assumed to be a
command to spawn to handle the error log.</p>
- <highlight language="config">ErrorLog "|/usr/local/bin/httpd_errors"</highlight>
+ <highlight language="config">
+ErrorLog "|/usr/local/bin/httpd_errors"
+ </highlight>
<p>See the notes on <a href="../logs.html#piped">piped logs</a> for
more information.</p>
in individual virtual hosts, the final facility specified affects the
entire server.</p>
- <highlight language="config">ErrorLog syslog:user</highlight>
+ <highlight language="config">
+ErrorLog syslog:user
+ </highlight>
<p>Additional modules can provide their own ErrorLog providers. The syntax
is similar to the <code>syslog</code> example above.</p>
<p>This would result in error messages such as:</p>
- <example>
+ <example>
[Thu May 12 08:28:57.652118 2011] [core:error] [pid 8777:tid 4326490112] [client ::1:58619] File does not exist: /usr/local/apache2/htdocs/favicon.ico
</example>
<dd>The number of bytes in the file will be included</dd>
<dt><strong>All</strong></dt>
<dd>All available fields will be used. This is equivalent to:
- <highlight language="config">FileETag INode MTime Size</highlight></dd>
+ <highlight language="config">
+FileETag INode MTime Size
+ </highlight></dd>
<dt><strong>None</strong></dt>
<dd>If a document is file-based, no <code>ETag</code> field will be
included in the response</dd>
<name>Files</name>
<description>Contains directives that apply to matched
filenames</description>
-<syntax><Files "<var>filename</var>"> ... </Files></syntax>
+<syntax><Files <var>filename</var>> ... </Files></syntax>
<contextlist><context>server config</context><context>virtual host</context>
<context>directory</context><context>.htaccess</context>
</contextlist>
<Files "?at.*">
# This would apply to cat.html, bat.html, hat.php and so on.
</Files>
-</highlight>
+ </highlight>
<p><glossary ref="regex">Regular expressions</glossary>
can also be used, with the addition of the
<code>~</code> character. For example:</p>
<Files ~ "\.(gif|jpe?g|png)$">
#...
</Files>
-</highlight>
+ </highlight>
<p>would match most common Internet graphics formats. <directive
module="core" type="section">FilesMatch</directive> is preferred,
does. However, it accepts a <glossary ref="regex">regular
expression</glossary>. For example:</p>
-<highlight language="config">
+ <highlight language="config">
<FilesMatch ".+\.(gif|jpe?g|png)$">
# ...
</FilesMatch>
-</highlight>
+ </highlight>
<p>would match most common Internet graphics formats.</p>
<module>mod_rewrite</module>. In order to prevent confusion, numbered
(unnamed) backreferences are ignored. Use named groups instead.</p>
-<highlight language="config">
+ <highlight language="config">
<FilesMatch "^(?<sitename>[^/]+)">
require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example
</FilesMatch>
-</highlight>
+ </highlight>
</usage>
<seealso><a href="../sections.html">How <Directory>, <Location>
GIF files, but did not want to label them all with <code>.gif</code>,
you might want to use:</p>
- <highlight language="config">ForceType image/gif</highlight>
+ <highlight language="config">
+ForceType image/gif
+ </highlight>
<p>Note that this directive overrides other indirect media type
associations defined in mime.types or via the
directives if and only if the expression evaluates to true.
For example:</p>
- <highlight language="config"><If "-z req('Host')"></highlight>
+ <highlight language="config">
+<If "-z req('Host')">
+ </highlight>
<p>would match HTTP/1.0 requests without a <var>Host:</var> header.
Expressions may contain various shell-like operators for string
and others (<code>-n</code>, <code>-z</code>, <code>-f</code>, ...).
It is also possible to use regular expressions, </p>
- <highlight language="config"><If "%{QUERY_STRING} =~ /(delete|commit)=.*?elem/"></highlight>
+ <highlight language="config">
+<If "%{QUERY_STRING} =~ /(delete|commit)=.*?elem/">
+ </highlight>
<p>shell-like pattern matches and many other operations. These operations
can be done on request headers (<code>req</code>), environment variables
path. This example will fail if there is no subdirectory in conf/vhosts
that contains at least one *.conf file:</p>
- <highlight language="config">Include conf/vhosts/*/*.conf</highlight>
+ <highlight language="config">
+Include conf/vhosts/*/*.conf
+ </highlight>
<p>Alternatively, the following command will just be ignored in case of
missing files or directories:</p>
- <highlight language="config">IncludeOptional conf/vhosts/*/*.conf</highlight>
+ <highlight language="config">
+IncludeOptional conf/vhosts/*/*.conf
+ </highlight>
</usage>
determines how deeply subrequests may be nested. If you specify only one
<var>number</var>, it will be assigned to both limits.</p>
- <highlight language="config">LimitInternalRecursion 5</highlight>
+ <highlight language="config">
+LimitInternalRecursion 5
+ </highlight>
</usage>
</directivesynopsis>
location and wish to limit the size of the uploaded file to 100K,
you might use the following directive:</p>
- <highlight language="config">LimitRequestBody 102400</highlight>
+ <highlight language="config">
+LimitRequestBody 102400
+ </highlight>
<note><p>For a full description of how this directive is interpreted by
proxy requests, see the <module>mod_proxy</module> documentation.</p>
<p>For example:</p>
- <highlight language="config">LimitRequestFields 50</highlight>
+ <highlight language="config">
+LimitRequestFields 50
+ </highlight>
<note type="warning"><title>Warning</title>
<p> When name-based virtual hosting is used, the value for this
<p>For example:</p>
- <highlight language="config">LimitRequestFieldSize 4094</highlight>
+ <highlight language="config">
+LimitRequestFieldSize 4094
+ </highlight>
<note>Under normal conditions, the value should not be changed from
the default.</note>
<p>For example:</p>
- <highlight language="config">LimitRequestLine 4094</highlight>
+ <highlight language="config">
+LimitRequestLine 4094
+ </highlight>
<note>Under normal conditions, the value should not be changed from
the default.</note>
<p>Example:</p>
- <highlight language="config">LimitXMLRequestBody 0</highlight>
+ <highlight language="config">
+LimitXMLRequestBody 0
+ </highlight>
</usage>
</directivesynopsis>
<description>Applies the enclosed directives only to matching
URLs</description>
<syntax><Location
- "<var>URL-path</var>|<var>URL</var>"> ... </Location></syntax>
+ <var>URL-path</var>|<var>URL</var>> ... </Location></syntax>
<contextlist><context>server config</context><context>virtual host</context>
</contextlist>
<Location ~ "/(extra|special)/data">
#...
</Location>
-</highlight>
+ </highlight>
<p>would match URLs that contained the substring <code>/extra/data</code>
or <code>/special/data</code>. The directive <directive
<LocationMatch "/(extra|special)/data">
# ...
</LocationMatch>
-</highlight>
+ </highlight>
<p>would match URLs that contained the substring <code>/extra/data</code>
or <code>/special/data</code>.</p>
regular expression with a <code>^</code> to require this.</p>
<highlight language="config">
- <LocationMatch "^/(extra|special)/data">
+<LocationMatch "^/(extra|special)/data">
</highlight>
</note>
<module>mod_rewrite</module>. In order to prevent confusion, numbered
(unnamed) backreferences are ignored. Use named groups instead.</p>
-<highlight language="config">
+ <highlight language="config">
<LocationMatch "^/combined/(?<sitename>[^/]+)">
require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example
</LocationMatch>
-</highlight>
+ </highlight>
</usage>
<seealso><a href="../sections.html">How <Directory>, <Location>
<p>For example:</p>
- <highlight language="config">LogLevel notice</highlight>
+ <highlight language="config">
+LogLevel notice
+ </highlight>
<note><title>Note</title>
<p>When logging to a regular file, messages of the level
<note>
Per directory loglevel configuration only affects messages that are
- logged after the request has been parsed and that are associated with
- the request. Log messages which are associated with the connection or
- the server are not affected.
+ logged after the request has been parsed and that are associated with
+ the request. Log messages which are associated with the connection or
+ the server are not affected.
</note>
</usage>
<seealso><directive module="core">ErrorLog</directive></seealso>
<p>For example:</p>
- <highlight language="config">MaxKeepAliveRequests 500</highlight>
+ <highlight language="config">
+MaxKeepAliveRequests 500
+ </highlight>
</usage>
</directivesynopsis>
<p>Normally, if multiple <directive>Options</directive> could
apply to a directory, then the most specific one is used and
others are ignored; the options are not merged. (See <a
- href="../sections.html#mergin">how sections are merged</a>.)
+ href="../sections.html#merging">how sections are merged</a>.)
However if <em>all</em> the options on the
<directive>Options</directive> directive are preceded by a
<code>+</code> or <code>-</code> symbol, the options are
otherwise, <code>http</code> is assumed for port 80 and <code>https</code>
for port 443.</p>
- <p>For example, if you are running <code>https</code> on a non-standard port, specify the protocol explicitly:</p>
+ <p>For example, if you are running <code>https</code> on a non-standard port,
+ specify the protocol explicitly:</p>
- <highlight language="config">Protocol https</highlight>
+ <highlight language="config">
+Protocol https
+ </highlight>
<p>You can also specify the protocol using the <directive module="mpm_common">Listen</directive> directive.</p>
</usage>
specify:</p>
<highlight language="config">
- Protocols h2 http/1.1
+Protocols h2 http/1.1
</highlight>
<p>Valid protocols are <code>http/1.1</code> for http and https connections,
by the shebang line (first line, starting with <code>#!</code>) in the
script. On Win32 systems this line usually looks like:</p>
- <highlight language="perl">#!C:/Perl/bin/perl.exe</highlight>
+ <highlight language="perl">
+#!C:/Perl/bin/perl.exe
+ </highlight>
<p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
- <highlight language="perl">#!perl</highlight>
+ <highlight language="perl">
+#!perl
+ </highlight>
<p>Setting <code>ScriptInterpreterSource Registry</code> will
cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
<p>It may be worth setting up a dedicated address for this, e.g.</p>
- <highlight language="config">ServerAdmin www-admin@foo.example.com</highlight>
+ <highlight language="config">
+ServerAdmin www-admin@foo.example.com
+ </highlight>
<p>as users do not always mention that they are talking about the
server!</p>
</usage>
<p>The complete list of names in the <directive type="section" module="core"
>VirtualHost</directive>
- directive are treated just like a (non wildcard)
+ directive are treated just like a (non wildcard)
<directive>ServerAlias</directive>.</p>
</usage>
and you wish the web server to be so identified, the following
directive should be used:</p>
- <highlight language="config">ServerName www.example.com</highlight>
+ <highlight language="config">
+ServerName www.example.com
+ </highlight>
<p>The <directive>ServerName</directive> directive
may appear anywhere within the definition of a server. However,
server attempts to deduce the client visible hostname by first asking
the operating system for the system hostname, and if that fails,
performing a reverse lookup on an IP address present on the system.</p>
-
+
<p>If no port is specified in the
<directive>ServerName</directive>, then the server will use the
port from the incoming request. For optimal reliability and
module="mod_so">LoadModule</directive>, for example) are taken as
relative to this directory.</p>
- <highlight language="config">ServerRoot "/home/httpd"</highlight>
+ <highlight language="config">
+ServerRoot "/home/httpd"
+ </highlight>
<p>The default location of <directive>ServerRoot</directive> may be
modified by using the <code>--prefix</code> argument to
of extension, you might put the following into an
<code>.htaccess</code> file in that directory:</p>
- <highlight language="config">SetHandler imap-file</highlight>
+ <highlight language="config">
+SetHandler imap-file
+ </highlight>
<p>Another example: if you wanted to have the server display a
status report whenever a URL of
<usage>
<p>This directive controls whether HTTP trailers are copied into the
- internal representation of HTTP headers. This merging occurs when the
- request body has been completely consumed, long after most header
+ internal representation of HTTP headers. This merging occurs when the
+ request body has been completely consumed, long after most header
processing would have a chance to examine or modify request headers.</p>
<p>This option is provided for compatibility with releases prior to 2.4.11,
where trailers were always merged.</p>
<directivesynopsis>
<name>QualifyRedirectURL</name>
<description>Controls whether the REDIRECT_URL environment variable is
-fully qualified</description>
+ fully qualified</description>
<syntax>QualifyRedirectURL ON|OFF</syntax>
<default>QualifyRedirectURL OFF</default>
<contextlist><context>server config</context><context>virtual host</context>