core.xml revision 6954edc623ca2c179eb5b33e97e4304d06fd649f
530eba85dbd41b8a0fa5255d3648d1440199a661slive<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e942c741056732f50da2074b36fe59805d370650slive<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
5f5d1b4cc970b7f06ff8ef6526128e9a27303d88nd<!-- $LastChangedRevision$ -->
6fbd2e53c97ea6976d93e0ac521adabc55e0fb73nd Copyright 2002-2004 The Apache Software Foundation
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Licensed under the Apache License, Version 2.0 (the "License");
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd you may not use this file except in compliance with the License.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd You may obtain a copy of the License at
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd Unless required by applicable law or agreed to in writing, software
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd distributed under the License is distributed on an "AS IS" BASIS,
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd See the License for the specific language governing permissions and
d5d794fc2f4cc9ca6d6da17cfa2cdcd8d244bacdnd limitations under the License.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Core Apache HTTP Server features that are always
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveavailable</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<description>Resources accept trailing pathname information</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>virtual host</context><context>directory</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<compatibility>Available in Apache 2.0.30 and later</compatibility>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive controls whether requests that contain trailing
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive pathname information that follows an actual filename (or
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive non-existent file in an existing directory) will be accepted or
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive rejected. The trailing pathname information can be made
fb77c505254b6e9c925e23e734463e87574f8f40kess available to scripts in the <code>PATH_INFO</code> environment
fb77c505254b6e9c925e23e734463e87574f8f40kess variable.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For example, assume the location <code>/test/</code> points to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive a directory that contains only the single file
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The three possible arguments for the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive>AcceptPathInfo</directive> directive are:</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess <dt><code>Off</code></dt><dd>A request will only be accepted if it
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive maps to a literal path that exists. Therefore a request with
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive trailing pathname information after the true filename such as
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>/test/here.html/more</code> in the above example will return
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive a 404 NOT FOUND error.</dd>
fb77c505254b6e9c925e23e734463e87574f8f40kess <dt><code>On</code></dt><dd>A request will be accepted if a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive leading path component maps to a file that exists. The above
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive example <code>/test/here.html/more</code> will be accepted if
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>/test/here.html</code> maps to a valid file.</dd>
fb77c505254b6e9c925e23e734463e87574f8f40kess <dt><code>Default</code></dt><dd>The treatment of requests with
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive trailing pathname information is determined by the <a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive href="/handler.html">handler</a> responsible for the request.
fb77c505254b6e9c925e23e734463e87574f8f40kess The core handler for normal files defaults to rejecting
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <code>PATH_INFO</code> requests. Handlers that serve scripts, such as <a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The primary purpose of the <code>AcceptPathInfo</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive is to allow you to override the handler's choice of
fb77c505254b6e9c925e23e734463e87574f8f40kess accepting or rejecting <code>PATH_INFO</code>. This override is required,
fb77c505254b6e9c925e23e734463e87574f8f40kess for example, when you use a <a href="/filter.html">filter</a>, such
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive as <a href="mod_include.html">INCLUDES</a>, to generate content
fb77c505254b6e9c925e23e734463e87574f8f40kess based on <code>PATH_INFO</code>. The core handler would usually reject
fb77c505254b6e9c925e23e734463e87574f8f40kess the request, so you can use the following configuration to enable
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive such a script:</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd Options +Includes<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd SetOutputFilter INCLUDES<br />
ef8e89e090461194ecadd31e8796a2c51e0531a2kess AcceptPathInfo On<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Files>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Name of the distributed configuration file</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>AccessFileName <var>filename</var> [<var>filename</var>] ...</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>While processing a request the server looks for
003f0c9fda6664daf5092a0e42f65ede20098153slive the first existing configuration file from this list of names in
003f0c9fda6664daf5092a0e42f65ede20098153slive every directory of the path to the document, if distributed
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess configuration files are <a href="#allowoverride">enabled for that
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd AccessFileName .acl
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>before returning the document
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>/usr/local/web/index.html</code>, the server will read
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive for directives, unless they have been disabled with</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <Directory /><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd AllowOverride None<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">AllowOverride</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/configuring.html">Configuration Files</a></seealso>
1a3f62ca37273a15a06bb94a61d3c6fcf4bf38c9rbowen<seealso><a href="/howto/htaccess.html">.htaccess Files</a></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding<description>Default charset parameter to be added when a response
684f2a9a422185adda0692a1203c5ad6687fc5c5ndcontent-type is <code>text/plain</code> or <code>text/html</code></description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>AddDefaultCharset On|Off|<var>charset</var></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>virtual host</context><context>directory</context>
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding <p>This directive specifies a default value for the media type
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding charset parameter (the name of a character encoding) to be added
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding to a response if and only if the response's content-type is either
684f2a9a422185adda0692a1203c5ad6687fc5c5nd <code>text/plain</code> or <code>text/html</code>. This should override
684f2a9a422185adda0692a1203c5ad6687fc5c5nd any charset specified in the body of the document via a <code>META</code>
684f2a9a422185adda0692a1203c5ad6687fc5c5nd element, though the exact behavior is often dependent on the user's client
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding configuration. A setting of <code>AddDefaultCharset Off</code>
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding disables this functionality. <code>AddDefaultCharset On</code> enables
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding a default charset of <code>iso-8859-1</code>. Any other value is assumed
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding to be the <var>charset</var> to be used, which should be one of the
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding <a href="http://www.iana.org/assignments/character-sets">IANA registered
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding charset values</a> for use in MIME media types.
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding For example:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd AddDefaultCharset utf-8
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
684f2a9a422185adda0692a1203c5ad6687fc5c5nd <p><directive>AddDefaultCharset</directive> should only be used when all
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding of the text resources to which it applies are known to be in that
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding character encoding and it is too inconvenient to label their charset
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding individually. One such example is to add the charset parameter
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding to resources containing generated content, such as legacy CGI
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding scripts, that might be vulnerable to cross-site scripting attacks
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding due to user-provided data being included in the output. Note, however,
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding that a better solution is to just fix (or delete) those scripts, since
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding setting a default charset does not protect users that have enabled
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding the "auto-detect character encoding" feature on their browser.</p>
843a03fe0b138a4c1f64cb90a014e9417ac30691fielding<seealso><directive module="mod_mime">AddCharset</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
58699879a562774640b95e9eedfd891f336e38c2nd<directivesynopsis>
58699879a562774640b95e9eedfd891f336e38c2nd<description>assigns an output filter to a particular MIME-type</description>
fb77c505254b6e9c925e23e734463e87574f8f40kess<syntax>AddOutputFilterByType <var>filter</var>[;<var>filter</var>...]
fb77c505254b6e9c925e23e734463e87574f8f40kess<var>MIME-type</var> [<var>MIME-type</var>] ...</syntax>
58699879a562774640b95e9eedfd891f336e38c2nd<context>virtual host</context><context>directory</context>
58699879a562774640b95e9eedfd891f336e38c2nd<compatibility>Available in Apache 2.0.33 and later</compatibility>
58699879a562774640b95e9eedfd891f336e38c2nd href="/filter.html">filter</a> for a request depending on the
58699879a562774640b95e9eedfd891f336e38c2nd response MIME-type.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>The following example uses the <code>DEFLATE</code> filter, which
fb77c505254b6e9c925e23e734463e87574f8f40kess is provided by <module>mod_deflate</module>. It will compress all
fb77c505254b6e9c925e23e734463e87574f8f40kess output (either static or dynamic) which is labeled as
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>text/html</code> or <code>text/plain</code> before it is sent
fb77c505254b6e9c925e23e734463e87574f8f40kess to the client.</p>
58699879a562774640b95e9eedfd891f336e38c2nd </example>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <p>If you want the content to be processed by more than one filter, their
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess names have to be separated by semicolons. It's also possible to use one
58699879a562774640b95e9eedfd891f336e38c2nd <directive>AddOutputFilterByType</directive> directive for each of
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess these filters.</p>
58699879a562774640b95e9eedfd891f336e38c2nd <p>The configuration below causes all script output labeled as
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>INCLUDES</code> filter and then by the <code>DEFLATE</code>
fb77c505254b6e9c925e23e734463e87574f8f40kess filter.</p>
58699879a562774640b95e9eedfd891f336e38c2nd <Location /cgi-bin/><br />
58699879a562774640b95e9eedfd891f336e38c2nd Options Includes<br />
58699879a562774640b95e9eedfd891f336e38c2nd </Location>
58699879a562774640b95e9eedfd891f336e38c2nd </example>
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd <p>Enabling filters with <directive>AddOutputFilterByType</directive>
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick may fail partially or completely in some cases. For example, no
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess filters are applied if the MIME-type could not be determined and falls
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess back to the <directive module="core">DefaultType</directive> setting,
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess even if the <directive module="core">DefaultType</directive> is the
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd <p>However, if you want to make sure, that the filters will be
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick applied, assign the content type to a resource explicitly, for
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd example with <directive module="mod_mime">AddType</directive> or
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd <directive module="core">ForceType</directive>. Setting the
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd content type within a (non-nph) CGI script is also safe.</p>
ec9b02c6869b75575ada34c800672162833a2c06nd <p>The by-type output filters are never applied on proxy requests.</p>
58699879a562774640b95e9eedfd891f336e38c2nd<seealso><directive module="mod_mime">AddOutputFilter</directive></seealso>
58699879a562774640b95e9eedfd891f336e38c2nd<seealso><directive module="core">SetOutputFilter</directive></seealso>
58699879a562774640b95e9eedfd891f336e38c2nd</directivesynopsis>
77ead9e0262e4f08ec336d1a65b2edef7705c839nd<directivesynopsis>
9583adab6bc4b3758e41963c905d9dad9f067131nd<description>Determines whether encoded path separators in URLs are allowed to
77ead9e0262e4f08ec336d1a65b2edef7705c839ndbe passed through</description>
77ead9e0262e4f08ec336d1a65b2edef7705c839nd<contextlist><context>server config</context><context>virtual host</context>
77ead9e0262e4f08ec336d1a65b2edef7705c839nd</contextlist>
77ead9e0262e4f08ec336d1a65b2edef7705c839nd<compatibility>Available in Apache 2.0.46 and later</compatibility>
77ead9e0262e4f08ec336d1a65b2edef7705c839nd <p>The <directive>AllowEncodedSlashes</directive> directive allows URLs
77ead9e0262e4f08ec336d1a65b2edef7705c839nd which contain encoded path separators (<code>%2F</code> for <code>/</code>
77ead9e0262e4f08ec336d1a65b2edef7705c839nd and additionally <code>%5C</code> for <code>\</code> on according systems)
77ead9e0262e4f08ec336d1a65b2edef7705c839nd to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
77ead9e0262e4f08ec336d1a65b2edef7705c839nd <p>Turning <directive>AllowEncodedSlashes</directive> <code>On</code> is
77ead9e0262e4f08ec336d1a65b2edef7705c839nd mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
77ead9e0262e4f08ec336d1a65b2edef7705c839nd <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
77ead9e0262e4f08ec336d1a65b2edef7705c839nd according systems) will be left as such in the otherwise decoded URL
77ead9e0262e4f08ec336d1a65b2edef7705c839nd string.</p>
77ead9e0262e4f08ec336d1a65b2edef7705c839nd<seealso><directive module="core">AcceptPathInfo</directive></seealso>
77ead9e0262e4f08ec336d1a65b2edef7705c839nd</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Types of directives that are allowed in
fb77c505254b6e9c925e23e734463e87574f8f40kess<syntax>AllowOverride All|None|<var>directive-type</var>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>directory</context></contextlist>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>When the server finds an <code>.htaccess</code> file (as
fb77c505254b6e9c925e23e734463e87574f8f40kess specified by <directive module="core">AccessFileName</directive>)
fb77c505254b6e9c925e23e734463e87574f8f40kess it needs to know which directives declared in that file can override
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess earlier configuration directives.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <note><title>Only available in <Directory> sections</title>
10673857794a4b3d9568ca2d983722a87ed352f1rbowen <directive>AllowOverride</directive> is valid only in
fb77c505254b6e9c925e23e734463e87574f8f40kess <directive type="section" module="core">Directory</directive>
b12b918ae6baf9c5762ed61b7393d0e2198378c0nd sections specified without regular expressions, not in <directive
b12b918ae6baf9c5762ed61b7393d0e2198378c0nd type="section" module="core">Location</directive>, <directive
b12b918ae6baf9c5762ed61b7393d0e2198378c0nd module="core" type="section">DirectoryMatch</directive> or
b12b918ae6baf9c5762ed61b7393d0e2198378c0nd <directive type="section" module="core">Files</directive> sections.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>When this directive is set to <code>None</code>, then
fb77c505254b6e9c925e23e734463e87574f8f40kess <a href="#accessfilename">.htaccess</a> files are completely ignored.
fb77c505254b6e9c925e23e734463e87574f8f40kess In this case, the server will not even attempt to read
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>When this directive is set to <code>All</code>, then any
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive which has the .htaccess <a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive href="directive-dict.html#Context">Context</a> is allowed in
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The <var>directive-type</var> can be one of the following
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive groupings of directives.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Allow use of the authorization directives (<directive
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz module="mod_authn_dbm">AuthDBMGroupFile</directive>,
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz <directive module="mod_authn_dbm">AuthDBMUserFile</directive>,
9ed9eaf871c58d281af02e76125ceadb5060afa5nd <directive module="mod_authz_groupfile">AuthGroupFile</directive>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="core">AuthType</directive>, <directive
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz module="mod_authn_file">AuthUserFile</directive>, <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">Require</directive>, <em>etc.</em>).</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Allow use of the directives controlling document types (<directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="mod_negotiation">LanguagePriority</directive>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="core">SetHandler</directive>, <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Allow use of the directives controlling directory indexing
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive (<directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="mod_autoindex">AddIcon</directive>, <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="mod_autoindex">AddIconByType</directive>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="mod_autoindex">DefaultIcon</directive>, <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="mod_dir">DirectoryIndex</directive>, <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="mod_autoindex">FancyIndexing</directive>, <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="mod_autoindex">HeaderName</directive>, <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="mod_autoindex">IndexIgnore</directive>, <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="mod_autoindex">IndexOptions</directive>, <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Allow use of the directives controlling host access (<directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Allow use of the directives controlling specific directory
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive features (<directive module="core">Options</directive> and
103a93c625bcde1a6a7a5155b64dcda36f612180pquerna <directive module="mod_include">XBitHack</directive>).
103a93c625bcde1a6a7a5155b64dcda36f612180pquerna An equal sign may be given followed by a comma (but no spaces)
f23fb63b05f89f47d7a3099491f2c68dcce432e9kess separated lists of options that may be set using the <directive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd AllowOverride AuthConfig Indexes
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
b12b918ae6baf9c5762ed61b7393d0e2198378c0nd <p>In the example above all directives that are neither in the group
b12b918ae6baf9c5762ed61b7393d0e2198378c0nd <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
b12b918ae6baf9c5762ed61b7393d0e2198378c0nd server error.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">AccessFileName</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/configuring.html">Configuration Files</a></seealso>
54bcd0e21a5c79158afd3b78bf707a493a5fb33crbowen<seealso><a href="/howto/htaccess.html">.htaccess Files</a></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Authorization realm for use in HTTP
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveauthentication</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive sets the name of the authorization realm for a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directory. This realm is given to the client so that the user
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive knows which username and password to send.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive>AuthName</directive> takes a single argument; if the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive realm name contains spaces, it must be enclosed in quotation
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive marks. It must be accompanied by <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">Require</directive> directives, and directives such
9ed9eaf871c58d281af02e76125ceadb5060afa5nd as <directive module="mod_authn_file">AuthUserFile</directive> and
9ed9eaf871c58d281af02e76125ceadb5060afa5nd <directive module="mod_authz_groupfile">AuthGroupFile</directive> to
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd AuthName "Top Secret"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
1c9f7cdf2e1bc8313e559a96638c3c36e3143791yoshiki <p>The string provided for the <code>AuthName</code> is what will
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive appear in the password dialog provided by most browsers.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess href="/howto/auth.html">Authentication, Authorization, and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>directory</context><context>.htaccess</context>
530eba85dbd41b8a0fa5255d3648d1440199a661slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive selects the type of user authentication for a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directory. Only <code>Basic</code> and <code>Digest</code> are
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess currently implemented.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive It must be accompanied by <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">Require</directive> directives, and directives such
9ed9eaf871c58d281af02e76125ceadb5060afa5nd as <directive module="mod_authn_file">AuthUserFile</directive> and
9ed9eaf871c58d281af02e76125ceadb5060afa5nd <directive module="mod_authz_groupfile">AuthGroupFile</directive> to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/howto/auth.html">Authentication, Authorization,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes<directivesynopsis>
fb77c505254b6e9c925e23e734463e87574f8f40kess<description>Technique for locating the interpreter for CGI
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholesscripts</description>
fb77c505254b6e9c925e23e734463e87574f8f40kess<syntax>CGIMapExtension <var>cgi-path</var> <var>.extension</var></syntax>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes<contextlist><context>directory</context><context>.htaccess</context>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes</contextlist>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes <p>This directive is used to control how Apache finds the
fb77c505254b6e9c925e23e734463e87574f8f40kess interpreter used to run CGI scripts. For example, setting
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess cause all CGI script files with a <code>.foo</code> extension to
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess be passed to the FOO interpreter.</p>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<description>Enables the generation of <code>Content-MD5</code> HTTP Response
fb77c505254b6e9c925e23e734463e87574f8f40kessheaders</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive enables the generation of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>Content-MD5</code> headers as defined in RFC1864
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive respectively RFC2068.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>MD5 is an algorithm for computing a "message digest"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive (sometimes called "fingerprint") of arbitrary-length data, with
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive a high degree of confidence that any alterations in the data
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive will be reflected in alterations in the message digest.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code>Content-MD5</code> header provides an end-to-end
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive message integrity check (MIC) of the entity-body. A proxy or
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive client may check this header for detecting accidental
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive modification of the entity-body in transit. Example header:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Note that this can cause performance problems on your server
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive since the message digest is computed on every request (the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive values are not cached).</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><code>Content-MD5</code> is only sent for documents served
fb77c505254b6e9c925e23e734463e87574f8f40kess by the <module>core</module>, and not by any module. For example,
fb77c505254b6e9c925e23e734463e87574f8f40kess SSI documents, output from CGI scripts, and byte range responses
fb77c505254b6e9c925e23e734463e87574f8f40kess do not have this header.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>MIME content-type that will be sent if the
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveserver cannot determine a type in any other way</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>There will be times when the server is asked to provide a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive document whose type cannot be determined by its MIME types
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive mappings.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The server must inform the client of the content-type of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive document, so in the event of an unknown type it uses the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <p>would be appropriate for a directory which contained many GIF
fb77c505254b6e9c925e23e734463e87574f8f40kess images with filenames missing the <code>.gif</code> extension.</p>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess module="core">ForceType</directive>, this directive only
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive provides the default mime-type. All other mime-type definitions,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive including filename extensions, that might identify the media type
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess will override this default.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Enclose a group of directives that apply only to the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivenamed file-system directory and sub-directories</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive... </Directory></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><directive type="section">Directory</directive> and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code></Directory></code> are used to enclose a group of
003f0c9fda6664daf5092a0e42f65ede20098153slive directives that will apply only to the named directory and
003f0c9fda6664daf5092a0e42f65ede20098153slive sub-directories of that directory. Any directive that is allowed
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd in a directory context may be used. <var>Directory-path</var> is
003f0c9fda6664daf5092a0e42f65ede20098153slive either the full path to a directory, or a wild-card string using
fb77c505254b6e9c925e23e734463e87574f8f40kess Unix shell-style matching. In a wild-card string, <code>?</code> matches
fb77c505254b6e9c925e23e734463e87574f8f40kess any single character, and <code>*</code> matches any sequences of
fb77c505254b6e9c925e23e734463e87574f8f40kess characters. You may also use <code>[]</code> character ranges. None
fb77c505254b6e9c925e23e734463e87574f8f40kess of the wildcards match a `/' character, so <code><Directory
003f0c9fda6664daf5092a0e42f65ede20098153slive /*/public_html></code> will not match
003f0c9fda6664daf5092a0e42f65ede20098153slive <code>/home/user/public_html</code>, but <code><Directory
003f0c9fda6664daf5092a0e42f65ede20098153slive /home/*/public_html></code> will match. Example:</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd Options Indexes FollowSymLinks<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Be careful with the <var>directory-path</var> arguments:
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd They have to literally match the filesystem path which Apache uses
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd to access the files. Directives applied to a particular
fb77c505254b6e9c925e23e734463e87574f8f40kess <code><Directory></code> will not apply to files accessed from
fb77c505254b6e9c925e23e734463e87574f8f40kess that same directory via a different path, such as via different symbolic
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd links.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Extended regular
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive expressions can also be used, with the addition of the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <Directory ~ "^/www/.*/[0-9]{3}">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>would match directories in <code>/www/</code> that consisted of
fb77c505254b6e9c925e23e734463e87574f8f40kess three numbers.</p>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess match the directory (or one of its parents) containing a document,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive then the directives are applied in the order of shortest match
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive first, interspersed with the directives from the <a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive href="#accessfilename">.htaccess</a> files. For example,
130d299c4b2b15be45532a176604c71fdc7bea5bnd <Directory /><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd AllowOverride None<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd <Directory /home/><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd AllowOverride FileInfo<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>for access to the document <code>/home/web/dir/doc.html</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the steps are:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li>Apply directive <code>AllowOverride FileInfo</code> (for
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <code>/home/web/dir/.htaccess</code> in that order.</li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Regular expressions are not considered until after all of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive normal sections have been applied. Then all of the regular
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive expressions are tested in the order they appeared in the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive configuration file. For example, with</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <Directory ~ abc$><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd # ... directives here ...<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>the regular expression section won't be considered until after
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess all normal <directive type="section">Directory</directive>s and
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <code>.htaccess</code> files have been applied. Then the regular
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess expression will match on <code>/home/abc/public_html/abc</code> and
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess the corresponding <directive type="section">Directory</directive> will
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess be applied.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess <code><Directory /></code> is <code>Allow from All</code>.
fb77c505254b6e9c925e23e734463e87574f8f40kess This means that Apache will serve any file mapped from an URL. It is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive recommended that you change this with a block such
130d299c4b2b15be45532a176604c71fdc7bea5bnd <Directory /><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd Order Deny,Allow<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd Deny from All<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive href="/misc/security_tips.html">Security Tips</a> page for more
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>The directory sections occur in the <code>httpd.conf</code> file.
fb77c505254b6e9c925e23e734463e87574f8f40kess <directive type="section">Directory</directive> directives
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive cannot nest, and cannot appear in a <directive module="core"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type="section">Limit</directive> or <directive module="core"
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<seealso><a href="/sections.html">How <Directory>,
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <Location> and <Files> sections work</a> for an
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive explanation of how these different sections are combined when a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request is received</seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<description>Enclose directives that apply to
15ba1801088da1aad6d20609cf3f7b0b1eefce8aslivefile-system directories matching a regular expression and their
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivesubdirectories</description>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive... </DirectoryMatch></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><directive type="section">DirectoryMatch</directive> and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code></DirectoryMatch></code> are used to enclose a group
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of directives which will apply only to the named directory and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive sub-directories of that directory, the same as <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core" type="section">Directory</directive>. However, it
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive takes as an argument a regular expression. For example:</p>
6954edc623ca2c179eb5b33e97e4304d06fd649frbowen <DirectoryMatch "^/www/(.+/)?[0-9]{3}">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>would match directories in <code>/www/</code> that consisted of three
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive numbers.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive type="section" module="core">Directory</directive> for
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivea description of how regular expressions are mixed in with normal
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<directive type="section">Directory</directive>s</seealso>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkesshref="/sections.html">How <Directory>, <Location> and
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<Files> sections work</a> for an explanation of how these different
313bb560bc5c323cfd40c9cad7335b4b8e060aedkesssections are combined when a request is received</seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Directory that forms the main document tree visible
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivefrom the web</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<default>DocumentRoot /usr/local/apache/htdocs</default>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd <p>This directive sets the directory from which <program>httpd</program>
fb77c505254b6e9c925e23e734463e87574f8f40kess will serve files. Unless matched by a directive like <directive
fb77c505254b6e9c925e23e734463e87574f8f40kess module="mod_alias">Alias</directive>, the server appends the
fb77c505254b6e9c925e23e734463e87574f8f40kess path from the requested URL to the document root to make the
fb77c505254b6e9c925e23e734463e87574f8f40kess path to the document. Example:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>then an access to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>http://www.my.host.com/index.html</code> refers to
c68acc9d712af079afa2bd1a5a4aeef9a3ea573ckess <code>/usr/web/index.html</code>. If the <var>directory-path</var> is
c68acc9d712af079afa2bd1a5a4aeef9a3ea573ckess not absolute then it is assumed to be relative to the <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>DocumentRoot</directive> should be specified without
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive a trailing slash.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/urlmapping.html">Mapping URLs to Filesystem
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
af18698b10b429b270551ca3a5d51a75e1c9db22brianp<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Use memory-mapping to read files during delivery</description>
af18698b10b429b270551ca3a5d51a75e1c9db22brianp<contextlist><context>server config</context><context>virtual host</context>
af18698b10b429b270551ca3a5d51a75e1c9db22brianp<context>directory</context><context>.htaccess</context>
af18698b10b429b270551ca3a5d51a75e1c9db22brianp</contextlist>
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd <p>This directive controls whether the <program>httpd</program> may use
003f0c9fda6664daf5092a0e42f65ede20098153slive memory-mapping if it needs to read the contents of a file during
003f0c9fda6664daf5092a0e42f65ede20098153slive delivery. By default, when the handling of a request requires
fb77c505254b6e9c925e23e734463e87574f8f40kess access to the data within a file -- for example, when delivering a
fb77c505254b6e9c925e23e734463e87574f8f40kess server-parsed file using <module>mod_include</module> -- Apache
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd memory-maps the file if the OS supports it.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>This memory-mapping sometimes yields a performance improvement.
af18698b10b429b270551ca3a5d51a75e1c9db22brianp But in some environments, it is better to disable the memory-mapping
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd to prevent operational problems:</p>
af18698b10b429b270551ca3a5d51a75e1c9db22brianp <li>On some multiprocessor systems, memory-mapping can reduce the
af18698b10b429b270551ca3a5d51a75e1c9db22brianp <li>With an NFS-mounted <directive module="core">DocumentRoot</directive>,
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd the <program>httpd</program> may crash due to a segmentation fault if a file
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd is deleted or truncated while the <program>httpd</program> has it
fb77c505254b6e9c925e23e734463e87574f8f40kess memory-mapped.</li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>For server configurations that are vulnerable to these problems,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd you should disable memory-mapping of delivered files by specifying:</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess EnableMMAP Off
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
41ef8b3051855b802104193ee0a587515af60a37wrowe <p>For NFS mounted files, this feature may be disabled explicitly for
41ef8b3051855b802104193ee0a587515af60a37wrowe the offending files by specifying:</p>
41ef8b3051855b802104193ee0a587515af60a37wrowe <Directory "/path-to-nfs-files">
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess EnableMMAP Off
41ef8b3051855b802104193ee0a587515af60a37wrowe </Directory>
41ef8b3051855b802104193ee0a587515af60a37wrowe</directivesynopsis>
41ef8b3051855b802104193ee0a587515af60a37wrowe<directivesynopsis>
41ef8b3051855b802104193ee0a587515af60a37wrowe<description>Use the kernel sendfile support to deliver files to the client</description>
41ef8b3051855b802104193ee0a587515af60a37wrowe<contextlist><context>server config</context><context>virtual host</context>
41ef8b3051855b802104193ee0a587515af60a37wrowe<context>directory</context><context>.htaccess</context>
41ef8b3051855b802104193ee0a587515af60a37wrowe</contextlist>
9fb925624300c864fe3969a264e52aa83f3c2dd0slive<compatibility>Available in version 2.0.44 and later</compatibility>
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd <p>This directive controls whether <program>httpd</program> may use the
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd sendfile support from the kernel to transmit file contents to the client.
41ef8b3051855b802104193ee0a587515af60a37wrowe By default, when the handling of a request requires no access
41ef8b3051855b802104193ee0a587515af60a37wrowe to the data within a file -- for example, when delivering a
41ef8b3051855b802104193ee0a587515af60a37wrowe static file -- Apache uses sendfile to deliver the file contents
41ef8b3051855b802104193ee0a587515af60a37wrowe without ever reading the file if the OS supports it.</p>
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick <p>This sendfile mechanism avoids separate read and send operations,
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess and buffer allocations. But on some platforms or within some
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess filesystems, it is better to disable this feature to avoid
41ef8b3051855b802104193ee0a587515af60a37wrowe operational problems:</p>
41ef8b3051855b802104193ee0a587515af60a37wrowe <li>Some platforms may have broken sendfile support that the build
41ef8b3051855b802104193ee0a587515af60a37wrowe system did not detect, especially if the binaries were built on
9fb925624300c864fe3969a264e52aa83f3c2dd0slive another box and moved to such a machine with broken sendfile
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess support.</li>
78f4d313fd5edf76dc5cfb8725e082a08cd29740jwoolley <li>On Linux the use of sendfile triggers TCP-checksum
78f4d313fd5edf76dc5cfb8725e082a08cd29740jwoolley offloading bugs on certain networking cards when using IPv6.</li>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess module="core">DocumentRoot</directive> (e.g., NFS or SMB),
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess the kernel may be unable to serve the network file through
9fb925624300c864fe3969a264e52aa83f3c2dd0slive its own cache.</li>
41ef8b3051855b802104193ee0a587515af60a37wrowe <p>For server configurations that are vulnerable to these problems,
05201775eaa6b363b8a119c8aea5db246b967591yoshiki you should disable this feature by specifying:</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess EnableSendfile Off
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>For NFS or SMB mounted files, this feature may be disabled explicitly
9fb925624300c864fe3969a264e52aa83f3c2dd0slive for the offending files by specifying:</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <Directory "/path-to-nfs-files">
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess EnableSendfile Off
41ef8b3051855b802104193ee0a587515af60a37wrowe </Directory>
af18698b10b429b270551ca3a5d51a75e1c9db22brianp</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>What the server will return to the client
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivein case of an error</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>ErrorDocument <var>error-code</var> <var>document</var></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<compatibility>Quoting syntax for text messages is different in Apache
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive2.0</compatibility>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>In the event of a problem or error, Apache can be configured
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to do one of four things,</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <li>redirect to a local <var>URL-path</var> to handle the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The first option is the default, while options 2-4 are
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive configured using the <directive>ErrorDocument</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive, which is followed by the HTTP response code and a URL
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive or a message. Apache will sometimes offer additional information
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>URLs can begin with a slash (/) for local URLs, or be a full
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive URL which the client can resolve. Alternatively, a message can
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive be provided to be displayed by the browser. Examples:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd ErrorDocument 403 "Sorry can't allow you access today"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
f7fe99050600166042c04b8e595fb75499eed7f0geoff <p>Additionally, the special value <code>default</code> can be used
f7fe99050600166042c04b8e595fb75499eed7f0geoff to specify Apache's simple hardcoded message. While not required
f7fe99050600166042c04b8e595fb75499eed7f0geoff under normal circumstances, <code>default</code> will restore
f7fe99050600166042c04b8e595fb75499eed7f0geoff Apache's simple hardcoded message for configurations that would
f7fe99050600166042c04b8e595fb75499eed7f0geoff otherwise inherit an existing <directive>ErrorDocument</directive>.</p>
f7fe99050600166042c04b8e595fb75499eed7f0geoff ErrorDocument 404 default<br />
f7fe99050600166042c04b8e595fb75499eed7f0geoff </Directory>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Note that when you specify an <directive>ErrorDocument</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive that points to a remote URL (ie. anything with a method such as
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>http</code> in front of it), Apache will send a redirect to the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive client to tell it where to find the document, even if the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive document ends up being on the same server. This has several
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive implications, the most important being that the client will not
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive receive the original error status code, but instead will
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive receive a redirect status code. This in turn can confuse web
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive robots and other clients which try to determine if a URL is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive valid using the status code. In addition, if you use a remote
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive URL in an <code>ErrorDocument 401</code>, the client will not
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive know to prompt the user for a password since it will not
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive receive the 401 status code. Therefore, <strong>if you use an
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <code>ErrorDocument 401</code> directive then it must refer to a local
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>Microsoft Internet Explorer (MSIE) will by default ignore
fb77c505254b6e9c925e23e734463e87574f8f40kess server-generated error messages when they are "too small" and substitute
fb77c505254b6e9c925e23e734463e87574f8f40kess its own "friendly" error messages. The size threshold varies depending on
4f854c24127e28f7ad72ce9a39d4448aaf910fc1slive the type of error, but in general, if you make your error document
4f854c24127e28f7ad72ce9a39d4448aaf910fc1slive greater than 512 bytes, then MSIE will show the server-generated
4f854c24127e28f7ad72ce9a39d4448aaf910fc1slive error rather than masking it. More information is available in
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick Microsoft Knowledge Base article <a
fb77c505254b6e9c925e23e734463e87574f8f40kess href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Prior to version 2.0, messages were indicated by prefixing
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive them with a single unmatched double quote character.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<description>Location where the server will log errors</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax> ErrorLog <var>file-path</var>|syslog[:<var>facility</var>]</syntax>
3209c0009829fcf63b6213fb9c43d534f7906006slive<default>ErrorLog logs/error_log (Unix) ErrorLog logs/error.log (Windows and OS/2)</default>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>ErrorLog</directive> directive sets the name of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the file to which the server will log any errors it encounters. If
c68acc9d712af079afa2bd1a5a4aeef9a3ea573ckess the <var>file-path</var> is not absolute then it is assumed to be
c68acc9d712af079afa2bd1a5a4aeef9a3ea573ckess relative to the <directive module="core">ServerRoot</directive>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive begins with a pipe (|) then it is assumed to be a command to spawn
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to handle the error log.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Using <code>syslog</code> instead of a filename enables logging
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive via syslogd(8) if the system supports it. The default is to use
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive syslog facility <code>local7</code>, but you can override this by
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd using the <code>syslog:<var>facility</var></code> syntax where
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <var>facility</var> can be one of the names usually documented in
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive syslog(1).</p>
fb109b84906e3ee61680aa289953c2f9e859354erbowen ErrorLog syslog:user
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive href="/misc/security_tips.html#serverroot">security tips</a>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive document for details on why your security could be compromised
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick if the directory where log files are stored is writable by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive anyone other than the user that starts the server.</p>
2bac697634d965d9d9a921a99a68b2c454c8a95dbnicholes <p>When entering a file path on non-Unix platforms, care should be taken
2bac697634d965d9d9a921a99a68b2c454c8a95dbnicholes to make sure that only forward slashed are used even though the platform
2bac697634d965d9d9a921a99a68b2c454c8a95dbnicholes may allow the use of back slashes. In general it is a good idea to always
2bac697634d965d9d9a921a99a68b2c454c8a95dbnicholes use forward slashes throughout the configuration files.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">LogLevel</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/logs.html">Apache Log Files</a></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>File attributes used to create the ETag
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveHTTP response header</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive The <directive>FileETag</directive> directive configures the file
fb77c505254b6e9c925e23e734463e87574f8f40kess attributes that are used to create the <code>ETag</code> (entity
fb77c505254b6e9c925e23e734463e87574f8f40kess tag) response header field when the document is based on a file.
fb77c505254b6e9c925e23e734463e87574f8f40kess (The <code>ETag</code> value is used in cache management to save
fb77c505254b6e9c925e23e734463e87574f8f40kess network bandwidth.) In Apache 1.3.22 and earlier, the
fb77c505254b6e9c925e23e734463e87574f8f40kess from the file's inode, size, and last-modified time (mtime). The
fb77c505254b6e9c925e23e734463e87574f8f40kess <directive>FileETag</directive> directive allows you to choose
fb77c505254b6e9c925e23e734463e87574f8f40kess which of these -- if any -- should be used. The recognized keywords are:
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dd>The file's i-node number will be included in the calculation</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dd>The date and time the file was last modified will be included</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dd>The number of bytes in the file will be included</dd>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <dd>All available fields will be used. This is equivalent to:
fb77c505254b6e9c925e23e734463e87574f8f40kess <dd>If a document is file-based, no <code>ETag</code> field will be
fb77c505254b6e9c925e23e734463e87574f8f40kess included in the response</dd>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd keywords may be prefixed with either <code>+</code> or <code>-</code>,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd which allow changes to be made to the default setting inherited
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd from a broader scope. Any keyword appearing without such a prefix
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd immediately and completely cancels the inherited setting.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>If a directory's configuration includes
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>FileETag INode MTime Size</code>, and a
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd subdirectory's includes <code>FileETag -INode</code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the setting for that subdirectory (which will be inherited by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive any sub-subdirectories that don't override it) will be equivalent to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Contains directives that apply to matched
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivefilenames</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax><Files <var>filename</var>> ... </Files></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive type="section">Files</directive> directive
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess limits the scope of the enclosed directives by filename. It is comparable
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess to the <directive module="core" type="section">Directory</directive>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess and <directive module="core" type="section">Location</directive>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess directives. It should be matched with a <code></Files></code>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess directive. The directives given within this section will be applied to
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess any object with a basename (last component of filename) matching the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive specified filename. <directive type="section">Files</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive sections are processed in the order they appear in the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive configuration file, after the <directive module="core"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>.htaccess</code> files are read, but before <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type="section" module="core">Location</directive> sections. Note
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive that <directive type="section">Files</directive> can be nested
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">Directory</directive> sections to restrict the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive portion of the filesystem they apply to.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The <var>filename</var> argument should include a filename, or
fb77c505254b6e9c925e23e734463e87574f8f40kess a wild-card string, where <code>?</code> matches any single character,
fb77c505254b6e9c925e23e734463e87574f8f40kess and <code>*</code> matches any sequences of characters. Extended regular
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive expressions can also be used, with the addition of the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <Files ~ "\.(gif|jpe?g|png)$">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>would match most common Internet graphics formats. <directive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess module="core" type="section">FilesMatch</directive> is preferred,
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess however.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">Directory</directive> and <directive type="section"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">Location</directive> sections, <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type="section">Files</directive> sections can be used inside
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>.htaccess</code> files. This allows users to control access to
fb77c505254b6e9c925e23e734463e87574f8f40kess their own files, at a file-by-file level.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<seealso><a href="/sections.html">How <Directory>, <Location>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess and <Files> sections work</a> for an explanation of how these
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess different sections are combined when a request is received</seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Contains directives that apply to regular-expression matched
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivefilenames</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax><FilesMatch <var>regex</var>> ... </FilesMatch></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive type="section">FilesMatch</directive> directive
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess limits the scope of the enclosed directives by filename, just as the
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <directive module="core" type="section">Files</directive> directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive does. However, it accepts a regular expression. For example:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <FilesMatch "\.(gif|jpe?g|png)$">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>would match most common Internet graphics formats.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<seealso><a href="/sections.html">How <Directory>, <Location>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess and <Files> sections work</a> for an explanation of how these
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess different sections are combined when a request is received</seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Forces all matching files to be served with the specified
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveMIME content-type</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<compatibility>Moved to the core in Apache 2.0</compatibility>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>When placed into an <code>.htaccess</code> file or a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive type="section" module="core">Directory</directive>, or
fb77c505254b6e9c925e23e734463e87574f8f40kess <directive type="section" module="core">Location</directive> or
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive type="section" module="core">Files</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive section, this directive forces all matching files to be served
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive with the content type identification given by
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <var>MIME-type</var>. For example, if you had a directory full of
fb77c505254b6e9c925e23e734463e87574f8f40kess GIF files, but did not want to label them all with <code>.gif</code>,
fb77c505254b6e9c925e23e734463e87574f8f40kess you might want to use:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Note that unlike <directive module="core">DefaultType</directive>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive this directive overrides all mime-type associations, including
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive filename extensions, that might identify the media type.</p>
7654193c1faf603feec999850322ad79e6c551bcnd <p>You can override any <directive>ForceType</directive> setting
7654193c1faf603feec999850322ad79e6c551bcnd <Location /images><br />
7654193c1faf603feec999850322ad79e6c551bcnd </Location><br />
7654193c1faf603feec999850322ad79e6c551bcnd # but normal mime-type associations here:<br />
c97e8972ab1f4dd167e3dc4db87daf91114009fbnd ForceType None<br />
7654193c1faf603feec999850322ad79e6c551bcnd </Location>
7654193c1faf603feec999850322ad79e6c551bcnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Enables DNS lookups on client IP addresses</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive enables DNS lookups so that host names can be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
fb77c505254b6e9c925e23e734463e87574f8f40kess The value <code>Double</code> refers to doing double-reverse
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess DNS lookup. That is, after a reverse lookup is performed, a forward
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick lookup is then performed on that result. At least one of the IP
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive addresses in the forward lookup must match the original
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive address. (In "tcpwrappers" terminology this is called
9ed9eaf871c58d281af02e76125ceadb5060afa5nd <p>Regardless of the setting, when <module>mod_authz_host</module> is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive used for controlling access by hostname, a double reverse lookup
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive will be performed. This is necessary for security. Note that the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive result of this double-reverse isn't generally available unless you
fb77c505254b6e9c925e23e734463e87574f8f40kess set <code>HostnameLookups Double</code>. For example, if only
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>HostnameLookups On</code> and a request is made to an object
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive that is protected by hostname restrictions, regardless of whether
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the double-reverse fails or not, CGIs will still be passed the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive single-reverse result in <code>REMOTE_HOST</code>.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>The default is <code>Off</code> in order to save the network
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive traffic for those sites that don't truly need the reverse
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive lookups done. It is also better for the end users because they
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive don't have to suffer the extra latency that a lookup entails.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Heavily loaded sites should leave this directive
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>Off</code>, since DNS lookups can take considerable
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd amounts of time. The utility <program>logresolve</program>, compiled by
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd default to the <code>bin</code> subdirectory of your installation
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd directory, can be used to look up host names from logged IP addresses
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd offline.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Encloses directives that will be processed only
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveif a test is true at startup</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </IfDefine></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The <code><IfDefine <var>test</var>>...</IfDefine>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code> section is used to mark directives that are conditional. The
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd directives within an <directive type="section">IfDefine</directive>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd section are only processed if the <var>test</var> is true. If <var>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd test</var> is false, everything between the start and end markers is
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd ignored.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd >IfDefine</directive> section directive can be one of two forms:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>In the former case, the directives between the start and end
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive markers are only processed if the parameter named
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <var>parameter-name</var> is defined. The second format reverses
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the test, and only processes the directives if
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <var>parameter-name</var> is <strong>not</strong> defined.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The <var>parameter-name</var> argument is a define as given on
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd the <program>httpd</program> command line via <code>-D<var>parameter-</var>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><directive type="section">IfDefine</directive> sections are
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive nest-able, which can be used to implement simple
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive multiple-parameter tests. Example:</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd httpd -DReverseProxy ...<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd <IfDefine ReverseProxy><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </IfDefine>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Encloses directives that are processed conditional on the
a04a96aae08a62f2d9d5833b3313a9751fa3f680yoshikipresence or absence of a specific module</description>
55d36f9b61520c2374ab463e77e8a62daa416398nd<syntax><IfModule [!]<var>module-file</var>|<var>module-identifier</var>> ...
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess </IfModule></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
55d36f9b61520c2374ab463e77e8a62daa416398nd<compatibility>Module identifiers are available in version 2.1 and
55d36f9b61520c2374ab463e77e8a62daa416398ndlater.</compatibility>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The <code><IfModule <var>test</var>>...</IfModule></code>
fb77c505254b6e9c925e23e734463e87574f8f40kess section is used to mark directives that are conditional on the presence of
fb77c505254b6e9c925e23e734463e87574f8f40kess a specific module. The directives within an <directive type="section"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd >IfModule</directive> section are only processed if the <var>test</var>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd is true. If <var>test</var> is false, everything between the start and
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd end markers is ignored.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd >IfModule</directive> section directive can be one of two forms:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>In the former case, the directives between the start and end
55d36f9b61520c2374ab463e77e8a62daa416398nd markers are only processed if the module named <var>module</var>
55d36f9b61520c2374ab463e77e8a62daa416398nd is included in Apache -- either compiled in or
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd >LoadModule</directive>. The second format reverses the test,
55d36f9b61520c2374ab463e77e8a62daa416398nd and only processes the directives if <var>module</var> is
55d36f9b61520c2374ab463e77e8a62daa416398nd <p>The <var>module</var> argument can be either the module identifier or
55d36f9b61520c2374ab463e77e8a62daa416398nd the file name of the module, at the time it was compiled. For example,
55d36f9b61520c2374ab463e77e8a62daa416398nd <code>mod_rewrite.c</code> is the file name. If a module consists of
55d36f9b61520c2374ab463e77e8a62daa416398nd several source files, use the name of the file containing the string
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><directive type="section">IfModule</directive> sections are
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive nest-able, which can be used to implement simple multiple-module
bea526116133aa3d7dabd1924bfc580b37fbf22aslive <note>This section should only be used if you need to have one
bea526116133aa3d7dabd1924bfc580b37fbf22aslive configuration file that works whether or not a specific module
fb77c505254b6e9c925e23e734463e87574f8f40kess is available. In normal operation, directives need not be
bea526116133aa3d7dabd1924bfc580b37fbf22aslive placed in <directive type="section">IfModule</directive>
bea526116133aa3d7dabd1924bfc580b37fbf22aslive sections.</note>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Includes other configuration files from within
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivethe server configuration files</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>Include <var>file-path</var>|<var>directory-path</var></syntax>
003f0c9fda6664daf5092a0e42f65ede20098153slive<contextlist><context>server config</context><context>virtual host</context>
003f0c9fda6664daf5092a0e42f65ede20098153slive</contextlist>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive<compatibility>Wildcard matching available in 2.0.41 and later</compatibility>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive allows inclusion of other configuration files
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive from within the server configuration files.</p>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used to
fb77c505254b6e9c925e23e734463e87574f8f40kess include several files at once, in alphabetical order. In
7b5535ed88e0f561b3bfb3330137bd804846afd4slive addition, if <directive>Include</directive> points to a directory,
7b5535ed88e0f561b3bfb3330137bd804846afd4slive rather than a file, Apache will read all files in that directory
7b5535ed88e0f561b3bfb3330137bd804846afd4slive and any subdirectory. But including entire directories is not
7b5535ed88e0f561b3bfb3330137bd804846afd4slive recommended, because it is easy to accidentally leave temporary
a1ef40892ffa2b44fc249423c5b6c42a74a84c68nd files in a directory that can cause <program>httpd</program> to
c68acc9d712af079afa2bd1a5a4aeef9a3ea573ckess <p>The file path specified may be an absolute path, or may be relative
c68acc9d712af079afa2bd1a5a4aeef9a3ea573ckess to the <directive module="core">ServerRoot</directive> directory.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive <p>Running <code>apachectl configtest</code> will give you a list
7b5535ed88e0f561b3bfb3330137bd804846afd4slive of the files that are being processed during the configuration
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd check:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd root@host# apachectl configtest<br />
7b5535ed88e0f561b3bfb3330137bd804846afd4slive Processing config file: /usr/local/apache2/conf/ssl.conf<br />
7b5535ed88e0f561b3bfb3330137bd804846afd4slive Processing config file: /usr/local/apache2/conf/vhosts/vhost1.conf<br />
7b5535ed88e0f561b3bfb3330137bd804846afd4slive Processing config file: /usr/local/apache2/conf/vhosts/vhost2.conf<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Enables HTTP persistent connections</description>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<contextlist><context>server config</context><context>virtual host</context>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The Keep-Alive extension to HTTP/1.0 and the persistent
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive connection feature of HTTP/1.1 provide long-lived HTTP sessions
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive which allow multiple requests to be sent over the same TCP
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive connection. In some cases this has been shown to result in an
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive almost 50% speedup in latency times for HTML documents with
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess many images. To enable Keep-Alive connections, set
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For HTTP/1.0 clients, Keep-Alive connections will only be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive used if they are specifically requested by a client. In
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive addition, a Keep-Alive connection with an HTTP/1.0 client can
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive only be used when the length of the content is known in
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive advance. This implies that dynamic content such as CGI output,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive SSI pages, and server-generated directory listings will
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive generally not use Keep-Alive connections to HTTP/1.0 clients.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive For HTTP/1.1 clients, persistent connections are the default
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive unless otherwise specified. If the client requests it, chunked
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive encoding will be used in order to send content of unknown
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive length over persistent connections.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">MaxKeepAliveRequests</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Amount of time the server will wait for subsequent
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliverequests on a persistent connection</description>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<contextlist><context>server config</context><context>virtual host</context>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The number of seconds Apache will wait for a subsequent
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request before closing the connection. Once a request has been
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive received, the timeout value specified by the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="core">Timeout</directive> directive applies.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Setting <directive>KeepAliveTimeout</directive> to a high value
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive may cause performance problems in heavily loaded servers. The
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive higher the timeout, the more server processes will be kept
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive occupied waiting on connections with idle clients.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Restrict enclosed access controls to only certain HTTP
313bb560bc5c323cfd40c9cad7335b4b8e060aedkessmethods</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax><Limit <var>method</var> [<var>method</var>] ... > ...
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </Limit></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Access controls are normally effective for
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <strong>all</strong> access methods, and this is the usual
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive desired behavior. <strong>In the general case, access control
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directives should not be placed within a
130d299c4b2b15be45532a176604c71fdc7bea5bnd <directive type="section">Limit</directive> section.</strong></p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The purpose of the <directive type="section">Limit</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive is to restrict the effect of the access controls to the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive nominated HTTP methods. For all other methods, the access
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess restrictions that are enclosed in the <directive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess type="section">Limit</directive> bracket <strong>will have no
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess effect</strong>. The following example applies the access control
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess only to the methods <code>POST</code>, <code>PUT</code>, and
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <code>DELETE</code>, leaving all other methods unprotected:</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <Limit POST PUT DELETE><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd Require valid-user<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Limit>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The method names listed can be one or more of: <code>GET</code>,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd case-sensitive.</strong> If <code>GET</code> is used it will also
6c5c651b0b97607b8c8b4965c1385c67699f217fnd restrict <code>HEAD</code> requests. The <code>TRACE</code> method
6c5c651b0b97607b8c8b4965c1385c67699f217fnd cannot be limited.</p>
4bb78e7cdd53f50240cff4ad7a97c7ed36483797slive module="core">LimitExcept</directive> section should always be
4bb78e7cdd53f50240cff4ad7a97c7ed36483797slive module="core">Limit</directive> section when restricting access,
4bb78e7cdd53f50240cff4ad7a97c7ed36483797slive module="core">LimitExcept</directive> section provides protection
4bb78e7cdd53f50240cff4ad7a97c7ed36483797slive against arbitrary methods.</note>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Restrict access controls to all HTTP methods
313bb560bc5c323cfd40c9cad7335b4b8e060aedkessexcept the named ones</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax><LimitExcept <var>method</var> [<var>method</var>] ... > ...
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </LimitExcept></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><directive type="section">LimitExcept</directive> and
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <code></LimitExcept></code> are used to enclose
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen a group of access control directives which will then apply to any
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess HTTP access method <strong>not</strong> listed in the arguments;
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen i.e., it is the opposite of a <directive type="section"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">Limit</directive> section and can be used to control
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive both standard and nonstandard/unrecognized methods. See the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type="section">Limit</directive> for more details.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <LimitExcept POST GET><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd Require valid-user<br />
7ef9b6763ad87846cf83c3f71467f43e349d080aerikabele </LimitExcept>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd<directivesynopsis>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd<description>Determine maximum number of internal redirects and nested
03e0a375c2435102fb2b51e34cccff52acbfddcdndsubrequests</description>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd<syntax>LimitInternalRecursion <var>number</var> [<var>number</var>]</syntax>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd<contextlist><context>server config</context><context>virtual host</context>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd</contextlist>
a51fafd9c1463954daf49f94e76d078c1eb5c9bdnd<compatibility>Available in Apache 2.0.47 and later</compatibility>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd <p>An internal redirect happens, for example, when using the <directive
03e0a375c2435102fb2b51e34cccff52acbfddcdnd module="mod_actions">Action</directive> directive, which internally
03e0a375c2435102fb2b51e34cccff52acbfddcdnd redirects the original request to a CGI script. A subrequest is Apache's
03e0a375c2435102fb2b51e34cccff52acbfddcdnd mechanism to find out what would happen for some URI if it were requested.
03e0a375c2435102fb2b51e34cccff52acbfddcdnd For example, <module>mod_dir</module> uses subrequests to look for the
03e0a375c2435102fb2b51e34cccff52acbfddcdnd files listed in the <directive module="mod_dir">DirectoryIndex</directive>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd directive.</p>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd <p><directive>LimitInternalRecursion</directive> prevents the server
03e0a375c2435102fb2b51e34cccff52acbfddcdnd from crashing when entering an infinite loop of internal redirects or
03e0a375c2435102fb2b51e34cccff52acbfddcdnd subrequests. Such loops are usually caused by misconfigurations.</p>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd <p>The directive stores two different limits, which are evaluated on
03e0a375c2435102fb2b51e34cccff52acbfddcdnd per-request basis. The first <var>number</var> is the maximum number of
03e0a375c2435102fb2b51e34cccff52acbfddcdnd internal redirects, that may follow each other. The second <var>number</var>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd determines, how deep subrequests may be nested. If you specify only one
03e0a375c2435102fb2b51e34cccff52acbfddcdnd <var>number</var>, it will be assigned to both limits.</p>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd LimitInternalRecursion 5
03e0a375c2435102fb2b51e34cccff52acbfddcdnd </example>
03e0a375c2435102fb2b51e34cccff52acbfddcdnd</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Restricts the total size of the HTTP request body sent
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivefrom the client</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>This directive specifies the number of <var>bytes</var> from 0
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive (meaning unlimited) to 2147483647 (2GB) that are allowed in a
89ea3e2b9591820407538ac250ec49a0f4f056d2nd request body.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>LimitRequestBody</directive> directive allows
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the user to set a limit on the allowed size of an HTTP request
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive message body within the context in which the directive is given
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive (server, per-directory, per-file or per-location). If the client
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request exceeds that limit, the server will return an error
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive response instead of servicing the request. The size of a normal
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request message body will vary greatly depending on the nature of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the resource and the methods allowed on that resource. CGI scripts
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess typically use the message body for retrieving form information.
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess Implementations of the <code>PUT</code> method will require
fb77c505254b6e9c925e23e734463e87574f8f40kess a value at least as large as any representation that the server
fb77c505254b6e9c925e23e734463e87574f8f40kess wishes to accept for that resource.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive gives the server administrator greater
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive control over abnormal client request behavior, which may be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive useful for avoiding some forms of denial-of-service
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive attacks.</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <p>If, for example, you are permitting file upload to a particular
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess location, and wish to limit the size of the uploaded file to 100K,
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen you might use the following directive:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd LimitRequestBody 102400
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<description>Limits the number of HTTP request header fields that
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivewill be accepted from the client</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context></contextlist>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p><var>Number</var> is an integer from 0 (meaning unlimited) to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive 32767. The default value is defined by the compile-time
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive distributed).</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>LimitRequestFields</directive> directive allows
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the server administrator to modify the limit on the number of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request header fields allowed in an HTTP request. A server needs
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive this value to be larger than the number of fields that a normal
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive client request might include. The number of request header fields
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive used by a client rarely exceeds 20, but this may vary among
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive different client implementations, often depending upon the extent
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to which a user has configured their browser to support detailed
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive content negotiation. Optional HTTP extensions are often expressed
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive using request header fields.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive gives the server administrator greater
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive control over abnormal client request behavior, which may be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive useful for avoiding some forms of denial-of-service attacks.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive The value should be increased if normal clients see an error
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive response from the server that indicates too many fields were
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive sent in the request.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd LimitRequestFields 50
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Limits the size of the HTTP request header allowed from the
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveclient</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context></contextlist>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>This directive specifies the number of <var>bytes</var> from 0
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to the value of the compile-time constant
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive distributed) that will be allowed in an HTTP request
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive header.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>The <directive>LimitRequestFieldSize</directive> directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive allows the server administrator to reduce the limit on the allowed
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive size of an HTTP request header field below the normal input buffer
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive size compiled with the server. A server needs this value to be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive large enough to hold any one header field from a normal client
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request. The size of a normal request header field will vary
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive greatly among different client implementations, often depending
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive upon the extent to which a user has configured their browser to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive support detailed content negotiation.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive gives the server administrator greater
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive control over abnormal client request behavior, which may be
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen useful for avoiding some forms of denial-of-service attacks.</p>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess LimitRequestFieldSize 4094
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <note>Under normal conditions, the value should not be changed from
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen the default.</note>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Limit the size of the HTTP request line that will be accepted
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivefrom the client</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context></contextlist>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>This directive sets the number of <var>bytes</var> from 0 to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the value of the compile-time constant
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>DEFAULT_LIMIT_REQUEST_LINE</code> (8190 as distributed)
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive that will be allowed on the HTTP request-line.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>LimitRequestLine</directive> directive allows
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the server administrator to reduce the limit on the allowed size
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of a client's HTTP request-line below the normal input buffer size
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive compiled with the server. Since the request-line consists of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HTTP method, URI, and protocol version, the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive>LimitRequestLine</directive> directive places a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive restriction on the length of a request-URI allowed for a request
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive on the server. A server needs this value to be large enough to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive hold any of its resource names, including any information that
fb77c505254b6e9c925e23e734463e87574f8f40kess might be passed in the query part of a <code>GET</code> request.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive gives the server administrator greater
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive control over abnormal client request behavior, which may be
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen useful for avoiding some forms of denial-of-service attacks.</p>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess LimitRequestLine 4094
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <note>Under normal conditions, the value should not be changed from
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen the default.</note>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Limits the size of an XML-based request body</description>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<contextlist><context>server config</context><context>virtual host</context>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<context>directory</context><context>.htaccess</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Limit (in bytes) on maximum size of an XML-based request
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive body. A value of <code>0</code> will disable any checking.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd LimitXMLRequestBody 0
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Applies the enclosed directives only to matching
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveURLs</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<syntax><Location
fb77c505254b6e9c925e23e734463e87574f8f40kess <var>URL-path</var>|<var>URL</var>> ... </Location></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive type="section">Location</directive> directive
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess limits the scope of the enclosed directives by URL. It is similar to the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive type="section" module="core">Directory</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive, and starts a subsection which is terminated with a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type="section">Location</directive> sections are processed in the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive order they appear in the configuration file, after the <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type="section" module="core">Directory</directive> sections and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>.htaccess</code> files are read, and after the <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type="section" module="core">Files</directive> sections.</p>
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive <p><directive type="section">Location</directive> sections operate
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive completely outside the filesystem. This has several consequences.
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive Most importantly, <directive type="section">Location</directive>
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive directives should not be used to control access to filesystem
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive locations. Since several different URLs may map to the same
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive filesystem location, such access controls may by circumvented.</p>
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive <p>Use <directive type="section">Location</directive> to apply
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive directives to content that lives outside the filesystem. For
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive content that lives in the filesystem, use <directive
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive type="section" module="core">Directory</directive> and <directive
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive type="section" module="core">Files</directive>. An exception is
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive <code><Location /></code>, which is an easy way to
234c8b28171d7e12b3c1f85b60fabd7c908a9c37slive apply a configuration to the entire server.</p>
dc223428958ad9ff05011545bcdda000887b93e5slive <p>For all origin (non-proxy) requests, the URL to be matched is a
dc223428958ad9ff05011545bcdda000887b93e5slive URL-path of the form <code>/path/</code>. No scheme, hostname,
dc223428958ad9ff05011545bcdda000887b93e5slive port, or query string may be included. For proxy requests, the
dc223428958ad9ff05011545bcdda000887b93e5slive URL to be matched is of the form
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>scheme://servername/path</code>, and you must include the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive prefix.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
fb77c505254b6e9c925e23e734463e87574f8f40kess any single character, and <code>*</code> matches any sequences of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive characters.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Extended regular
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive expressions can also be used, with the addition of the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <Location ~ "/(extra|special)/data">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>would match URLs that contained the substring <code>/extra/data</code>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess or <code>/special/data</code>. The directive <directive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess type="section" module="core">LocationMatch</directive> behaves
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess identical to the regex version of <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive functionality is especially useful when combined with the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive. For example, to enable status requests, but allow them
fb77c505254b6e9c925e23e734463e87574f8f40kess only from browsers at <code>foo.com</code>, you might use:</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <Location /status><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd SetHandler server-status<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd Order Deny,Allow<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd Deny from all<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Location>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The slash character has special meaning depending on where in a
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd URL it appears. People may be used to its behavior in the filesystem
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd where multiple adjacent slashes are frequently collapsed to a single
05201775eaa6b363b8a119c8aea5db246b967591yoshiki slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>/home/foo</code>). In URL-space this is not necessarily true.
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd The <directive type="section" module="core">LocationMatch</directive>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd directive and the regex version of <directive type="section"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd >Location</directive> require you to explicitly specify multiple
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd slashes if that is your intention.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>For example, <code><LocationMatch ^/abc></code> would match
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd the request URL <code>/abc</code> but not the request URL <code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd >Location</directive> directive behaves similarly when used for
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd proxy requests. But when (non-regex) <directive type="section"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd >Location</directive> is used for non-proxy requests it will
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd implicitly match multiple slashes with a single slash. For example,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd if you specify <code><Location /abc/def></code> and the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd request is to <code>/abc//def</code> then it will match.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<seealso><a href="/sections.html">How <Directory>, <Location>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess and <Files> sections work</a> for an explanation of how these
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess different sections are combined when a request is received</seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<description>Applies the enclosed directives only to regular-expression
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivematching URLs</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<syntax><LocationMatch
8490b2f9f6469d5089163f6dd303d9a81f8e908ctrawick <var>regex</var>> ... </LocationMatch></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive type="section">LocationMatch</directive> directive
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess limits the scope of the enclosed directives by URL, in an identical manner
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess to <directive module="core" type="section">Location</directive>. However,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd it takes a regular expression as an argument instead of a simple
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd string. For example:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <LocationMatch "/(extra|special)/data">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>would match URLs that contained the substring <code>/extra/data</code>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<seealso><a href="/sections.html">How <Directory>, <Location>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess and <Files> sections work</a> for an explanation of how these
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess different sections are combined when a request is received</seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Controls the verbosity of the ErrorLog</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><directive>LogLevel</directive> adjusts the verbosity of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive messages recorded in the error logs (see <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">ErrorLog</directive> directive). The following
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive significance:</p>
1597043cec6ad37fa4154bf09b0fccdabed1a239slive <columnspec><column width=".2"/><column width=".3"/><column width=".5"/>
1597043cec6ad37fa4154bf09b0fccdabed1a239slive </columnspec>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"getpwuid: couldn't determine user name from uid"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"socket: Failed to get a socket, exiting child"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"child process 1234 did not exit, sending another
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive SIGHUP"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"httpd: caught SIGBUS, attempting to dump core in
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"Server seems busy, (you may need to increase
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>When a particular level is specified, messages from all
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive other levels of higher significance will be reported as well.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <em>E.g.</em>, when <code>LogLevel info</code> is specified,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive then messages with log levels of <code>notice</code> and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive recommended.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd LogLevel notice
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
8b052d682204371decc64f942aede5ef1da98955erikabele <p>When logging to a regular file messages of the level
8b052d682204371decc64f942aede5ef1da98955erikabele <code>notice</code> cannot be suppressed and thus are always
8b052d682204371decc64f942aede5ef1da98955erikabele logged. However, this doesn't apply when logging is done
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<description>Number of requests allowed on a persistent
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveconnection</description>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<contextlist><context>server config</context><context>virtual host</context>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>MaxKeepAliveRequests</directive> directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive limits the number of requests allowed per connection when
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="core" >KeepAlive</directive> is on. If it is
fb77c505254b6e9c925e23e734463e87574f8f40kess set to <code>0</code>, unlimited requests will be allowed. We
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive recommend that this setting be kept to a high value for maximum
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive server performance.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd MaxKeepAliveRequests 500
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Designates an IP address for name-virtual
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivehosting</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>NameVirtualHost <var>addr</var>[:<var>port</var>]</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>NameVirtualHost</directive> directive is a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive required directive if you want to configure <a
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Although <var>addr</var> can be hostname it is recommended
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd NameVirtualHost 111.22.33.44
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>With the <directive>NameVirtualHost</directive> directive you
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive specify the IP address on which the server will receive requests
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive for the name-based virtual hosts. This will usually be the address
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to which your name-based virtual host names resolve. In cases
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive where a firewall or other proxy receives the requests and forwards
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive them on a different IP address to the server, you must specify the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive IP address of the physical interface on the machine which will be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive servicing the requests. If you have multiple name-based hosts on
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive multiple addresses, repeat the directive for each address.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>Note, that the "main server" and any <code>_default_</code> servers
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess will <strong>never</strong> be served for a request to a
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick <directive>NameVirtualHost</directive> IP address (unless for some
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess reason you specify <directive>NameVirtualHost</directive> but then
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess don't define any <directive>VirtualHost</directive>s for that
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess address).</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Optionally you can specify a port number on which the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd NameVirtualHost 111.22.33.44:8080
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>IPv6 addresses must be enclosed in square brackets, as shown
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd in the following example:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd NameVirtualHost [fe80::a00:20ff:fea7:ccea]:8080
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
52bb691f8e13e9d0b55fcc214018ee85846fa87frbowen <p>To receive requests on all interfaces, you can use an argument of
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd NameVirtualHost *
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <note><title>Argument to <directive type="section">VirtualHost</directive>
fb77c505254b6e9c925e23e734463e87574f8f40kess directive</title>
27303c8bb552a8a5fc859feb735d686fc59f59a1yoshiki type="section">VirtualHost</directive> directive must
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd exactly match the argument to the <directive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd NameVirtualHost 1.2.3.4<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <VirtualHost 1.2.3.4><br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd # ...<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </VirtualHost><br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Configures what features are available in a particular
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivedirectory</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<syntax>Options
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd [+|-]<var>option</var> [[+|-]<var>option</var>] ...</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>Options</directive> directive controls which
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive server features are available in a particular directory.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p><var>option</var> can be set to <code>None</code>, in which
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive case none of the extra features are enabled, or one or more of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the following:</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess <dd>All options except for <code>MultiViews</code>. This is the default
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive setting.</dd>
13e5182a0c199ecc7a73db97b6448a544e940868slive Execution of CGI scripts using <module>mod_cgi</module>
13e5182a0c199ecc7a73db97b6448a544e940868slive is permitted.</dd>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd The server will follow symbolic links in this directory.
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Even though the server follows the symlink it does <em>not</em>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd change the pathname used to match against <directive type="section"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Note also, that this option <strong>gets ignored</strong> if set
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd inside a <directive type="section" module="core">Location</directive>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd section.</p>
13e5182a0c199ecc7a73db97b6448a544e940868slive Server-side includes provided by <module>mod_include</module>
13e5182a0c199ecc7a73db97b6448a544e940868slive are permitted.</dd>
13e5182a0c199ecc7a73db97b6448a544e940868slive Server-side includes are permitted, but the <code>#exec
13e5182a0c199ecc7a73db97b6448a544e940868slive cmd</code> and <code>#exec cgi</code> are disabled. It is still
13e5182a0c199ecc7a73db97b6448a544e940868slive possible to <code>#include virtual</code> CGI scripts from
b00583f8e126bbb00b06dcf06af06c9d07978701kess <directive module="mod_alias">ScriptAlias</directive>ed
13e5182a0c199ecc7a73db97b6448a544e940868slive directories.</dd>
0d5b778ac63bc803c0dd1a4fdef371fe7a0f4b57kess If a URL which maps to a directory is requested, and there
13e5182a0c199ecc7a73db97b6448a544e940868slive is no <directive module="mod_dir">DirectoryIndex</directive>
13e5182a0c199ecc7a73db97b6448a544e940868slive (<em>e.g.</em>, <code>index.html</code>) in that directory, then
13e5182a0c199ecc7a73db97b6448a544e940868slive <module>mod_autoindex</module> will return a formatted listing
13e5182a0c199ecc7a73db97b6448a544e940868slive of the directory.</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <a href="/content-negotiation.html">Content negotiated</a>
13e5182a0c199ecc7a73db97b6448a544e940868slive "MultiViews" are allowed using
13e5182a0c199ecc7a73db97b6448a544e940868slive <dd>The server will only follow symbolic links for which the
13e5182a0c199ecc7a73db97b6448a544e940868slive target file or directory is owned by the same user id as the
13e5182a0c199ecc7a73db97b6448a544e940868slive <p>Normally, if multiple <directive>Options</directive> could
13e5182a0c199ecc7a73db97b6448a544e940868slive apply to a directory, then the most specific one is used and
13e5182a0c199ecc7a73db97b6448a544e940868slive others are ignored; the options are not merged. (See <a
13e5182a0c199ecc7a73db97b6448a544e940868slive href="/sections.html#mergin">how sections are merged</a>.)
13e5182a0c199ecc7a73db97b6448a544e940868slive <directive>Options</directive> directive are preceded by a
13e5182a0c199ecc7a73db97b6448a544e940868slive <code>+</code> or <code>-</code> symbol, the options are
13e5182a0c199ecc7a73db97b6448a544e940868slive merged. Any options preceded by a <code>+</code> are added to the
13e5182a0c199ecc7a73db97b6448a544e940868slive options currently in force, and any options preceded by a
13e5182a0c199ecc7a73db97b6448a544e940868slive <code>-</code> are removed from the options currently in
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive force. </p>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd Options Indexes FollowSymLinks<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd Options Includes<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>then only <code>Includes</code> will be set for the
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>/web/docs/spec</code> directory. However if the second
fb77c505254b6e9c925e23e734463e87574f8f40kess <directive>Options</directive> directive uses the <code>+</code> and
130d299c4b2b15be45532a176604c71fdc7bea5bnd Options Indexes FollowSymLinks<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd Options +Includes -Indexes<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>Includes</code> are set for the <code>/web/docs/spec</code>
fb77c505254b6e9c925e23e734463e87574f8f40kess directory.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <code>-Includes</code> disables server-side includes completely
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess regardless of the previous setting.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The default in the absence of any other settings is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Selects which authenticated users can access
313bb560bc5c323cfd40c9cad7335b4b8e060aedkessa resource</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>Require <var>entity-name</var> [<var>entity-name</var>] ...</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive selects which authenticated users can access
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive a directory. The allowed syntaxes are:</p>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <dt><code>Require user <var>userid</var> [<var>userid</var>]
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <dt><code>Require group <var>group-name</var> [<var>group-name</var>]
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <dd>Only users in the named groups can access the resource.</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><directive>Require</directive> must be accompanied by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="core">AuthName</directive> and <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">AuthType</directive> directives, and directives such
9ed9eaf871c58d281af02e76125ceadb5060afa5nd as <directive module="mod_authn_file">AuthUserFile</directive>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd and <directive module="mod_authz_groupfile">AuthGroupFile</directive> (to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive define users and groups) in order to work correctly. Example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive AuthType Basic<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive AuthName "Restricted Directory"<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Require group admin
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Access controls which are applied in this way are effective for
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <strong>all</strong> methods. <strong>This is what is normally
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive desired.</strong> If you wish to apply access controls only to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive specific methods, while leaving other methods unprotected, then
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive place the <directive>Require</directive> statement into a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="core" type="section">Limit</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive section.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">Satisfy</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Limits the CPU consumption of processes launched
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveby Apache children</description>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<syntax>RLimitCPU <var>seconds</var>|max [<var>seconds</var>|max]</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<default>Unset; uses operating system defaults</default>
530eba85dbd41b8a0fa5255d3648d1440199a661slive<contextlist><context>server config</context><context>virtual host</context>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<context>directory</context><context>.htaccess</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Takes 1 or 2 parameters. The first parameter sets the soft
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive resource limit for all processes and the second parameter sets
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the maximum resource limit. Either parameter can be a number,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd or <code>max</code> to indicate to the server that the limit should
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive be set to the maximum allowed by the operating system
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive configuration. Raising the maximum resource limit requires that
ef8e89e090461194ecadd31e8796a2c51e0531a2kess the server is running as <code>root</code>, or in the initial startup
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This applies to processes forked off from Apache children
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive servicing requests, not the Apache children themselves. This
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive includes CGI scripts and SSI exec commands, but not any
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive processes forked off from the Apache parent such as piped
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>CPU resource limits are expressed in seconds per
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive process.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">RLimitMEM</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">RLimitNPROC</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Limits the memory consumption of processes launched
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveby Apache children</description>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<syntax>RLimitMEM <var>bytes</var>|max [<var>bytes</var>|max]</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<default>Unset; uses operating system defaults</default>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<context>directory</context><context>.htaccess</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Takes 1 or 2 parameters. The first parameter sets the soft
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive resource limit for all processes and the second parameter sets
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the maximum resource limit. Either parameter can be a number,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd or <code>max</code> to indicate to the server that the limit should
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive be set to the maximum allowed by the operating system
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive configuration. Raising the maximum resource limit requires that
ef8e89e090461194ecadd31e8796a2c51e0531a2kess the server is running as <code>root</code>, or in the initial startup
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This applies to processes forked off from Apache children
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive servicing requests, not the Apache children themselves. This
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive includes CGI scripts and SSI exec commands, but not any
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive processes forked off from the Apache parent such as piped
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Memory resource limits are expressed in bytes per
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive process.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">RLimitCPU</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">RLimitNPROC</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<description>Limits the number of processes that can be launched by
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveprocesses launched by Apache children</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>RLimitNPROC <var>number</var>|max [<var>number</var>|max]</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<default>Unset; uses operating system defaults</default>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<context>directory</context><context>.htaccess</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Takes 1 or 2 parameters. The first parameter sets the soft
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive resource limit for all processes and the second parameter sets
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the maximum resource limit. Either parameter can be a number,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive or <code>max</code> to indicate to the server that the limit
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive should be set to the maximum allowed by the operating system
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive configuration. Raising the maximum resource limit requires that
ef8e89e090461194ecadd31e8796a2c51e0531a2kess the server is running as <code>root</code>, or in the initial startup
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This applies to processes forked off from Apache children
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive servicing requests, not the Apache children themselves. This
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive includes CGI scripts and SSI exec commands, but not any
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive processes forked off from the Apache parent such as piped
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Process limits control the number of processes per user.</p>
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick under user ids other than the web server user id, this directive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess will limit the number of processes that the server itself can
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess create. Evidence of this situation will be indicated by
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <strong><code>cannot fork</code></strong> messages in the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">RLimitMEM</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">RLimitCPU</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
fb77c505254b6e9c925e23e734463e87574f8f40kess<description>Interaction between host-level access control and
003f0c9fda6664daf5092a0e42f65ede20098153sliveuser authentication</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
521d38e84f603f3c8cdd15807fc3f8eb9e188b34nd<compatibility>Influenced by <directive module="core" type="section"
521d38e84f603f3c8cdd15807fc3f8eb9e188b34ndtype="section">LimitExcept</directive> in version 2.0.51 and
521d38e84f603f3c8cdd15807fc3f8eb9e188b34ndlater</compatibility>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">Require</directive> used. The parameter can be
fb77c505254b6e9c925e23e734463e87574f8f40kess either <code>All</code> or <code>Any</code>. This directive is only
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive useful if access to a particular area is being restricted by both
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive username/password <em>and</em> client host address. In this case
fb77c505254b6e9c925e23e734463e87574f8f40kess the default behavior (<code>All</code>) is to require that the client
fb77c505254b6e9c925e23e734463e87574f8f40kess passes the address access restriction <em>and</em> enters a valid
fb77c505254b6e9c925e23e734463e87574f8f40kess username and password. With the <code>Any</code> option the client will be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive granted access if they either pass the host restriction or enter a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive valid username and password. This can be used to password restrict
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive an area, but to let clients from particular addresses in without
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive prompting for a password.</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <p>For example, if you wanted to let people on your network have
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen unrestricted access to a portion of your website, but require that
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen people outside of your network provide a password, you could use a
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen configuration similar to the following:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Require valid-user<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Allow from 192.168.1<br />
fb77c505254b6e9c925e23e734463e87574f8f40kess Satisfy Any
521d38e84f603f3c8cdd15807fc3f8eb9e188b34nd <p>Since version 2.0.51 <directive>Satisfy</directive> directives can
521d38e84f603f3c8cdd15807fc3f8eb9e188b34nd be restricted to particular methods by <directive module="core"
521d38e84f603f3c8cdd15807fc3f8eb9e188b34nd type="section">Limit</directive> and <directive module="core" type="section"
9ed9eaf871c58d281af02e76125ceadb5060afa5nd <seealso><directive module="mod_authz_host">Allow</directive></seealso>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <seealso><directive module="core">Require</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
fb77c505254b6e9c925e23e734463e87574f8f40kess<description>Technique for locating the interpreter for CGI
003f0c9fda6664daf5092a0e42f65ede20098153slivescripts</description>
fb77c505254b6e9c925e23e734463e87574f8f40kess<syntax>ScriptInterpreterSource Registry|Registry-Strict|Script</syntax>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<contextlist><context>server config</context><context>virtual host</context>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<context>directory</context><context>.htaccess</context></contextlist>
18831446030f4eda7e0563c92a896ccfdb6eb1d7slive<compatibility>Win32 only;
ef8e89e090461194ecadd31e8796a2c51e0531a2kessoption <code>Registry-Strict</code> is available in Apache 2.0 and
ef8e89e090461194ecadd31e8796a2c51e0531a2kesslater</compatibility>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive is used to control how Apache finds the
4cafc94e99922f00654e1779d30c2cccf5278c4fkess interpreter used to run CGI scripts. The default setting is
4cafc94e99922f00654e1779d30c2cccf5278c4fkess <code>Script</code>. This causes Apache to use the interpreter pointed to
4cafc94e99922f00654e1779d30c2cccf5278c4fkess by the shebang line (first line, starting with <code>#!</code>) in the
4cafc94e99922f00654e1779d30c2cccf5278c4fkess script. On Win32 systems this line usually looks like:</p>
4cafc94e99922f00654e1779d30c2cccf5278c4fkess </example>
27303c8bb552a8a5fc859feb735d686fc59f59a1yoshiki <p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
4cafc94e99922f00654e1779d30c2cccf5278c4fkess </example>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>Setting <code>ScriptInterpreterSource Registry</code> will
4cafc94e99922f00654e1779d30c2cccf5278c4fkess cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
4cafc94e99922f00654e1779d30c2cccf5278c4fkess searched using the script file extension (e.g., <code>.pl</code>) as a
4cafc94e99922f00654e1779d30c2cccf5278c4fkess search key. The command defined by the registry subkey
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive <code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive <code>Shell\Open\Command</code> is used to open the script file. If the
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive registry keys cannot be found, Apache falls back to the behavior of the
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive <p>Be careful when using <code>ScriptInterpreterSource
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive module="mod_alias">ScriptAlias</directive>'ed directories, because
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive Apache will try to execute <strong>every</strong> file within this
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive directory. The <code>Registry</code> setting may cause undesired
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive program calls on files which are typically not executed. For
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive example, the default open command on <code>.htm</code> files on
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive most Windows systems will execute Microsoft Internet Explorer, so
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive any HTTP request for an <code>.htm</code> file existing within the
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive script directory would start the browser in the background on the
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive server. This is a good way to crash your system within a minute or
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive <p>The option <code>Registry-Strict</code> which is new in Apache
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive 2.0 does the same thing as <code>Registry</code> but uses only the
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive <code>ExecCGI</code> key is not a common one. It must be
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive configured manually in the windows registry and hence prevents
96a8ac87abbb04c2a925f7fde5eb12bf1d1f4bc3slive accidental program calls on your system.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Email address that the server includes in error
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivemessages sent to the client</description>
2e5e2673cb64d3e4d445d911c6f61ac171020725nd<syntax>ServerAdmin <var>email-address</var>|<var>URL</var></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
2e5e2673cb64d3e4d445d911c6f61ac171020725nd <p>The <directive>ServerAdmin</directive> sets the contact address
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive that the server includes in any error messages it returns to the
733738e83a9b0113476e3f67992c2278d61ee4dakess client. If the <code>httpd</code> doesn't recognize the supplied argument
733738e83a9b0113476e3f67992c2278d61ee4dakess as an URL, it
2e5e2673cb64d3e4d445d911c6f61ac171020725nd assumes, that it's an <var>email-address</var> and prepends it with
2e5e2673cb64d3e4d445d911c6f61ac171020725nd <code>mailto:</code> in hyperlink targets. However, it's recommended to
2e5e2673cb64d3e4d445d911c6f61ac171020725nd actually use an email address, since there are a lot of CGI scripts that
2e5e2673cb64d3e4d445d911c6f61ac171020725nd make that assumption. If you want to use an URL, it should point to another
2e5e2673cb64d3e4d445d911c6f61ac171020725nd server under your control. Otherwise users may not be able to contact you in
2e5e2673cb64d3e4d445d911c6f61ac171020725nd case of errors.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>It may be worth setting up a dedicated address for this, e.g.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd ServerAdmin www-admin@foo.example.com
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>as users do not always mention that they are talking about the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive server!</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Alternate names for a host used when matching requests
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveto name-virtual hosts</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>virtual host</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>ServerAlias</directive> directive sets the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive alternate names for a host, for use with <a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive href="/vhosts/name-based.html">name-based virtual hosts</a>.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <VirtualHost *><br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd # ...<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </VirtualHost>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/vhosts/">Apache Virtual Host documentation</a></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Hostname and port that the server uses to identify
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveitself</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>ServerName <var>fully-qualified-domain-name</var>[:<var>port</var>]</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<compatibility>In version 2.0, this
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive supersedes the functionality of the <directive>Port</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive from version 1.3.</compatibility>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>ServerName</directive> directive sets the hostname and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive port that the server uses to identify itself. This is used when
fb77c505254b6e9c925e23e734463e87574f8f40kess creating redirection URLs. For example, if the name of the
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick machine hosting the web server is <code>simple.example.com</code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive but the machine also has the DNS alias <code>www.example.com</code>
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick and you wish the web server to be so identified, the following
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive should be used:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd ServerName www.example.com:80
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>If no <directive>ServerName</directive> is specified, then the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive server attempts to deduce the hostname by performing a reverse
fb77c505254b6e9c925e23e734463e87574f8f40kess lookup on the IP address. If no port is specified in the
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick <directive>ServerName</directive>, then the server will use the port
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick from the incoming
fb77c505254b6e9c925e23e734463e87574f8f40kess request. For optimal reliability and predictability, you should
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive specify an explicit hostname and port using the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive href="/vhosts/name-based.html">name-based virtual hosts</a>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive type="section" module="core">VirtualHost</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive section specifies what hostname must appear in the request's
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>Host:</code> header to match this virtual host.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>See the description of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="core">UseCanonicalName</directive> directive for
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive settings which determine whether self-referential URL's (e.g., by the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive specified port, or to the port number given in the client's request.
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<seealso><a href="/dns-caveats.html">Issues Regarding DNS and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">UseCanonicalName</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">NameVirtualHost</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">ServerAlias</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
fb77c505254b6e9c925e23e734463e87574f8f40kess<description>Legacy URL pathname for a name-based virtual host that
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveis accessed by an incompatible browser</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>virtual host</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>ServerPath</directive> directive sets the legacy
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive URL pathname for a host, for use with <a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/vhosts/">Apache Virtual Host documentation</a></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Base directory for the server installation</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>ServerRoot</directive> directive sets the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directory in which the server lives. Typically it will contain the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive subdirectories <code>conf/</code> and <code>logs/</code>. Relative
7228d3b2eebddc214348190bcc62d80b5e7087e2rbowen paths in other configuration directives (such as <directive
fcc04773f0f2cc73650485facef9cd77f2d5bd65nd module="mod_so">LoadModule</directive>, for example) are taken as
7228d3b2eebddc214348190bcc62d80b5e7087e2rbowen relative to this directory.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/misc/security_tips.html#serverroot">the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive security tips</a> for information on how to properly set
ef8e89e090461194ecadd31e8796a2c51e0531a2kess permissions on the <directive>ServerRoot</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Configures the footer on server-generated documents</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>ServerSignature</directive> directive allows the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive configuration of a trailing footer line under server-generated
fb77c505254b6e9c925e23e734463e87574f8f40kess documents (error messages, <module>mod_proxy</module> ftp directory
fb77c505254b6e9c925e23e734463e87574f8f40kess listings, <module>mod_info</module> output, ...). The reason why you
fb77c505254b6e9c925e23e734463e87574f8f40kess would want to enable such a footer line is that in a chain of proxies,
fb77c505254b6e9c925e23e734463e87574f8f40kess the user often has no possibility to tell which of the chained servers
ef8e89e090461194ecadd31e8796a2c51e0531a2kess actually produced a returned error message.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess setting, which is the default, suppresses the footer line (and is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive therefore compatible with the behavior of Apache-1.2 and
530eba85dbd41b8a0fa5255d3648d1440199a661slive below). The <code>On</code> setting simply adds a line with the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive server version number and <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">ServerName</directive> of the serving virtual host,
530eba85dbd41b8a0fa5255d3648d1440199a661slive and the <code>EMail</code> setting additionally creates a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive "mailto:" reference to the <directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module="core">ServerAdmin</directive> of the referenced
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive document.</p>
23b36269d124e7a6aaa5221891f7ae2ef3eeb158jerenkrantz <p>After version 2.0.44, the details of the server version number
7b5535ed88e0f561b3bfb3330137bd804846afd4slive presented are controlled by the <directive
f35c904c3b359610a46e94fbb4ba8495b2338521slive<seealso><directive module="core">ServerTokens</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<description>Configures the <code>Server</code> HTTP response
ef8e89e090461194ecadd31e8796a2c51e0531a2kessheader</description>
fb77c505254b6e9c925e23e734463e87574f8f40kess<syntax>ServerTokens Major|Minor|Min[imal]|Prod[uctOnly]|OS|Full</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context></contextlist>
530eba85dbd41b8a0fa5255d3648d1440199a661slive <p>This directive controls whether <code>Server</code> response
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive header field which is sent back to clients includes a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive description of the generic OS-type of the server as well as
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive information about compiled-in modules.</p>
1a1cf0ee9229ee29e5750b25dd94dbb9b04072cfianh <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dt><code>ServerTokens Full</code> (or not specified)</dt>
1a1cf0ee9229ee29e5750b25dd94dbb9b04072cfianh <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This setting applies to the entire server, and cannot be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive enabled or disabled on a virtualhost-by-virtualhost basis.</p>
23b36269d124e7a6aaa5221891f7ae2ef3eeb158jerenkrantz <p>After version 2.0.44, this directive also controls the
7b5535ed88e0f561b3bfb3330137bd804846afd4slive information presented by the <directive
7b5535ed88e0f561b3bfb3330137bd804846afd4slive module="core">ServerSignature</directive> directive.</p>
f35c904c3b359610a46e94fbb4ba8495b2338521slive<seealso><directive module="core">ServerSignature</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Forces all matching files to be processed by a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivehandler</description>
fb77c505254b6e9c925e23e734463e87574f8f40kess<syntax>SetHandler <var>handler-name</var>|None</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<compatibility>Moved into the core in Apache 2.0</compatibility>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>When placed into an <code>.htaccess</code> file or a
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <directive type="section" module="core">Directory</directive> or
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive type="section" module="core">Location</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive section, this directive forces all matching files to be parsed
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive through the <a href="/handler.html">handler</a> given by
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <var>handler-name</var>. For example, if you had a directory you
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive wanted to be parsed entirely as imagemap rule files, regardless
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of extension, you might put the following into an
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd SetHandler imap-file
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Another example: if you wanted to have the server display a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive status report whenever a URL of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>http://servername/status</code> was called, you might put
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <Location /status><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd SetHandler server-status<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </Location>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
c97e8972ab1f4dd167e3dc4db87daf91114009fbnd <p>You can override an earlier defined <directive>SetHandler</directive>
db1b819ff8966e3c6a5ca03c59a8ae06c2cecc9frbowen<seealso><directive module="mod_mime">AddHandler</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Sets the filters that will process client requests and POST
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveinput</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>SetInputFilter <var>filter</var>[;<var>filter</var>...]</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>SetInputFilter</directive> directive sets the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive filter or filters which will process client requests and POST
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive input when they are received by the server. This is in addition to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive any filters defined elsewhere, including the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="mod_mime">AddInputFilter</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>If more than one filter is specified, they must be separated
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive by semicolons in the order in which they should process the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive content.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/filter.html">Filters</a> documentation</seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Sets the filters that will process responses from the
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveserver</description>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<syntax>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<context>directory</context><context>.htaccess</context>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>SetOutputFilter</directive> directive sets the filters
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive which will process responses from the server before they are
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive sent to the client. This is in addition to any filters defined
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive elsewhere, including the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <directive module="mod_mime">AddOutputFilter</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For example, the following configuration will process all files
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive in the <code>/www/data/</code> directory for server-side
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive includes.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd SetOutputFilter INCLUDES<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd </Directory>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>If more than one filter is specified, they must be separated
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive by semicolons in the order in which they should process the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive content.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/filter.html">Filters</a> documentation</seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
003f0c9fda6664daf5092a0e42f65ede20098153slive<description>Amount of time the server will wait for
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivecertain events before failing a request</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <directive>TimeOut</directive> directive currently defines
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the amount of time Apache will wait for three things:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li>The total amount of time it takes to receive a GET
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request.</li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li>The amount of time between receipt of TCP packets on a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive POST or PUT request.</li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li>The amount of time between ACKs on transmissions of TCP
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive packets in responses.</li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>We plan on making these separately configurable at some point
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive down the road. The timer used to default to 1200 before 1.2,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive but has been lowered to 300 which is still far more than
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive necessary in most situations. It is not set any lower by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive default because there may still be odd places in the code where
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the timer is not reset when a packet is sent. </p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Configures how the server determines its own name and
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveport</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context><context>virtual host</context>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>In many situations Apache must construct a <em>self-referential</em>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd URL -- that is, a URL that refers back to the same server. With
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <code>UseCanonicalName On</code> Apache will use the hostname and port
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd specified in the <directive module="core">ServerName</directive>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd directive to construct the canonical name for the server. This name
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd is used in all self-referential URLs, and for the values of
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>With <code>UseCanonicalName Off</code> Apache will form
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive self-referential URLs using the hostname and port supplied by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the client if any are supplied (otherwise it will use the
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen canonical name, as defined above). These values are the same
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess that are used to implement <a
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen href="/vhosts/name-based.html">name based virtual hosts</a>,
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess and are available with the same clients. The CGI variables
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen constructed from the client supplied values as well.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>An example where this may be useful is on an intranet server
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive where you have users connecting to the machine using short
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive names such as <code>www</code>. You'll notice that if the users
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type a shortname, and a URL which is a directory, such as
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>http://www/splat</code>, <em>without the trailing
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive slash</em> then Apache will redirect them to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>http://www.domain.com/splat/</code>. If you have
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive authentication enabled, this will cause the user to have to
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen authenticate twice (once for <code>www</code> and once again
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen FAQ on this subject for more information</a>). But if
fb77c505254b6e9c925e23e734463e87574f8f40kess <directive>UseCanonicalName</directive> is set <code>Off</code>, then
fb77c505254b6e9c925e23e734463e87574f8f40kess Apache will redirect to <code>http://www/splat/</code>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>There is a third option, <code>UseCanonicalName DNS</code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive which is intended for use with mass IP-based virtual hosting to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive support ancient clients that do not provide a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>Host:</code> header. With this option Apache does a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive reverse DNS lookup on the server IP address that the client
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive connected to in order to work out self-referential URLs.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
130d299c4b2b15be45532a176604c71fdc7bea5bnd they may be broken by this option. The client is essentially free
130d299c4b2b15be45532a176604c71fdc7bea5bnd to give whatever value they want as a hostname. But if the CGI is
130d299c4b2b15be45532a176604c71fdc7bea5bnd only using <code>SERVER_NAME</code> to construct self-referential URLs
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive then it should be just fine.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="core">ServerName</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><directive module="mpm_common">Listen</directive></seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<description>Contains directives that apply only to a specific
313bb560bc5c323cfd40c9cad7335b4b8e060aedkesshostname or IP address</description>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<syntax><VirtualHost
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ...> ... </VirtualHost></syntax>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<contextlist><context>server config</context></contextlist>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><directive type="section">VirtualHost</directive> and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code></VirtualHost></code> are used to enclose a group of
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive directives that will apply only to a particular virtual host. Any
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive directive that is allowed in a virtual host context may be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive used. When the server receives a request for a document on a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive particular virtual host, it uses the configuration directives
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive enclosed in the <directive type="section">VirtualHost</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li>A fully qualified domain name for the IP address of the
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive virtual host;</li>
fb77c505254b6e9c925e23e734463e87574f8f40kess <li>The character <code>*</code>, which is used only in combination with
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive <code>NameVirtualHost *</code> to match all IP addresses; or</li>
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive <li>The string <code>_default_</code>, which is used only
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive with IP virtual hosting to catch unmatched IP addresses.</li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <VirtualHost 10.1.2.3><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd ServerAdmin webmaster@host.foo.com<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </VirtualHost>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </example>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>IPv6 addresses must be specified in square brackets because
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd the optional port number could not be determined otherwise. An
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd IPv6 example is shown below:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <VirtualHost [fe80::a00:20ff:fea7:ccea]><br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd ServerAdmin webmaster@host.example.com<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </VirtualHost>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess </example>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Each Virtual Host must correspond to a different IP address,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive different port number or a different host name for the server,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive in the former case the server machine must be configured to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive accept IP packets for multiple addresses. (If the machine does
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive not have multiple network interfaces, then this can be
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess accomplished with the <code>ifconfig alias</code> command -- if
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive your OS supports it).</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>The use of <directive type="section">VirtualHost</directive> does
fb77c505254b6e9c925e23e734463e87574f8f40kess <strong>not</strong> affect what addresses Apache listens on. You
130d299c4b2b15be45532a176604c71fdc7bea5bnd may need to ensure that Apache is listening on the correct addresses
130d299c4b2b15be45532a176604c71fdc7bea5bnd using <directive module="mpm_common">Listen</directive>.</p>
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive <p>When using IP-based virtual hosting, the special name
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive which case this virtual host will match any IP address that is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive not explicitly listed in another virtual host. In the absence
fb77c505254b6e9c925e23e734463e87574f8f40kess of any <code>_default_</code> virtual host the "main" server config,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive consisting of all those definitions outside any VirtualHost
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive section, is used when no IP-match occurs. (But note that any IP
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive address that matches a <directive
506ccad87840d0f348a9b9560b711f0a8398ce6aslive module="core">NameVirtualHost</directive> directive will use neither
fb77c505254b6e9c925e23e734463e87574f8f40kess the "main" server config nor the <code>_default_</code> virtual host.
fb77c505254b6e9c925e23e734463e87574f8f40kess See the <a href="/vhosts/name-based.html">name-based virtual hosting</a>
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive documentation for further details.)</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>You can specify a <code>:port</code> to change the port that is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive matched. If unspecified then it defaults to the same port as the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive most recent <directive module="mpm_common">Listen</directive>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive statement of the main server. You may also specify <code>:*</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to match all ports on that address. (This is recommended when used
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>See the <a href="/misc/security_tips.html">security tips</a>
130d299c4b2b15be45532a176604c71fdc7bea5bnd document for details on why your security could be compromised if the
9b5e2c5e769dc678a1aca06df75c32022b2f1492trawick directory where log files are stored is writable by anyone other
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive than the user that starts the server.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<seealso><a href="/vhosts/">Apache Virtual Host documentation</a></seealso>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<seealso><a href="/dns-caveats.html">Issues Regarding DNS and
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<seealso><a href="/sections.html">How <Directory>, <Location>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess and <Files> sections work</a> for an explanation of how these
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess different sections are combined when a request is received</seealso>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</directivesynopsis>
7db9f691a00ead175b03335457ca296a33ddf31bnd</modulesynopsis>