core.html.en revision 06fcf16883e133e49db046945cbcf728d4cc6e37
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<?xml version="1.0" encoding="ISO-8859-1"?>
530eba85dbd41b8a0fa5255d3648d1440199a661slive<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
e942c741056732f50da2074b36fe59805d370650slive<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive This file is generated from xml source: DO NOT EDIT
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive -->
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<title>core - Apache HTTP Server</title>
530eba85dbd41b8a0fa5255d3648d1440199a661slive<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<link href="/images/favicon.ico" rel="shortcut icon" /></head>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<body>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div id="page-header">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<p class="apache">Apache HTTP Server Version 2.3</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<img alt="" src="/images/feather.gif" /></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<div id="path">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="../">Version 2.3</a> &gt; <a href="./">Modules</a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div id="page-content">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div id="preamble"><h1>Apache Core Features</h1>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="toplang">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<p><span>Available Languages: </span><a href="/de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<a href="/en/mod/core.html" title="English">&nbsp;en&nbsp;</a> |
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<a href="/fr/mod/core.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<a href="/ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
fb77c505254b6e9c925e23e734463e87574f8f40kess<a href="/tr/mod/core.html" hreflang="tr" rel="alternate" title="T�rk�e">&nbsp;tr&nbsp;</a></p>
fb77c505254b6e9c925e23e734463e87574f8f40kess</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Core Apache HTTP Server features that are always
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveavailable</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Core</td></tr></table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div id="quickview"><h3 class="directives">Directives</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<ul id="toc">
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#acceptfilter">AcceptFilter</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#acceptpathinfo">AcceptPathInfo</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#accessfilename">AccessFileName</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#adddefaultcharset">AddDefaultCharset</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#allowencodedslashes">AllowEncodedSlashes</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#allowoverride">AllowOverride</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#cgimapextension">CGIMapExtension</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#contentdigest">ContentDigest</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#defaulttype">DefaultType</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#define">Define</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#directory">&lt;Directory&gt;</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#directorymatch">&lt;DirectoryMatch&gt;</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#enablemmap">EnableMMAP</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#enablesendfile">EnableSendfile</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#errordocument">ErrorDocument</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#errorlog">ErrorLog</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#errorlogformat">ErrorLogFormat</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#extendedstatus">ExtendedStatus</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#fileetag">FileETag</a></li>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<li><img alt="" src="/images/down.gif" /> <a href="#files">&lt;Files&gt;</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#filesmatch">&lt;FilesMatch&gt;</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#forcetype">ForceType</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#hostnamelookups">HostnameLookups</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#if">&lt;If&gt;</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#ifdefine">&lt;IfDefine&gt;</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#ifmodule">&lt;IfModule&gt;</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#include">Include</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#keepalive">KeepAlive</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#keepalivetimeout">KeepAliveTimeout</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#limit">&lt;Limit&gt;</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#limitexcept">&lt;LimitExcept&gt;</a></li>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><img alt="" src="/images/down.gif" /> <a href="#limitinternalrecursion">LimitInternalRecursion</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#limitrequestbody">LimitRequestBody</a></li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<li><img alt="" src="/images/down.gif" /> <a href="#limitrequestfields">LimitRequestFields</a></li>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<li><img alt="" src="/images/down.gif" /> <a href="#limitrequestfieldsize">LimitRequestFieldSize</a></li>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<li><img alt="" src="/images/down.gif" /> <a href="#limitrequestline">LimitRequestLine</a></li>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<li><img alt="" src="/images/down.gif" /> <a href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<li><img alt="" src="/images/down.gif" /> <a href="#location">&lt;Location&gt;</a></li>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<li><img alt="" src="/images/down.gif" /> <a href="#locationmatch">&lt;LocationMatch&gt;</a></li>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<li><img alt="" src="/images/down.gif" /> <a href="#loglevel">LogLevel</a></li>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<li><img alt="" src="/images/down.gif" /> <a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<li><img alt="" src="/images/down.gif" /> <a href="#mutex">Mutex</a></li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<li><img alt="" src="/images/down.gif" /> <a href="#namevirtualhost">NameVirtualHost</a></li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<li><img alt="" src="/images/down.gif" /> <a href="#options">Options</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#rlimitcpu">RLimitCPU</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#rlimitmem">RLimitMEM</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#rlimitnproc">RLimitNPROC</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#seerequesttail">SeeRequestTail</a></li>
003f0c9fda6664daf5092a0e42f65ede20098153slive<li><img alt="" src="/images/down.gif" /> <a href="#serveradmin">ServerAdmin</a></li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<li><img alt="" src="/images/down.gif" /> <a href="#serveralias">ServerAlias</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#servername">ServerName</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#serverpath">ServerPath</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#serverroot">ServerRoot</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#serversignature">ServerSignature</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#servertokens">ServerTokens</a></li>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<li><img alt="" src="/images/down.gif" /> <a href="#sethandler">SetHandler</a></li>
003f0c9fda6664daf5092a0e42f65ede20098153slive<li><img alt="" src="/images/down.gif" /> <a href="#setinputfilter">SetInputFilter</a></li>
003f0c9fda6664daf5092a0e42f65ede20098153slive<li><img alt="" src="/images/down.gif" /> <a href="#setoutputfilter">SetOutputFilter</a></li>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<li><img alt="" src="/images/down.gif" /> <a href="#timeout">TimeOut</a></li>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<li><img alt="" src="/images/down.gif" /> <a href="#traceenable">TraceEnable</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><img alt="" src="/images/down.gif" /> <a href="#undefine">UnDefine</a></li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<li><img alt="" src="/images/down.gif" /> <a href="#usecanonicalname">UseCanonicalName</a></li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<li><img alt="" src="/images/down.gif" /> <a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<li><img alt="" src="/images/down.gif" /> <a href="#virtualhost">&lt;VirtualHost&gt;</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="AcceptFilter" id="AcceptFilter">AcceptFilter</a> <a name="acceptfilter" id="acceptfilter">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures optimizations for a Protocol's Listener Sockets</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptFilter <var>protocol</var> <var>accept_filter</var></code></td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.1.5 and later.
130d299c4b2b15be45532a176604c71fdc7bea5bndOn Windows from Apache httpd 2.3.3 and later.</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive enables operating system specific optimizations for a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive listening socket by the Protocol type. The basic premise is for the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive kernel to not send a socket to the server process until either data
1a3f62ca37273a15a06bb94a61d3c6fcf4bf38c9rbowen is received or an entire HTTP Request is buffered. Only
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <a href="http://www.freebsd.org/cgi/man.cgi?query=accept_filter&amp;sektion=9">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive FreeBSD's Accept Filters</a>, Linux's more primitive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>TCP_DEFER_ACCEPT</code>, and Windows' optimized AcceptEx()
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive are currently supported.</p>
003f0c9fda6664daf5092a0e42f65ede20098153slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Using <code>none</code> for an argument will disable any accept filters
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd for that protocol. This is useful for protocols that require a server
530eba85dbd41b8a0fa5255d3648d1440199a661slive send data first, such as <code>ftp:</code> or <code>nntp</code>:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>AcceptFilter nntp none</code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The default values on FreeBSD are:</p>
003f0c9fda6664daf5092a0e42f65ede20098153slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive AcceptFilter http httpready <br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive AcceptFilter https dataready
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code>httpready</code> accept filter buffers entire HTTP requests at
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the kernel level. Once an entire request is received, the kernel then
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive sends it to the server. See the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_http&amp;sektion=9">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive accf_http(9)</a> man page for more details. Since HTTPS requests are
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive encrypted only the <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_data&amp;sektion=9">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive accf_data(9)</a> filter is used.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The default values on Linux are:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd AcceptFilter http data <br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd AcceptFilter https data
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Linux's <code>TCP_DEFER_ACCEPT</code> does not support buffering http
58699879a562774640b95e9eedfd891f336e38c2nd requests. Any value besides <code>none</code> will enable
58699879a562774640b95e9eedfd891f336e38c2nd <code>TCP_DEFER_ACCEPT</code> on that listener. For more details
58699879a562774640b95e9eedfd891f336e38c2nd see the Linux
fb77c505254b6e9c925e23e734463e87574f8f40kess <a href="http://homepages.cwi.nl/~aeb/linux/man2html/man7/tcp.7.html">
fb77c505254b6e9c925e23e734463e87574f8f40kess tcp(7)</a> man page.</p>
58699879a562774640b95e9eedfd891f336e38c2nd
58699879a562774640b95e9eedfd891f336e38c2nd <p>The default values on Windows are:</p>
58699879a562774640b95e9eedfd891f336e38c2nd <div class="example"><p><code>
58699879a562774640b95e9eedfd891f336e38c2nd AcceptFilter http data <br />
58699879a562774640b95e9eedfd891f336e38c2nd AcceptFilter https data
58699879a562774640b95e9eedfd891f336e38c2nd </code></p></div>
58699879a562774640b95e9eedfd891f336e38c2nd
58699879a562774640b95e9eedfd891f336e38c2nd <p>Window's mpm_winnt interprets the AcceptFilter to toggle the AcceptEx()
58699879a562774640b95e9eedfd891f336e38c2nd API, and does not support http protocol buffering. There are two values
58699879a562774640b95e9eedfd891f336e38c2nd which utilize the Windows AcceptEx() API and will recycle network
58699879a562774640b95e9eedfd891f336e38c2nd sockets between connections. <code>data</code> waits until data has
fb77c505254b6e9c925e23e734463e87574f8f40kess been transmitted as documented above, and the initial data buffer and
fb77c505254b6e9c925e23e734463e87574f8f40kess network endpoint addresses are all retrieved from the single AcceptEx()
fb77c505254b6e9c925e23e734463e87574f8f40kess invocation. <code>connect</code> will use the AcceptEx() API, also
fb77c505254b6e9c925e23e734463e87574f8f40kess retrieve the network endpoint addresses, but like <code>none</code>
fb77c505254b6e9c925e23e734463e87574f8f40kess the <code>connect</code> option does not wait for the initial data
58699879a562774640b95e9eedfd891f336e38c2nd transmission.</p>
58699879a562774640b95e9eedfd891f336e38c2nd
58699879a562774640b95e9eedfd891f336e38c2nd <p>On Windows, <code>none</code> uses accept() rather than than AcceptEx()
58699879a562774640b95e9eedfd891f336e38c2nd and will not recycle sockets between connections. This is useful for
58699879a562774640b95e9eedfd891f336e38c2nd network adapters with broken driver support, as well as some virtual
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess network providers such as vpn drivers, or spam, virus or spyware
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess filters.</p>
58699879a562774640b95e9eedfd891f336e38c2nd
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess
58699879a562774640b95e9eedfd891f336e38c2nd</div>
58699879a562774640b95e9eedfd891f336e38c2nd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
fb77c505254b6e9c925e23e734463e87574f8f40kess<div class="directive-section"><h2><a name="AcceptPathInfo" id="AcceptPathInfo">AcceptPathInfo</a> <a name="acceptpathinfo" id="acceptpathinfo">Directive</a></h2>
fb77c505254b6e9c925e23e734463e87574f8f40kess<table class="directive">
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Resources accept trailing pathname information</td></tr>
58699879a562774640b95e9eedfd891f336e38c2nd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptPathInfo On|Off|Default</code></td></tr>
58699879a562774640b95e9eedfd891f336e38c2nd<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AcceptPathInfo Default</code></td></tr>
58699879a562774640b95e9eedfd891f336e38c2nd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
58699879a562774640b95e9eedfd891f336e38c2nd<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
58699879a562774640b95e9eedfd891f336e38c2nd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
58699879a562774640b95e9eedfd891f336e38c2nd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
58699879a562774640b95e9eedfd891f336e38c2nd<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.0.30 and later</td></tr>
58699879a562774640b95e9eedfd891f336e38c2nd</table>
58699879a562774640b95e9eedfd891f336e38c2nd
58699879a562774640b95e9eedfd891f336e38c2nd <p>This directive controls whether requests that contain trailing
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess pathname information that follows an actual filename (or
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd non-existent file in an existing directory) will be accepted or
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd rejected. The trailing pathname information can be made
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess available to scripts in the <code>PATH_INFO</code> environment
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess variable.</p>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <p>For example, assume the location <code>/test/</code> points to
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd a directory that contains only the single file
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd <code>here.html</code>. Then requests for
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd <code>/test/here.html/more</code> and
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd <code>/test/nothere.html/more</code> both collect
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd <code>/more</code> as <code>PATH_INFO</code>.</p>
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd <p>The three possible arguments for the
ec9b02c6869b75575ada34c800672162833a2c06nd <code class="directive">AcceptPathInfo</code> directive are:</p>
58699879a562774640b95e9eedfd891f336e38c2nd <dl>
58699879a562774640b95e9eedfd891f336e38c2nd <dt><code>Off</code></dt><dd>A request will only be accepted if it
58699879a562774640b95e9eedfd891f336e38c2nd maps to a literal path that exists. Therefore a request with
58699879a562774640b95e9eedfd891f336e38c2nd trailing pathname information after the true filename such as
58699879a562774640b95e9eedfd891f336e38c2nd <code>/test/here.html/more</code> in the above example will return
4a7affccb2f1f5b94cab395e1bf3825aed715ebcnd a 404 NOT FOUND error.</dd>
58699879a562774640b95e9eedfd891f336e38c2nd
58699879a562774640b95e9eedfd891f336e38c2nd <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
003f0c9fda6664daf5092a0e42f65ede20098153slive <code>/test/here.html</code> maps to a valid file.</dd>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
fb77c505254b6e9c925e23e734463e87574f8f40kess <dt><code>Default</code></dt><dd>The treatment of requests with
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd trailing pathname information is determined by the <a href="/handler.html">handler</a> responsible for the request.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive The core handler for normal files defaults to rejecting
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>PATH_INFO</code> requests. Handlers that serve scripts, such as <a href="mod_cgi.html">cgi-script</a> and <a href="mod_isapi.html">isapi-handler</a>, generally accept
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>PATH_INFO</code> by default.</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </dl>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>The primary purpose of the <code>AcceptPathInfo</code>
fb77c505254b6e9c925e23e734463e87574f8f40kess directive is to allow you to override the handler's choice of
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess accepting or rejecting <code>PATH_INFO</code>. This override is required,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive for example, when you use a <a href="/filter.html">filter</a>, such
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess as <a href="mod_include.html">INCLUDES</a>, to generate content
10673857794a4b3d9568ca2d983722a87ed352f1rbowen based on <code>PATH_INFO</code>. The core handler would usually reject
fb77c505254b6e9c925e23e734463e87574f8f40kess the request, so you can use the following configuration to enable
fb77c505254b6e9c925e23e734463e87574f8f40kess such a script:</p>
10673857794a4b3d9568ca2d983722a87ed352f1rbowen
6af14face8dcdab3a5cd88fcdda91c268f7a3745slive <div class="example"><p><code>
10673857794a4b3d9568ca2d983722a87ed352f1rbowen &lt;Files "mypaths.shtml"&gt;<br />
10673857794a4b3d9568ca2d983722a87ed352f1rbowen <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Options +Includes<br />
fb77c505254b6e9c925e23e734463e87574f8f40kess SetOutputFilter INCLUDES<br />
fb77c505254b6e9c925e23e734463e87574f8f40kess AcceptPathInfo On<br />
fb77c505254b6e9c925e23e734463e87574f8f40kess </span>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/Files&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
fb77c505254b6e9c925e23e734463e87574f8f40kess</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="directive-section"><h2><a name="AccessFileName" id="AccessFileName">AccessFileName</a> <a name="accessfilename" id="accessfilename">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the distributed configuration file</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AccessFileName <var>filename</var> [<var>filename</var>] ...</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AccessFileName .htaccess</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz <p>While processing a request the server looks for
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz the first existing configuration file from this list of names in
9ed9eaf871c58d281af02e76125ceadb5060afa5nd every directory of the path to the document, if distributed
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess configuration files are <a href="#allowoverride">enabled for that
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directory</a>. For example:</p>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive AccessFileName .acl
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>before returning the document
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>/usr/local/web/index.html</code>, the server will read
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>/.acl</code>, <code>/usr/.acl</code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive for directives, unless they have been disabled with</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Directory /&gt;<br />
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive AllowOverride None<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/Directory&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<h3>See also</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><a href="/configuring.html">Configuration Files</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><a href="/howto/htaccess.html">.htaccess Files</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="AddDefaultCharset" id="AddDefaultCharset">AddDefaultCharset</a> <a name="adddefaultcharset" id="adddefaultcharset">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default charset parameter to be added when a response
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivecontent-type is <code>text/plain</code> or <code>text/html</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddDefaultCharset On|Off|<var>charset</var></code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AddDefaultCharset Off</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive specifies a default value for the media type
9ed9eaf871c58d281af02e76125ceadb5060afa5nd charset parameter (the name of a character encoding) to be added
9ed9eaf871c58d281af02e76125ceadb5060afa5nd to a response if and only if the response's content-type is either
9ed9eaf871c58d281af02e76125ceadb5060afa5nd <code>text/plain</code> or <code>text/html</code>. This should override
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive any charset specified in the body of the response via a <code>META</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive element, though the exact behavior is often dependent on the user's client
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive configuration. A setting of <code>AddDefaultCharset Off</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive disables this functionality. <code>AddDefaultCharset On</code> enables
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive a default charset of <code>iso-8859-1</code>. Any other value is assumed
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to be the <var>charset</var> to be used, which should be one of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <a href="http://www.iana.org/assignments/character-sets">IANA registered
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive charset values</a> for use in Internet media types (MIME types).
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive For example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd AddDefaultCharset utf-8
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><code class="directive">AddDefaultCharset</code> should only be used when all
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of the text resources to which it applies are known to be in that
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive character encoding and it is too inconvenient to label their charset
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive individually. One such example is to add the charset parameter
54bcd0e21a5c79158afd3b78bf707a493a5fb33crbowen to resources containing generated content, such as legacy CGI
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive scripts, that might be vulnerable to cross-site scripting attacks
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive due to user-provided data being included in the output. Note, however,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive that a better solution is to just fix (or delete) those scripts, since
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive setting a default charset does not protect users that have enabled
003f0c9fda6664daf5092a0e42f65ede20098153slive the "auto-detect character encoding" feature on their browser.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<h3>See also</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><code class="directive"><a href="/mod/mod_mime.html#addcharset">AddCharset</a></code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="AllowEncodedSlashes" id="AllowEncodedSlashes">AllowEncodedSlashes</a> <a name="allowencodedslashes" id="allowencodedslashes">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether encoded path separators in URLs are allowed to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivebe passed through</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowEncodedSlashes On|Off</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowEncodedSlashes Off</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.0.46 and later</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">AllowEncodedSlashes</code> directive allows URLs
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive which contain encoded path separators (<code>%2F</code> for <code>/</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive and additionally <code>%5C</code> for <code>\</code> on according systems)
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Turning <code class="directive">AllowEncodedSlashes</code> <code>On</code> is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
1c9f7cdf2e1bc8313e559a96638c3c36e3143791yoshiki
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="note"><h3>Note</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess according systems) will be left as such in the otherwise decoded URL
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive string.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<h3>See also</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<ul>
003f0c9fda6664daf5092a0e42f65ede20098153slive<li><code class="directive"><a href="#acceptpathinfo">AcceptPathInfo</a></code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
530eba85dbd41b8a0fa5255d3648d1440199a661slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
530eba85dbd41b8a0fa5255d3648d1440199a661slive<div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Types of directives that are allowed in
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<code>.htaccess</code> files</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess[<var>directive-type</var>] ...</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowOverride All</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd</table>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd <p>When the server finds an <code>.htaccess</code> file (as
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>)
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive it needs to know which directives declared in that file can override
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive earlier configuration directives.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="note"><h3>Only available in &lt;Directory&gt; sections</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive">AllowOverride</code> is valid only in
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes sections specified without regular expressions, not in <code class="directive"><a href="#location">&lt;Location&gt;</a></code>, <code class="directive"><a href="#directorymatch">&lt;DirectoryMatch&gt;</a></code> or
fb77c505254b6e9c925e23e734463e87574f8f40kess <code class="directive"><a href="#files">&lt;Files&gt;</a></code> sections.
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes </div>
fb77c505254b6e9c925e23e734463e87574f8f40kess
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes <p>When this directive is set to <code>None</code>, then
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes <a href="#accessfilename">.htaccess</a> files are completely ignored.
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes In this case, the server will not even attempt to read
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes <code>.htaccess</code> files in the filesystem.</p>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes <p>When this directive is set to <code>All</code>, then any
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>.htaccess</code> files.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>The <var>directive-type</var> can be one of the following
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess groupings of directives.</p>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes <dl>
4c7bdb15764021d39e486adb7bc2166d3f683773bnicholes <dt>AuthConfig</dt>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dd>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
fb77c505254b6e9c925e23e734463e87574f8f40kess Allow use of the authorization directives (<code class="directive"><a href="/mod/mod_authn_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>,
fb77c505254b6e9c925e23e734463e87574f8f40kess <code class="directive"><a href="/mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>,
fb77c505254b6e9c925e23e734463e87574f8f40kess <code class="directive"><a href="/mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="/mod/mod_authn_core.html#authname">AuthName</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="/mod/mod_authn_core.html#authtype">AuthType</a></code>, <code class="directive"><a href="/mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>, <code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code>, <em>etc.</em>).</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dt>FileInfo</dt>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Allow use of the directives controlling document types
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive (<code class="directive"><a href="#errordocument">ErrorDocument</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#forcetype">ForceType</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="/mod/mod_negotiation.html#languagepriority">LanguagePriority</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#sethandler">SetHandler</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#setinputfilter">SetInputFilter</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code>, and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="module"><a href="/mod/mod_mime.html">mod_mime</a></code> Add* and Remove* directives),
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive document meta data (<code class="directive"><a href="/mod/mod_headers.html#header">Header</a></code>, <code class="directive"><a href="/mod/mod_headers.html#requestheader">RequestHeader</a></code>, <code class="directive"><a href="/mod/mod_setenvif.html#setenvif">SetEnvIf</a></code>, <code class="directive"><a href="/mod/mod_setenvif.html#setenvifnocase">SetEnvIfNoCase</a></code>, <code class="directive"><a href="/mod/mod_setenvif.html#browsermatch">BrowserMatch</a></code>, <code class="directive"><a href="/mod/mod_usertrack.html#cookieexpires">CookieExpires</a></code>, <code class="directive"><a href="/mod/mod_usertrack.html#cookiedomain">CookieDomain</a></code>, <code class="directive"><a href="/mod/mod_usertrack.html#cookiestyle">CookieStyle</a></code>, <code class="directive"><a href="/mod/mod_usertrack.html#cookietracking">CookieTracking</a></code>, <code class="directive"><a href="/mod/mod_usertrack.html#cookiename">CookieName</a></code>),
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code> directives <code class="directive"><a href="/mod/mod_rewrite.html#rewriteengine">RewriteEngine</a></code>, <code class="directive"><a href="/mod/mod_rewrite.html#rewriteoptions">RewriteOptions</a></code>, <code class="directive"><a href="/mod/mod_rewrite.html#rewritebase">RewriteBase</a></code>, <code class="directive"><a href="/mod/mod_rewrite.html#rewritecond">RewriteCond</a></code>, <code class="directive"><a href="/mod/mod_rewrite.html#rewriterule">RewriteRule</a></code>) and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="/mod/mod_actions.html#action">Action</a></code> from
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="module"><a href="/mod/mod_actions.html">mod_actions</a></code>.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <dt>Indexes</dt>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <dd>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Allow use of the directives controlling directory indexing
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive (<code class="directive"><a href="/mod/mod_autoindex.html#adddescription">AddDescription</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="/mod/mod_autoindex.html#addicon">AddIcon</a></code>, <code class="directive"><a href="/mod/mod_autoindex.html#addiconbyencoding">AddIconByEncoding</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="/mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="/mod/mod_autoindex.html#defaulticon">DefaultIcon</a></code>, <code class="directive"><a href="/mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>, <code class="directive"><a href="/mod/mod_autoindex.html#fancyindexing">FancyIndexing</a></code>, <code class="directive"><a href="/mod/mod_autoindex.html#headername">HeaderName</a></code>, <code class="directive"><a href="/mod/mod_autoindex.html#indexignore">IndexIgnore</a></code>, <code class="directive"><a href="/mod/mod_autoindex.html#indexoptions">IndexOptions</a></code>, <code class="directive"><a href="/mod/mod_autoindex.html#readmename">ReadmeName</a></code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <em>etc.</em>).</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
fb77c505254b6e9c925e23e734463e87574f8f40kess <dt>Limit</dt>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess <dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Allow use of the directives controlling host access (<code class="directive"><a href="/mod/mod_authz_host.html#allow">Allow</a></code>, <code class="directive"><a href="/mod/mod_authz_host.html#deny">Deny</a></code> and <code class="directive"><a href="/mod/mod_authz_host.html#order">Order</a></code>).</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dt>Options[=<var>Option</var>,...]</dt>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dd>
003f0c9fda6664daf5092a0e42f65ede20098153slive Allow use of the directives controlling specific directory
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive features (<code class="directive"><a href="#options">Options</a></code> and
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code class="directive"><a href="/mod/mod_include.html#xbithack">XBitHack</a></code>).
76f2a3125fb6aca59d43b02220dabac91175a281slive An equal sign may be given followed by a comma (but no spaces)
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive separated lists of options that may be set using the <code class="directive"><a href="#options">Options</a></code> command.</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </dl>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive AllowOverride AuthConfig Indexes
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>In the example above all directives that are neither in the group
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive server error.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="note"><p>For security and performance reasons, do not set
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>AllowOverride</code> to anything other than <code>None</code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd in your <code>&lt;Directory /&gt;</code> block. Instead, find (or
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd create) the <code>&lt;Directory&gt;</code> block that refers to the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd directory where you're actually planning to place a
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <code>.htaccess</code> file.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<h3>See also</h3>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess<ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><a href="/configuring.html">Configuration Files</a></li>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<li><a href="/howto/htaccess.html">.htaccess Files</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="CGIMapExtension" id="CGIMapExtension">CGIMapExtension</a> <a name="cgimapextension" id="cgimapextension">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivescripts</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CGIMapExtension <var>cgi-path</var> <var>.extension</var></code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>NetWare only</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive is used to control how Apache httpd finds the
003f0c9fda6664daf5092a0e42f65ede20098153slive interpreter used to run CGI scripts. For example, setting
003f0c9fda6664daf5092a0e42f65ede20098153slive <code>CGIMapExtension sys:\foo.nlm .foo</code> will
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd cause all CGI script files with a <code>.foo</code> extension to
003f0c9fda6664daf5092a0e42f65ede20098153slive be passed to the FOO interpreter.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess</div>
fb77c505254b6e9c925e23e734463e87574f8f40kess<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
fb77c505254b6e9c925e23e734463e87574f8f40kess<div class="directive-section"><h2><a name="ContentDigest" id="ContentDigest">ContentDigest</a> <a name="contentdigest" id="contentdigest">Directive</a></h2>
003f0c9fda6664daf5092a0e42f65ede20098153slive<table class="directive">
003f0c9fda6664daf5092a0e42f65ede20098153slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables the generation of <code>Content-MD5</code> HTTP Response
003f0c9fda6664daf5092a0e42f65ede20098153sliveheaders</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ContentDigest On|Off</code></td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ContentDigest Off</code></td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd</table>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>This directive enables the generation of
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>Content-MD5</code> headers as defined in RFC1864
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd respectively RFC2616.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>MD5 is an algorithm for computing a "message digest"
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd (sometimes called "fingerprint") of arbitrary-length data, with
fb77c505254b6e9c925e23e734463e87574f8f40kess a high degree of confidence that any alterations in the data
fb77c505254b6e9c925e23e734463e87574f8f40kess will be reflected in alterations in the message digest.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The <code>Content-MD5</code> header provides an end-to-end
b06660a3ed3d885e15d99c0209a46c4657df33fbrbowen 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>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Note that this can cause performance problems on your server
fb77c505254b6e9c925e23e734463e87574f8f40kess since the message digest is computed on every request (the
fb77c505254b6e9c925e23e734463e87574f8f40kess values are not cached).</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <p><code>Content-MD5</code> is only sent for documents served
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess by the <code class="module"><a href="/mod/core.html">core</a></code>, and not by any module. For example,
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess SSI documents, output from CGI scripts, and byte range responses
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive do not have this header.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="DefaultType" id="DefaultType">DefaultType</a> <a name="defaulttype" id="defaulttype">Directive</a></h2>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<table class="directive">
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>This directive has no effect other than to emit warnings
130d299c4b2b15be45532a176604c71fdc7bea5bndif the value is not <code>none</code>. In prior versions, DefaultType
130d299c4b2b15be45532a176604c71fdc7bea5bndwould specify a default media type to assign to response content for
130d299c4b2b15be45532a176604c71fdc7bea5bndwhich no other media type configuration could be found.
130d299c4b2b15be45532a176604c71fdc7bea5bnd</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultType <var>media-type|none</var></code></td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DefaultType none</code></td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>The argument <code>none</code> is available in Apache httpd 2.2.7 and later. All other choices are DISABLED for 2.3.x and later.</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive has been disabled. For backwards compatibility
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of configuration files, it may be specified with the value
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>none</code>, meaning no default media type. For example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive DefaultType None
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <p><code>DefaultType None</code> is only available in
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive httpd-2.2.7 and later.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <p>Use the mime.types configuration file and the
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <code class="directive"><a href="/mod/mod_mime.html#addtype">AddType</a></code> to configure media
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type assignments via file extensions, or the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#forcetype">ForceType</a></code> directive to configure
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the media type for specific resources. Otherwise, the server will
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive send the response without a Content-Type header field and the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive recipient may attempt to guess the media type.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<div class="directive-section"><h2><a name="Define" id="Define">Define</a> <a name="define" id="define">Directive</a></h2>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<table class="directive">
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Define the existence of a variable</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Define <var>parameter-name</var></code></td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess</table>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <p>Equivalent to passing the <code>-D</code> argument to <code class="program"><a href="/programs/httpd.html">httpd</a></code>.</p>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <p>This directive can be used to toggle the use of <code class="directive"><a href="#ifdefine">&lt;IfDefine&gt;</a></code> sections without needing to alter
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <code>-D</code> arguments in any startup scripts.</p>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="Directory" id="Directory">&lt;Directory&gt;</a> <a name="directory" id="directory">Directive</a></h2>
fb77c505254b6e9c925e23e734463e87574f8f40kess<table class="directive">
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose a group of directives that apply only to the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivenamed file-system directory and sub-directories</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Directory <var>directory-path</var>&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive... &lt;/Directory&gt;</code></td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd</table>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p><code class="directive">&lt;Directory&gt;</code> and
130d299c4b2b15be45532a176604c71fdc7bea5bnd <code>&lt;/Directory&gt;</code> are used to enclose a group of
130d299c4b2b15be45532a176604c71fdc7bea5bnd directives that will apply only to the named directory and
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd sub-directories of that directory. Any directive that is allowed
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive in a directory context may be used. <var>Directory-path</var> is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive either the full path to a directory, or a wild-card string using
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Unix shell-style matching. In a wild-card string, <code>?</code> matches
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive any single character, and <code>*</code> matches any sequences of
fb77c505254b6e9c925e23e734463e87574f8f40kess characters. You may also use <code>[]</code> character ranges. None
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of the wildcards match a `/' character, so <code>&lt;Directory
fb77c505254b6e9c925e23e734463e87574f8f40kess /*/public_html&gt;</code> will not match
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>/home/user/public_html</code>, but <code>&lt;Directory
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive /home/*/public_html&gt;</code> will match. Example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Directory /usr/local/httpd/htdocs&gt;<br />
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <span class="indent">
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess Options Indexes FollowSymLinks<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/Directory&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="note">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Be careful with the <var>directory-path</var> arguments:
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess They have to literally match the filesystem path which Apache httpd uses
15ba1801088da1aad6d20609cf3f7b0b1eefce8aslive to access the files. Directives applied to a particular
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>&lt;Directory&gt;</code> will not apply to files accessed from
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd that same directory via a different path, such as via different symbolic
7b5535ed88e0f561b3bfb3330137bd804846afd4slive links.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><a class="glossarylink" href="/glossary.html#regex" title="see glossary">Regular
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive expressions</a> can also be used, with the addition of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>~</code> character. For example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Directory ~ "^/www/.*/[0-9]{3}"&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>would match directories in <code>/www/</code> that consisted of
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd three numbers.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>If multiple (non-regular expression) <code class="directive">&lt;Directory&gt;</code> sections
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive 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 href="#accessfilename">.htaccess</a> files. For example,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive with</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess &lt;Directory /&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess AllowOverride None<br />
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess </span>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess &lt;/Directory&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Directory /home/&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive AllowOverride FileInfo<br />
003f0c9fda6664daf5092a0e42f65ede20098153slive </span>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/Directory&gt;
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>for access to the document <code>/home/web/dir/doc.html</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the steps are:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <ul>
fb77c505254b6e9c925e23e734463e87574f8f40kess <li>Apply directive <code>AllowOverride None</code>
fb77c505254b6e9c925e23e734463e87574f8f40kess (disabling <code>.htaccess</code> files).</li>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess <li>Apply directive <code>AllowOverride FileInfo</code> (for
fb77c505254b6e9c925e23e734463e87574f8f40kess directory <code>/home</code>).</li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <li>Apply any <code>FileInfo</code> directives in
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>/home/web/dir/.htaccess</code> in that order.</li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
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>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Directory ~ abc$&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive # ... directives here ...<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
af18698b10b429b270551ca3a5d51a75e1c9db22brianp &lt;/Directory&gt;
af18698b10b429b270551ca3a5d51a75e1c9db22brianp </code></p></div>
003f0c9fda6664daf5092a0e42f65ede20098153slive
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>the regular expression section won't be considered until after
fb77c505254b6e9c925e23e734463e87574f8f40kess all normal <code class="directive">&lt;Directory&gt;</code>s and
af18698b10b429b270551ca3a5d51a75e1c9db22brianp <code>.htaccess</code> files have been applied. Then the regular
af18698b10b429b270551ca3a5d51a75e1c9db22brianp expression will match on <code>/home/abc/public_html/abc</code> and
af18698b10b429b270551ca3a5d51a75e1c9db22brianp the corresponding <code class="directive">&lt;Directory&gt;</code> will
003f0c9fda6664daf5092a0e42f65ede20098153slive be applied.</p>
af18698b10b429b270551ca3a5d51a75e1c9db22brianp
af18698b10b429b270551ca3a5d51a75e1c9db22brianp <p><strong>Note that the default access for
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>&lt;Directory /&gt;</code> is <code>Allow from All</code>.
003f0c9fda6664daf5092a0e42f65ede20098153slive This means that Apache httpd will serve any file mapped from an URL. It is
003f0c9fda6664daf5092a0e42f65ede20098153slive recommended that you change this with a block such
fb77c505254b6e9c925e23e734463e87574f8f40kess as</strong></p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &lt;Directory /&gt;<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <span class="indent">
af18698b10b429b270551ca3a5d51a75e1c9db22brianp Order Deny,Allow<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Deny from All<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </span>
af18698b10b429b270551ca3a5d51a75e1c9db22brianp &lt;/Directory&gt;
af18698b10b429b270551ca3a5d51a75e1c9db22brianp </code></p></div>
fb77c505254b6e9c925e23e734463e87574f8f40kess
af18698b10b429b270551ca3a5d51a75e1c9db22brianp <p><strong>and then override this for directories you
fb77c505254b6e9c925e23e734463e87574f8f40kess <em>want</em> accessible. See the <a href="/misc/security_tips.html">Security Tips</a> page for more
fb77c505254b6e9c925e23e734463e87574f8f40kess details.</strong></p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
af18698b10b429b270551ca3a5d51a75e1c9db22brianp <p>The directory sections occur in the <code>httpd.conf</code> file.
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code class="directive">&lt;Directory&gt;</code> directives
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd cannot nest, and cannot appear in a <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code> or <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> section.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<h3>See also</h3>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<ul>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><a href="/sections.html">How &lt;Directory&gt;,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &lt;Location&gt; and &lt;Files&gt; sections work</a> for an
41ef8b3051855b802104193ee0a587515af60a37wrowe explanation of how these different sections are combined when a
41ef8b3051855b802104193ee0a587515af60a37wrowe request is received</li>
41ef8b3051855b802104193ee0a587515af60a37wrowe</ul>
41ef8b3051855b802104193ee0a587515af60a37wrowe</div>
41ef8b3051855b802104193ee0a587515af60a37wrowe<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
41ef8b3051855b802104193ee0a587515af60a37wrowe<div class="directive-section"><h2><a name="DirectoryMatch" id="DirectoryMatch">&lt;DirectoryMatch&gt;</a> <a name="directorymatch" id="directorymatch">Directive</a></h2>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<table class="directive">
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose directives that apply to
313bb560bc5c323cfd40c9cad7335b4b8e060aedkessfile-system directories matching a regular expression.</td></tr>
41ef8b3051855b802104193ee0a587515af60a37wrowe<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;DirectoryMatch <var>regex</var>&gt;
41ef8b3051855b802104193ee0a587515af60a37wrowe... &lt;/DirectoryMatch&gt;</code></td></tr>
41ef8b3051855b802104193ee0a587515af60a37wrowe<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
41ef8b3051855b802104193ee0a587515af60a37wrowe<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
41ef8b3051855b802104193ee0a587515af60a37wrowe<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
41ef8b3051855b802104193ee0a587515af60a37wrowe</table>
41ef8b3051855b802104193ee0a587515af60a37wrowe <p><code class="directive">&lt;DirectoryMatch&gt;</code> and
41ef8b3051855b802104193ee0a587515af60a37wrowe <code>&lt;/DirectoryMatch&gt;</code> are used to enclose a group
fb77c505254b6e9c925e23e734463e87574f8f40kess of directives which will apply only to the named directory,
fb77c505254b6e9c925e23e734463e87574f8f40kess the same as <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>.
41ef8b3051855b802104193ee0a587515af60a37wrowe However, it takes as an argument a
41ef8b3051855b802104193ee0a587515af60a37wrowe <a class="glossarylink" href="/glossary.html#regex" title="see glossary">regular expression</a>. For example:</p>
41ef8b3051855b802104193ee0a587515af60a37wrowe
41ef8b3051855b802104193ee0a587515af60a37wrowe <div class="example"><p><code>
9fb925624300c864fe3969a264e52aa83f3c2dd0slive &lt;DirectoryMatch "^/www/(.+/)?[0-9]{3}"&gt;
41ef8b3051855b802104193ee0a587515af60a37wrowe </code></p></div>
41ef8b3051855b802104193ee0a587515af60a37wrowe
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>would match directories in <code>/www/</code> that consisted of three
41ef8b3051855b802104193ee0a587515af60a37wrowe numbers.</p>
41ef8b3051855b802104193ee0a587515af60a37wrowe
41ef8b3051855b802104193ee0a587515af60a37wrowe <div class="note"><h3>Compatability</h3>
41ef8b3051855b802104193ee0a587515af60a37wrowe Prior to 2.3.9, this directive implicitly applied to sub-directories
41ef8b3051855b802104193ee0a587515af60a37wrowe (like <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>) and
41ef8b3051855b802104193ee0a587515af60a37wrowe could not match the end of line symbol ($). In 2.3.9 and later,
41ef8b3051855b802104193ee0a587515af60a37wrowe only directories that match the expression are affected by the enclosed
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess directives.
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess </div>
41ef8b3051855b802104193ee0a587515af60a37wrowe
41ef8b3051855b802104193ee0a587515af60a37wrowe <div class="note"><h3>Trailing Slash</h3>
41ef8b3051855b802104193ee0a587515af60a37wrowe This directive applies to requests for directories that may or may
41ef8b3051855b802104193ee0a587515af60a37wrowe not end in a trailing slash, so expressions that are anchored to the
41ef8b3051855b802104193ee0a587515af60a37wrowe end of line ($) must be written with care.
9fb925624300c864fe3969a264e52aa83f3c2dd0slive </div>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
9fb925624300c864fe3969a264e52aa83f3c2dd0slive<h3>See also</h3>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<ul>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<li><code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> for
9fb925624300c864fe3969a264e52aa83f3c2dd0slivea description of how regular expressions are mixed in with normal
41ef8b3051855b802104193ee0a587515af60a37wrowe<code class="directive">&lt;Directory&gt;</code>s</li>
41ef8b3051855b802104193ee0a587515af60a37wrowe<li><a href="/sections.html">How &lt;Directory&gt;, &lt;Location&gt; and
41ef8b3051855b802104193ee0a587515af60a37wrowe&lt;Files&gt; sections work</a> for an explanation of how these different
05201775eaa6b363b8a119c8aea5db246b967591yoshikisections are combined when a request is received</li>
41ef8b3051855b802104193ee0a587515af60a37wrowe</ul>
41ef8b3051855b802104193ee0a587515af60a37wrowe</div>
fb77c505254b6e9c925e23e734463e87574f8f40kess<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
41ef8b3051855b802104193ee0a587515af60a37wrowe<div class="directive-section"><h2><a name="DocumentRoot" id="DocumentRoot">DocumentRoot</a> <a name="documentroot" id="documentroot">Directive</a></h2>
41ef8b3051855b802104193ee0a587515af60a37wrowe<table class="directive">
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory that forms the main document tree visible
9fb925624300c864fe3969a264e52aa83f3c2dd0slivefrom the web</td></tr>
41ef8b3051855b802104193ee0a587515af60a37wrowe<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DocumentRoot <var>directory-path</var></code></td></tr>
41ef8b3051855b802104193ee0a587515af60a37wrowe<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DocumentRoot /usr/local/apache/htdocs</code></td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess</table>
41ef8b3051855b802104193ee0a587515af60a37wrowe <p>This directive sets the directory from which <code class="program"><a href="/programs/httpd.html">httpd</a></code>
41ef8b3051855b802104193ee0a587515af60a37wrowe will serve files. Unless matched by a directive like <code class="directive"><a href="/mod/mod_alias.html#alias">Alias</a></code>, the server appends the
af18698b10b429b270551ca3a5d51a75e1c9db22brianp path from the requested URL to the document root to make the
af18698b10b429b270551ca3a5d51a75e1c9db22brianp path to the document. Example:</p>
af18698b10b429b270551ca3a5d51a75e1c9db22brianp
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive DocumentRoot /usr/web
003f0c9fda6664daf5092a0e42f65ede20098153slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>then an access to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>http://www.my.host.com/index.html</code> refers to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>/usr/web/index.html</code>. If the <var>directory-path</var> is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive not absolute then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">DocumentRoot</code> should be specified without
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive a trailing slash.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<h3>See also</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><a href="/urlmapping.html#documentroot">Mapping URLs to Filesystem
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveLocations</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="EnableMMAP" id="EnableMMAP">EnableMMAP</a> <a name="enablemmap" id="enablemmap">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use memory-mapping to read files during delivery</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableMMAP On|Off</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableMMAP On</code></td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive controls whether the <code class="program"><a href="/programs/httpd.html">httpd</a></code> may use
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive memory-mapping if it needs to read the contents of a file during
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive delivery. By default, when the handling of a request requires
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive access to the data within a file -- for example, when delivering a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive server-parsed file using <code class="module"><a href="/mod/mod_include.html">mod_include</a></code> -- Apache httpd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive memory-maps the file if the OS supports it.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This memory-mapping sometimes yields a performance improvement.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive But in some environments, it is better to disable the memory-mapping
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd to prevent operational problems:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <ul>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <li>On some multiprocessor systems, memory-mapping can reduce the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd performance of the <code class="program"><a href="/programs/httpd.html">httpd</a></code>.</li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <li>Deleting or truncating a file while <code class="program"><a href="/programs/httpd.html">httpd</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive has it memory-mapped can cause <code class="program"><a href="/programs/httpd.html">httpd</a></code> to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive crash with a segmentation fault.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </li>
fb77c505254b6e9c925e23e734463e87574f8f40kess </ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For server configurations that are vulnerable to these problems,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive you should disable memory-mapping of delivered files by specifying:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive EnableMMAP Off
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For NFS mounted files, this feature may be disabled explicitly for
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the offending files by specifying:</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Directory "/path-to-nfs-files"&gt;
fb77c505254b6e9c925e23e734463e87574f8f40kess <span class="indent">
fb77c505254b6e9c925e23e734463e87574f8f40kess EnableMMAP Off
fb77c505254b6e9c925e23e734463e87574f8f40kess </span>
4f854c24127e28f7ad72ce9a39d4448aaf910fc1slive &lt;/Directory&gt;
4f854c24127e28f7ad72ce9a39d4448aaf910fc1slive </code></p></div>
4f854c24127e28f7ad72ce9a39d4448aaf910fc1slive
4f854c24127e28f7ad72ce9a39d4448aaf910fc1slive</div>
fb77c505254b6e9c925e23e734463e87574f8f40kess<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
fb77c505254b6e9c925e23e734463e87574f8f40kess<div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directive</a></h2>
4f854c24127e28f7ad72ce9a39d4448aaf910fc1slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use the kernel sendfile support to deliver files to the client</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableSendfile Off</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.44 and later. Default changed to Off in
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveversion 2.3.9.</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>This directive controls whether <code class="program"><a href="/programs/httpd.html">httpd</a></code> may use the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd sendfile support from the kernel to transmit file contents to the client.
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess By default, when the handling of a request requires no access
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to the data within a file -- for example, when delivering a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive static file -- Apache httpd uses sendfile to deliver the file contents
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive without ever reading the file if the OS supports it.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This sendfile mechanism avoids separate read and send operations,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive and buffer allocations. But on some platforms or within some
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive filesystems, it is better to disable this feature to avoid
ef8e89e090461194ecadd31e8796a2c51e0531a2kess operational problems:</p>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess
fb109b84906e3ee61680aa289953c2f9e859354erbowen <ul>
fb109b84906e3ee61680aa289953c2f9e859354erbowen <li>Some platforms may have broken sendfile support that the build
fb109b84906e3ee61680aa289953c2f9e859354erbowen system did not detect, especially if the binaries were built on
fb109b84906e3ee61680aa289953c2f9e859354erbowen another box and moved to such a machine with broken sendfile
fb109b84906e3ee61680aa289953c2f9e859354erbowen support.</li>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <li>On Linux the use of sendfile triggers TCP-checksum
fb109b84906e3ee61680aa289953c2f9e859354erbowen offloading bugs on certain networking cards when using IPv6.</li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li>On Linux on Itanium, sendfile may be unable to handle files
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive over 2GB in size.</li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS, SMB, CIFS, FUSE),
fb109b84906e3ee61680aa289953c2f9e859354erbowen the kernel may be unable to serve the network file through
fb109b84906e3ee61680aa289953c2f9e859354erbowen its own cache.</li>
fb109b84906e3ee61680aa289953c2f9e859354erbowen </ul>
fb109b84906e3ee61680aa289953c2f9e859354erbowen
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For server configurations that are not vulnerable to these problems,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive you may enable this feature by specifying:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd EnableSendfile On
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
fb109b84906e3ee61680aa289953c2f9e859354erbowen <p>For network mounted files, this feature may be disabled explicitly
fb109b84906e3ee61680aa289953c2f9e859354erbowen for the offending files by specifying:</p>
fb109b84906e3ee61680aa289953c2f9e859354erbowen
fb109b84906e3ee61680aa289953c2f9e859354erbowen <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Directory "/path-to-nfs-files"&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive EnableSendfile Off
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/Directory&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Please note that the per-directory and .htaccess configuration
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of <code class="directive">EnableSendfile</code> is not supported by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="module"><a href="/mod/mod_disk_cache.html">mod_disk_cache</a></code>.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Only global definition of <code class="directive">EnableSendfile</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive is taken into account by the module.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </p>
003f0c9fda6664daf5092a0e42f65ede20098153slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>What the server will return to the client
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivein case of an error</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Quoting syntax for text messages is different in Apache HTTP Server
fb77c505254b6e9c925e23e734463e87574f8f40kess2.0</td></tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess</table>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>In the event of a problem or error, Apache httpd can be configured
fb77c505254b6e9c925e23e734463e87574f8f40kess to do one of four things,</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess <ol>
fb77c505254b6e9c925e23e734463e87574f8f40kess <li>output a simple hardcoded error message</li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <li>output a customized message</li>
530eba85dbd41b8a0fa5255d3648d1440199a661slive
530eba85dbd41b8a0fa5255d3648d1440199a661slive <li>redirect to a local <var>URL-path</var> to handle the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive problem/error</li>
530eba85dbd41b8a0fa5255d3648d1440199a661slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li>redirect to an external <var>URL</var> to handle the
530eba85dbd41b8a0fa5255d3648d1440199a661slive problem/error</li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </ol>
530eba85dbd41b8a0fa5255d3648d1440199a661slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The first option is the default, while options 2-4 are
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd configured using the <code class="directive">ErrorDocument</code>
530eba85dbd41b8a0fa5255d3648d1440199a661slive directive, which is followed by the HTTP response code and a URL
fb77c505254b6e9c925e23e734463e87574f8f40kess or a message. Apache httpd will sometimes offer additional information
fb77c505254b6e9c925e23e734463e87574f8f40kess regarding the problem/error.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>URLs can begin with a slash (/) for local web-paths (relative
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd to the <code class="directive"><a href="#documentroot">DocumentRoot</a></code>), or be a
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd full URL which the client can resolve. Alternatively, a message
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd can be provided to be displayed by the browser. Examples:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd ErrorDocument 401 /subscription_info.html<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd ErrorDocument 403 "Sorry can't allow you access today"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Additionally, the special value <code>default</code> can be used
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to specify Apache httpd's simple hardcoded message. While not required
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive under normal circumstances, <code>default</code> will restore
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Apache httpd's simple hardcoded message for configurations that would
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive otherwise inherit an existing <code class="directive">ErrorDocument</code>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
003f0c9fda6664daf5092a0e42f65ede20098153slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &lt;Directory /web/docs&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ErrorDocument 404 default<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
003f0c9fda6664daf5092a0e42f65ede20098153slive &lt;/Directory&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Note that when you specify an <code class="directive">ErrorDocument</code>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess that points to a remote URL (ie. anything with a method such as
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <code>http</code> in front of it), Apache HTTP Server will send a redirect to the
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess client to tell it where to find the document, even if the
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess document ends up being on the same server. This has several
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess implications, the most important being that the client will not
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess 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
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>ErrorDocument 401</code> directive then it must refer to a local
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive document.</strong></p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Microsoft Internet Explorer (MSIE) will by default ignore
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive server-generated error messages when they are "too small" and substitute
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd its own "friendly" error messages. The size threshold varies depending on
fb77c505254b6e9c925e23e734463e87574f8f40kess the type of error, but in general, if you make your error document
fb77c505254b6e9c925e23e734463e87574f8f40kess greater than 512 bytes, then MSIE will show the server-generated
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive error rather than masking it. More information is available in
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Microsoft Knowledge Base article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Although most error messages can be overriden, there are certain
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd circumstances where the internal messages are used regardless of the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd setting of <code class="directive"><a href="#errordocument">ErrorDocument</a></code>. In
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd particular, if a malformed request is detected, normal request processing
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess will be immediately halted and the internal error message returned.
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess This is necessary to guard against security problems caused by
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess bad requests.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>If you are using mod_proxy, you may wish to enable
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="/mod/mod_proxy.html#proxyerroroverride">ProxyErrorOverride</a></code> so that you can provide
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive custom error messages on behalf of your Origin servers. If you don't enable ProxyErrorOverride,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Apache httpd will not generate custom error documents for proxied content.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess<h3>See also</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><a href="/custom-error.html">documentation of
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess customizable responses</a></li>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess</ul>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location where the server will log errors</td></tr>
003f0c9fda6664daf5092a0e42f65ede20098153slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code> ErrorLog <var>file-path</var>|syslog[:<var>facility</var>]</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ErrorLog logs/error_log (Unix) ErrorLog logs/error.log (Windows and OS/2)</code></td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
003f0c9fda6664daf5092a0e42f65ede20098153slive <p>The <code class="directive">ErrorLog</code> directive sets the name of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the file to which the server will log any errors it encounters. If
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the <var>file-path</var> is not absolute then it is assumed to be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <div class="example"><h3>Example</h3><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ErrorLog /var/log/httpd/error_log
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>If the <var>file-path</var>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd begins with a pipe character "<code>|</code>" then it is assumed to be a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive command to spawn to handle the error log.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><h3>Example</h3><p><code>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess ErrorLog "|/usr/local/bin/httpd_errors"
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess </code></p></div>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>See the notes on <a href="/logs.html#piped">piped logs</a> for
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive more information.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
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
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive using the <code>syslog:<var>facility</var></code> syntax where
7654193c1faf603feec999850322ad79e6c551bcnd <var>facility</var> can be one of the names usually documented in
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive syslog(1).</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
003f0c9fda6664daf5092a0e42f65ede20098153slive <div class="example"><h3>Example</h3><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ErrorLog syslog:user
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>SECURITY: See the <a href="/misc/security_tips.html#serverroot">security tips</a>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive document for details on why your security could be compromised
fb77c505254b6e9c925e23e734463e87574f8f40kess if the directory where log files are stored is writable by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive anyone other than the user that starts the server.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="warning"><h3>Note</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>When entering a file path on non-Unix platforms, care should be taken
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd to make sure that only forward slashed are used even though the platform
fb77c505254b6e9c925e23e734463e87574f8f40kess may allow the use of back slashes. In general it is a good idea to always
fb77c505254b6e9c925e23e734463e87574f8f40kess use forward slashes throughout the configuration files.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<h3>See also</h3>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><a href="/logs.html">Apache HTTP Server Log Files</a></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
7654193c1faf603feec999850322ad79e6c551bcnd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
7654193c1faf603feec999850322ad79e6c551bcnd<div class="directive-section"><h2><a name="ErrorLogFormat" id="ErrorLogFormat">ErrorLogFormat</a> <a name="errorlogformat" id="errorlogformat">Directive</a></h2>
7654193c1faf603feec999850322ad79e6c551bcnd<table class="directive">
7654193c1faf603feec999850322ad79e6c551bcnd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Format specification for error log entries</td></tr>
7654193c1faf603feec999850322ad79e6c551bcnd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code> ErrorLog [connection|request] <var>format</var></code></td></tr>
7654193c1faf603feec999850322ad79e6c551bcnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
7654193c1faf603feec999850322ad79e6c551bcnd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
7654193c1faf603feec999850322ad79e6c551bcnd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
7654193c1faf603feec999850322ad79e6c551bcnd<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.3.9 and later</td></tr>
7654193c1faf603feec999850322ad79e6c551bcnd</table>
7654193c1faf603feec999850322ad79e6c551bcnd <p><code class="directive">ErrorLogFormat</code> allows to specify what
7654193c1faf603feec999850322ad79e6c551bcnd supplementary information is logged in the error log in addition to the
7654193c1faf603feec999850322ad79e6c551bcnd actual log message.</p>
7654193c1faf603feec999850322ad79e6c551bcnd
7654193c1faf603feec999850322ad79e6c551bcnd <div class="example"><h3>Simple example</h3><p><code>
7654193c1faf603feec999850322ad79e6c551bcnd ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"
7654193c1faf603feec999850322ad79e6c551bcnd </code></p></div>
7654193c1faf603feec999850322ad79e6c551bcnd
7654193c1faf603feec999850322ad79e6c551bcnd <p>Specifying <code>connection</code> or <code>request</code> as first
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive paramter allows to specify additional formats, causing additional
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive information to be logged when the first message is logged for a specific
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive connection or request, respectivly. This additional information is only
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive logged once per connection/request. If a connection or request is processed
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive without causing any log message, the additional information is not logged
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive either.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>It can happen that some format string items do not produce output. For
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive example, the Referer header is only present if the log message is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive associated to a request and the log message happens at a time when the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Referer header has already been read from the client. If no output is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive produced, the default behaviour is to delete everything from the preceeding
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive space character to the next space character. This means the log line is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive implicitly divided into fields on non-whitespace to whitespace transitions.
fb77c505254b6e9c925e23e734463e87574f8f40kess If a format string item does not produce output, the whole field is
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess ommitted. For example, if the remote address <code>%a</code> in the log
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive format <code>[%t] [%l] [%a] %M&nbsp;</code> is not available, the surrounding
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive brackets are not logged either. Space characters can be escaped with a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive backslash to prevent them from delimiting a field. The combination '%&nbsp;'
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive (percent space) is a zero-witdh field delimiter that does not produce any
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive output.</p>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The above behaviour can be changed by adding modifiers to the format
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive string item. A <code>-</code> (minus) modifier causes a minus to be logged if the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive respective item does not produce any output. In once-per-connection/request
fb77c505254b6e9c925e23e734463e87574f8f40kess formats, it is also possible to use the <code>+</code> (plus) modifier. If an
fb77c505254b6e9c925e23e734463e87574f8f40kess item with the plus modifier does not produce any output, the whole line is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ommitted.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>A number as modifier can be used to assign a log severity level to a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive format item. The item will only be logged if the severity of the log
fb77c505254b6e9c925e23e734463e87574f8f40kess message is not higher than the specified log severity level. The number can
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive range from 1 (alert) over 4 (warn) and 7 (debug) to 15 (trace8).</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Some format string items accept additional parameters in braces.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
fb77c505254b6e9c925e23e734463e87574f8f40kess <table class="bordered"><tr class="header"><th>Format&nbsp;String</th> <th>Description</th></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><td><code>%%</code></td>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <td>The percent sign</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr class="odd"><td><code>%...a</code></td>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <td>Remote IP-address and port</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><td><code>%...A</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Local IP-address and port</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr class="odd"><td><code>%...{name}e</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Request environment variable <code>name</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><td><code>%...E</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>APR/OS error status code and string</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr class="odd"><td><code>%...F</code></td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>Source file name and line number of the log call</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><td><code>%...{name}i</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Request header <code>name</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr class="odd"><td><code>%...k</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Number of keep-alive requests on this connection</td></tr>
003f0c9fda6664daf5092a0e42f65ede20098153slive<tr><td><code>%...l</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Loglevel of the message</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr class="odd"><td><code>%...L</code></td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>Log ID of the request</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><td><code>%...{c}L</code></td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>Log ID of the connection</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr class="odd"><td><code>%...{C}L</code></td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>Log ID of the connection if used in connection scope, empty otherwise</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><td><code>%...m</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Name of the module logging the message</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr class="odd"><td><code>%M</code></td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>The actual log message</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><td><code>%...{name}n</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Request note <code>name</code></td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr class="odd"><td><code>%...P</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Process ID of current process</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><td><code>%...T</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Thread ID of current thread</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr class="odd"><td><code>%...t</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>The current time</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><td><code>%...{u}t</code></td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>The current time including micro-seconds</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr class="odd"><td><code>%...{cu}t</code></td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>The current time in compact ISO 8601 format, including
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive micro-seconds</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><td><code>%...v</code></td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>The canonical <code class="directive"><a href="#servername">ServerName</a></code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd of the current server.</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr class="odd"><td><code>%...V</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>The server name of the server serving the request according to the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive setting.</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><td><code>\&nbsp;</code> (backslash space)</td>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <td>Non-field delimiting space</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr class="odd"><td><code>%&nbsp;</code> (percent space)</td>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <td>Field delimiter (no output)</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd</table>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>The log ID format <code>%L</code> produces a unique id for a connection
130d299c4b2b15be45532a176604c71fdc7bea5bnd or request. This can be used to correlate which log lines belong to the
130d299c4b2b15be45532a176604c71fdc7bea5bnd same connection or request, which request happens on which connection.
130d299c4b2b15be45532a176604c71fdc7bea5bnd A <code>%L</code> format string is also available in
130d299c4b2b15be45532a176604c71fdc7bea5bnd <code class="module"><a href="/mod/mod_log_config.html">mod_log_config</a></code>, to allow to correlate access log entries
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd with error log lines. If <code class="module"><a href="/mod/mod_unique_id.html">mod_unique_id</a></code> is loaded, its
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive unique id will be used as log ID for requests.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><h3>Example (somewhat similar to default format)</h3><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P] %7F: %E: [client\ %a]
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive %M%&nbsp;,\&nbsp;referer\&nbsp;%{Referer}i"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
a04a96aae08a62f2d9d5833b3313a9751fa3f680yoshiki
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><h3>Example (similar to the 2.2.x format)</h3><p><code>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a]
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive %M%&nbsp;,\&nbsp;referer\&nbsp;%{Referer}i"
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
003f0c9fda6664daf5092a0e42f65ede20098153slive <div class="example"><h3>Advanced example with request/connection log IDs</h3><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M"<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T"<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'"<br />
fb77c505254b6e9c925e23e734463e87574f8f40kess ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'"<br />
fb77c505254b6e9c925e23e734463e87574f8f40kess ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A"<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<h3>See also</h3>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<ul>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<li><code class="directive"><a href="#errorlog">ErrorLog</a></code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><a href="/logs.html">Apache HTTP Server Log Files</a></li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="ExtendedStatus" id="ExtendedStatus">ExtendedStatus</a> <a name="extendedstatus" id="extendedstatus">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Keep track of extended status information for each
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cndrequest</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ExtendedStatus On|Off</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ExtendedStatus Off[*]</code></td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>This option tracks additional data per worker about the
bea526116133aa3d7dabd1924bfc580b37fbf22aslive currently executing request, and a utilization summary; you
bea526116133aa3d7dabd1924bfc580b37fbf22aslive can see these variables during runtime by configuring
bea526116133aa3d7dabd1924bfc580b37fbf22aslive <code class="module"><a href="/mod/mod_status.html">mod_status</a></code>. Note that other modules may
bea526116133aa3d7dabd1924bfc580b37fbf22aslive rely on this scoreboard.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This setting applies to the entire server, and cannot be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive enabled or disabled on a virtualhost-by-virtualhost basis.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive The collection of extended status information can slow down
bea526116133aa3d7dabd1924bfc580b37fbf22aslive the server. Also note that this setting cannot be changed
bea526116133aa3d7dabd1924bfc580b37fbf22aslive during a graceful restart.</p>
bea526116133aa3d7dabd1924bfc580b37fbf22aslive
fb77c505254b6e9c925e23e734463e87574f8f40kess <div class="note">
bea526116133aa3d7dabd1924bfc580b37fbf22aslive <p>Note that loading <code class="module"><a href="/mod/mod_status.html">mod_status</a></code> will change
bea526116133aa3d7dabd1924bfc580b37fbf22aslive the default behavior to ExtendedStatus On, while other
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive third party modules may do the same. Such modules rely on
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive collecting detailed information about the state of all workers.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive The default is changed by <code class="module"><a href="/mod/mod_status.html">mod_status</a></code> beginning
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive with version 2.3.6; the previous default was always Off.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</div>
003f0c9fda6664daf5092a0e42f65ede20098153slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
003f0c9fda6664daf5092a0e42f65ede20098153slive<div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directive</a></h2>
003f0c9fda6664daf5092a0e42f65ede20098153slive<table class="directive">
7b5535ed88e0f561b3bfb3330137bd804846afd4slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>File attributes used to create the ETag
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveHTTP response header for static files</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive</table>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive <p>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive The <code class="directive">FileETag</code> directive configures the file
7b5535ed88e0f561b3bfb3330137bd804846afd4slive attributes that are used to create the <code>ETag</code> (entity
7b5535ed88e0f561b3bfb3330137bd804846afd4slive tag) response header field when the document is based on a static file.
7b5535ed88e0f561b3bfb3330137bd804846afd4slive (The <code>ETag</code> value is used in cache management to save
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive network bandwidth.) The
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <code class="directive">FileETag</code> directive allows you to choose
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess which of these -- if any -- should be used. The recognized keywords are:
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dl>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dt><strong>INode</strong></dt>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <dd>The file's i-node number will be included in the calculation</dd>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive <dt><strong>MTime</strong></dt>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive <dd>The date and time the file was last modified will be included</dd>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <dt><strong>Size</strong></dt>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <dd>The number of bytes in the file will be included</dd>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive <dt><strong>All</strong></dt>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive <dd>All available fields will be used. This is equivalent to:
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <dt><strong>None</strong></dt>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <dd>If a document is file-based, no <code>ETag</code> field will be
7b5535ed88e0f561b3bfb3330137bd804846afd4slive included in the response</dd>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </dl>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
7b5535ed88e0f561b3bfb3330137bd804846afd4slive <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive 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
7b5535ed88e0f561b3bfb3330137bd804846afd4slive <p>If a directory's configuration includes
7b5535ed88e0f561b3bfb3330137bd804846afd4slive <code>FileETag&nbsp;INode&nbsp;MTime&nbsp;Size</code>, and a
7b5535ed88e0f561b3bfb3330137bd804846afd4slive subdirectory's includes <code>FileETag&nbsp;-INode</code>,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd the setting for that subdirectory (which will be inherited by
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd any sub-subdirectories that don't override it) will be equivalent to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>FileETag&nbsp;MTime&nbsp;Size</code>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="warning"><h3>Warning</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Do not change the default for directories or locations that have WebDAV
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive enabled and use <code class="module"><a href="/mod/mod_dav_fs.html">mod_dav_fs</a></code> as a storage provider.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="module"><a href="/mod/mod_dav_fs.html">mod_dav_fs</a></code> uses <code>INode&nbsp;MTime&nbsp;Size</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive as a fixed format for <code>ETag</code> comparisons on conditional requests.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive These conditional requests will break if the <code>ETag</code> format is
003f0c9fda6664daf5092a0e42f65ede20098153slive changed via <code class="directive">FileETag</code>.
fb77c505254b6e9c925e23e734463e87574f8f40kess </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="note"><h3>Server Side Includes</h3>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele An ETag is not generated for responses parsed by <code class="module"><a href="/mod/mod_include.html">mod_include</a></code>,
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele since the response entity can change without a change of the INode, MTime, or Size
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of the static file with embedded SSI directives.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="Files" id="Files">&lt;Files&gt;</a> <a name="files" id="files">Directive</a></h2>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<table class="directive">
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to matched
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivefilenames</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Files <var>filename</var>&gt; ... &lt;/Files&gt;</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">&lt;Files&gt;</code> directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive limits the scope of the enclosed directives by filename. It is comparable
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive and <code class="directive"><a href="#location">&lt;Location&gt;</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directives. It should be matched with a <code>&lt;/Files&gt;</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive. The directives given within this section will be applied to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive any object with a basename (last component of filename) matching the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive specified filename. <code class="directive">&lt;Files&gt;</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive sections are processed in the order they appear in the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive configuration file, after the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location">&lt;Location&gt;</a></code> sections. Note
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive that <code class="directive">&lt;Files&gt;</code> can be nested
003f0c9fda6664daf5092a0e42f65ede20098153slive inside <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections to restrict the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive portion of the filesystem they apply to.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <var>filename</var> argument should include a filename, or
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele a wild-card string, where <code>?</code> matches any single character,
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele and <code>*</code> matches any sequences of characters.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <a class="glossarylink" href="/glossary.html#regex" title="see glossary">Regular expressions</a>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive can also be used, with the addition of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>~</code> character. For example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Files ~ "\.(gif|jpe?g|png)$"&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch">&lt;FilesMatch&gt;</a></code> is preferred,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive however.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Note that unlike <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> and <code class="directive"><a href="#location">&lt;Location&gt;</a></code> sections, <code class="directive">&lt;Files&gt;</code> sections can be used inside
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>.htaccess</code> files. This allows users to control access to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive their own files, at a file-by-file level.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
003f0c9fda6664daf5092a0e42f65ede20098153slive<h3>See also</h3>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<ul>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<li><a href="/sections.html">How &lt;Directory&gt;, &lt;Location&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive and &lt;Files&gt; sections work</a> for an explanation of how these
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive different sections are combined when a request is received</li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
003f0c9fda6664daf5092a0e42f65ede20098153slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch">&lt;FilesMatch&gt;</a> <a name="filesmatch" id="filesmatch">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to regular-expression matched
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivefilenames</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;FilesMatch <var>regex</var>&gt; ... &lt;/FilesMatch&gt;</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">&lt;FilesMatch&gt;</code> directive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess limits the scope of the enclosed directives by filename, just as the
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <code class="directive"><a href="#files">&lt;Files&gt;</a></code> directive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess does. However, it accepts a <a class="glossarylink" href="/glossary.html#regex" title="see glossary">regular
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess expression</a>. For example:</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
130d299c4b2b15be45532a176604c71fdc7bea5bnd &lt;FilesMatch "\.(gif|jpe?g|png)$"&gt;
130d299c4b2b15be45532a176604c71fdc7bea5bnd </code></p></div>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>would match most common Internet graphics formats.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd<h3>See also</h3>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<ul>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<li><a href="/sections.html">How &lt;Directory&gt;, &lt;Location&gt;
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd and &lt;Files&gt; sections work</a> for an explanation of how these
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd different sections are combined when a request is received</li>
6c5c651b0b97607b8c8b4965c1385c67699f217fnd</ul>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directive</a></h2>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<table class="directive">
6c5c651b0b97607b8c8b4965c1385c67699f217fnd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be served with the specified
6c5c651b0b97607b8c8b4965c1385c67699f217fndmedia type in the HTTP Content-Type header field</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForceType <var>media-type</var>|None</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved to the core in Apache httpd 2.0</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess</table>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>When placed into an <code>.htaccess</code> file or a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>, or
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#location">&lt;Location&gt;</a></code> or
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#files">&lt;Files&gt;</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive section, this directive forces all matching files to be served
003f0c9fda6664daf5092a0e42f65ede20098153slive with the content type identification given by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <var>media-type</var>. For example, if you had a directory full of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive GIF files, but did not want to label them all with <code>.gif</code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive you might want to use:</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <div class="example"><p><code>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess ForceType image/gif
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Note that this directive overrides other indirect media type
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive associations defined in mime.types or via the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="/mod/mod_mime.html#addtype">AddType</a></code>.</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <p>You can also override more general
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <code class="directive">ForceType</code> settings
130d299c4b2b15be45532a176604c71fdc7bea5bnd by using the value of <code>None</code>:</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <div class="example"><p><code>
130d299c4b2b15be45532a176604c71fdc7bea5bnd # force all files to be image/gif:<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd &lt;Location /images&gt;<br />
130d299c4b2b15be45532a176604c71fdc7bea5bnd <span class="indent">
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen ForceType image/gif<br />
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen </span>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/Location&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive # but normal mime-type associations here:<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Location /images/mixed&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive ForceType None<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &lt;/Location&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive primarily overrides the content types generated for
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive static files served out of the filesystem. For resources other than
003f0c9fda6664daf5092a0e42f65ede20098153slive static files, where the generator of the response typically specifies
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive a Content-Type, this directive has no effect.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>HostnameLookups Off</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
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>).
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess The value <code>Double</code> refers to doing double-reverse
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess DNS lookup. That is, after a reverse lookup is performed, a forward
fb77c505254b6e9c925e23e734463e87574f8f40kess lookup is then performed on that result. At least one of the IP
fb77c505254b6e9c925e23e734463e87574f8f40kess addresses in the forward lookup must match the original
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive address. (In "tcpwrappers" terminology this is called
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>PARANOID</code>.)</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Regardless of the setting, when <code class="module"><a href="/mod/mod_authz_host.html">mod_authz_host</a></code> is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive used for controlling access by hostname, a double reverse lookup
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen will be performed. This is necessary for security. Note that the
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen result of this double-reverse isn't generally available unless you
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess set <code>HostnameLookups Double</code>. For example, if only
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <code>HostnameLookups On</code> and a request is made to an object
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen that is protected by hostname restrictions, regardless of whether
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen the double-reverse fails or not, CGIs will still be passed the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd single-reverse result in <code>REMOTE_HOST</code>.</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <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
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>Off</code>, since DNS lookups can take considerable
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess amounts of time. The utility <code class="program"><a href="/programs/logresolve.html">logresolve</a></code>, compiled by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive default to the <code>bin</code> subdirectory of your installation
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd directory, can be used to look up host names from logged IP addresses
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive offline.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="directive-section"><h2><a name="If" id="If">&lt;If&gt;</a> <a name="if" id="if">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply only if a condition is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivesatisfied by a request at runtime</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;If <var>expression</var>&gt; ... &lt;/If&gt;</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">&lt;If&gt;</code> directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive evaluates an expression at runtime, and applies the enclosed
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directives if and only if the expression evaluates to true.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive For example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;If "$req{Host} = ''"&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>would match HTTP/1.0 requests without a <var>Host:</var> header.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>You may compare the value of any variable in the request headers
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen ($req), response headers ($resp) or environment ($env) in your
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen expression.</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <p>Apart from <code>=</code>, <code>If</code> can use the <code>IN</code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd operator to compare if the expression is in a given range:</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;If %{REQUEST_METHOD} IN GET,HEAD,OPTIONS&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<h3>See also</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><a href="/sections.html">How &lt;Directory&gt;, &lt;Location&gt;,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &lt;Files&gt; sections work</a> for an explanation of how these
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive different sections are combined when a request is received.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive">&lt;If&gt;</code> has the same precedence
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive and usage as <code class="directive">&lt;Files&gt;</code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="IfDefine" id="IfDefine">&lt;IfDefine&gt;</a> <a name="ifdefine" id="ifdefine">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that will be processed only
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveif a test is true at startup</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;IfDefine [!]<var>parameter-name</var>&gt; ...
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/IfDefine&gt;</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code>&lt;IfDefine <var>test</var>&gt;...&lt;/IfDefine&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code> section is used to mark directives that are conditional. The
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directives within an <code class="directive">&lt;IfDefine&gt;</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive section are only processed if the <var>test</var> is true. If <var>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive test</var> is false, everything between the start and end markers is
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen ignored.</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <p>The <var>test</var> in the <code class="directive">&lt;IfDefine&gt;</code> section directive can be one of two forms:</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <ul>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <li><var>parameter-name</var></li>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <li><code>!</code><var>parameter-name</var></li>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen </ul>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <p>In the former case, the directives between the start and end
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive markers are only processed if the parameter named
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <var>parameter-name</var> is defined. The second format reverses
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the test, and only processes the directives if
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <var>parameter-name</var> is <strong>not</strong> defined.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <var>parameter-name</var> argument is a define as given on the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="program"><a href="/programs/httpd.html">httpd</a></code> command line via <code>-D<var>parameter</var>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code> at the time the server was started or by the <code class="directive"><a href="#define">Define</a></code> directive.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><code class="directive">&lt;IfDefine&gt;</code> sections are
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive nest-able, which can be used to implement simple
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive multiple-parameter tests. Example:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive httpd -DReverseProxy -DUseCache -DMemCache ...<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive # httpd.conf<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;IfDefine ReverseProxy&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive LoadModule proxy_module modules/mod_proxy.so<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive LoadModule proxy_http_module modules/mod_proxy_http.so<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;IfDefine UseCache&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive LoadModule cache_module modules/mod_cache.so<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;IfDefine MemCache&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
fb77c505254b6e9c925e23e734463e87574f8f40kess LoadModule mem_cache_module modules/mod_mem_cache.so<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/IfDefine&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;IfDefine !MemCache&gt;<br />
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <span class="indent">
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen LoadModule disk_cache_module modules/mod_disk_cache.so<br />
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen </span>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen &lt;/IfDefine&gt;
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen </span>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess &lt;/IfDefine&gt;
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen </span>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen &lt;/IfDefine&gt;
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen </code></p></div>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="IfModule" id="IfModule">&lt;IfModule&gt;</a> <a name="ifmodule" id="ifmodule">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that are processed conditional on the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivepresence or absence of a specific module</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;IfModule [!]<var>module-file</var>|<var>module-identifier</var>&gt; ...
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/IfModule&gt;</code></td></tr>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Module identifiers are available in version 2.1 and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivelater.</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <p>The <code>&lt;IfModule <var>test</var>&gt;...&lt;/IfModule&gt;</code>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen section is used to mark directives that are conditional on the presence of
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen a specific module. The directives within an <code class="directive">&lt;IfModule&gt;</code> section are only processed if the <var>test</var>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen is true. If <var>test</var> is false, everything between the start and
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd end markers is ignored.</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <p>The <var>test</var> in the <code class="directive">&lt;IfModule&gt;</code> section directive can be one of two forms:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li><var>module</var></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li>!<var>module</var></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>In the former case, the directives between the start and end
fb77c505254b6e9c925e23e734463e87574f8f40kess markers are only processed if the module named <var>module</var>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive is included in Apache httpd -- either compiled in or
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive dynamically loaded using <code class="directive"><a href="/mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive and only processes the directives if <var>module</var> is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <strong>not</strong> included.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <p>The <var>module</var> argument can be either the module identifier or
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the file name of the module, at the time it was compiled. For example,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>rewrite_module</code> is the identifier and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>mod_rewrite.c</code> is the file name. If a module consists of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive several source files, use the name of the file containing the string
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>STANDARD20_MODULE_STUFF</code>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><code class="directive">&lt;IfModule&gt;</code> sections are
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive nest-able, which can be used to implement simple multiple-module
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive tests.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <div class="note">This section should only be used if you need to have one
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess configuration file that works whether or not a specific module
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess is available. In normal operation, directives need not be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive placed in <code class="directive">&lt;IfModule&gt;</code>
dc223428958ad9ff05011545bcdda000887b93e5slive sections.</div>
dc223428958ad9ff05011545bcdda000887b93e5slive
dc223428958ad9ff05011545bcdda000887b93e5slive</div>
dc223428958ad9ff05011545bcdda000887b93e5slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Includes other configuration files from within
313bb560bc5c323cfd40c9cad7335b4b8e060aedkessthe server configuration files</td></tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Include [<var>optional</var>|<var>strict</var>] <var>file-path</var>|<var>directory-path</var>|<var>wildcard</var></code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Wildcard matching available in 2.0.41 and later, directory
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivewildcard matching available in 2.3.6 and later</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</table>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>This directive allows inclusion of other configuration files
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd from within the server configuration files.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used
fb77c505254b6e9c925e23e734463e87574f8f40kess in the filename or directory parts of the path to include several files
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess at once, in alphabetical order. In addition, if
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <code class="directive">Include</code> points to a directory, rather than a file,
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess Apache httpd will read all files in that directory and any subdirectory.
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess However, including entire directories is not recommended, because it is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive easy to accidentally leave temporary files in a directory that can cause
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="program"><a href="/programs/httpd.html">httpd</a></code> to fail. Instead, we encourage you to use the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive wildcard syntax shown below, to include files that match a particular
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive pattern, such as *.conf, for example.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>When a wildcard is specified for a <strong>file</strong> component of
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd the path, and no file matches the wildcard, the
130d299c4b2b15be45532a176604c71fdc7bea5bnd <code class="directive"><a href="#include">Include</a></code>
130d299c4b2b15be45532a176604c71fdc7bea5bnd directive will be <strong>silently ignored</strong>. When a wildcard is
130d299c4b2b15be45532a176604c71fdc7bea5bnd specified for a <strong>directory</strong> component of the path, and
130d299c4b2b15be45532a176604c71fdc7bea5bnd no directory matches the wildcard, the
130d299c4b2b15be45532a176604c71fdc7bea5bnd <code class="directive"><a href="#include">Include</a></code> directive will
130d299c4b2b15be45532a176604c71fdc7bea5bnd <strong>fail with an error</strong> saying the directory cannot be found.
130d299c4b2b15be45532a176604c71fdc7bea5bnd </p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>For further control over the behaviour of the server when no files or
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd directories match, prefix the path with the modifiers <var>optional</var>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd or <var>strict</var>. If <var>optional</var> is specified, any wildcard
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd file or directory that does not match will be silently ignored. If
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <var>strict</var> is specified, any wildcard file or directory that does
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd not match at least one file will cause server startup to fail.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
05201775eaa6b363b8a119c8aea5db246b967591yoshiki <p>When a directory or file component of the path is
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd specified exactly, and that directory or file does not exist,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code class="directive"><a href="#include">Include</a></code> directive will fail with an
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd error saying the file or directory cannot be found.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The file path specified may be an absolute path, or may be relative
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess to the <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Examples:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Include /usr/local/apache2/conf/ssl.conf<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Include /usr/local/apache2/conf/vhosts/*.conf
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess Include conf/ssl.conf<br />
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess Include conf/vhosts/*.conf
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Wildcards may be included in the directory or file portion of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive path. In the following example, the server will fail to load if no
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directories match conf/vhosts/*, but will load successfully if no
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess files match *.conf.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
8490b2f9f6469d5089163f6dd303d9a81f8e908ctrawick Include conf/vhosts/*/vhost.conf<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Include conf/vhosts/*/*.conf
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>In this example, the server will fail to load if either
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive conf/vhosts/* matches no directories, or if *.conf matches no files:</p>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Include strict conf/vhosts/*/*.conf
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>In this example, the server load successfully if either conf/vhosts/*
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd matches no directories, or if *.conf matches no files:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Include optional conf/vhosts/*/*.conf
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<h3>See also</h3>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<ul>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<li><code class="program"><a href="/programs/apachectl.html">apachectl</a></code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="KeepAlive" id="KeepAlive">KeepAlive</a> <a name="keepalive" id="keepalive">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables HTTP persistent connections</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAlive On|Off</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAlive On</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
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
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd 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
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen many images. To enable Keep-Alive connections, set
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>KeepAlive On</code>.</p>
530eba85dbd41b8a0fa5255d3648d1440199a661slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For HTTP/1.0 clients, Keep-Alive connections will only be
530eba85dbd41b8a0fa5255d3648d1440199a661slive used if they are specifically requested by a client. In
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive addition, a Keep-Alive connection with an HTTP/1.0 client can
530eba85dbd41b8a0fa5255d3648d1440199a661slive 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
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>When a client uses a Keep-Alive connection it will be counted
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive as a single "request" for the <code class="directive"><a href="/mod/mpm_common.html#maxconnectionsperchild">MaxConnectionsPerChild</a></code> directive, regardless
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of how many requests are sent using the connection.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<h3>See also</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><code class="directive"><a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="KeepAliveTimeout" id="KeepAliveTimeout">KeepAliveTimeout</a> <a name="keepalivetimeout" id="keepalivetimeout">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for subsequent
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliverequests on a persistent connection</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAliveTimeout <var>num</var>[ms]</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAliveTimeout 5</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Specifying a value in milliseconds is available in
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveApache httpd 2.3.2 and later</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The number of seconds Apache httpd will wait for a subsequent
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request before closing the connection. By adding a postfix of ms the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive timeout can be also set in milliseconds. Once a request has been
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive received, the timeout value specified by the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#timeout">Timeout</a></code> directive applies.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Setting <code class="directive">KeepAliveTimeout</code> 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
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>In a name-based virtual host context, the value of the first
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive defined virtual host (the default host) in a set of <code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code> will be used.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive The other values will be ignored.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="Limit" id="Limit">&lt;Limit&gt;</a> <a name="limit" id="limit">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict enclosed access controls to only certain HTTP
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivemethods</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Limit <var>method</var> [<var>method</var>] ... &gt; ...
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/Limit&gt;</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig, Limit</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
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
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive">&lt;Limit&gt;</code> section.</strong></p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The purpose of the <code class="directive">&lt;Limit&gt;</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive is to restrict the effect of the access controls to the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive nominated HTTP methods. For all other methods, the access
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive restrictions that are enclosed in the <code class="directive">&lt;Limit&gt;</code> bracket <strong>will have no
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive effect</strong>. The following example applies the access control
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive only to the methods <code>POST</code>, <code>PUT</code>, and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>DELETE</code>, leaving all other methods unprotected:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Limit POST PUT DELETE&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Require valid-user<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/Limit&gt;
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen </code></p></div>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <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>CONNECT</code>, <code>OPTIONS</code>,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive case-sensitive.</strong> If <code>GET</code> is used it will also
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive restrict <code>HEAD</code> requests. The <code>TRACE</code> method
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive cannot be limited (see <code class="directive"><a href="#traceenable">TraceEnable</a></code>).</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="warning">A <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> section should always be
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd used in preference to a <code class="directive">&lt;Limit&gt;</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive section when restricting access, since a <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> section provides protection
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele against arbitrary methods.</div>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">&lt;Limit&gt;</code> and
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directives may be nested. In this case, each successive level of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive">&lt;Limit&gt;</code> or <code class="directive"><a href="#limitexcept">&lt;LimitExcept&gt;</a></code> directives must
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive further restrict the set of methods to which access controls apply.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="warning">When using
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive">&lt;Limit&gt;</code> or
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <code class="directive">&lt;LimitExcept&gt;</code> directives with
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen the <code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code> directive,
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen note that the first <code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd to succeed authorizes the request, regardless of the presence of other
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code> directives.</div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For example, given the following configuration, all users will
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive be authorized for <code>POST</code> requests, and the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>Require group editors</code> directive will be ignored
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive in all cases:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
003f0c9fda6664daf5092a0e42f65ede20098153slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;LimitExcept GET&gt;
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Require valid-user
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/LimitExcept&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Limit POST&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Require group editors
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &lt;/Limit&gt;
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="directive-section"><h2><a name="LimitExcept" id="LimitExcept">&lt;LimitExcept&gt;</a> <a name="limitexcept" id="limitexcept">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict access controls to all HTTP methods
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveexcept the named ones</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;LimitExcept <var>method</var> [<var>method</var>] ... &gt; ...
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/LimitExcept&gt;</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig, Limit</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><code class="directive">&lt;LimitExcept&gt;</code> and
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <code>&lt;/LimitExcept&gt;</code> are used to enclose
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess a group of access control directives which will then apply to any
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess HTTP access method <strong>not</strong> listed in the arguments;
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess i.e., it is the opposite of a <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code> section and can be used to control
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess both standard and nonstandard/unrecognized methods. See the
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess documentation for <code class="directive"><a href="#limit">&lt;Limit&gt;</a></code> for more details.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>For example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &lt;LimitExcept POST GET&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Require valid-user<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </span>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &lt;/LimitExcept&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
fb77c505254b6e9c925e23e734463e87574f8f40kess</div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="directive-section"><h2><a name="LimitInternalRecursion" id="LimitInternalRecursion">LimitInternalRecursion</a> <a name="limitinternalrecursion" id="limitinternalrecursion">Directive</a></h2>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine maximum number of internal redirects and nested
52bb691f8e13e9d0b55fcc214018ee85846fa87frbowensubrequests</td></tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitInternalRecursion <var>number</var> [<var>number</var>]</code></td></tr>
52bb691f8e13e9d0b55fcc214018ee85846fa87frbowen<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitInternalRecursion 10</code></td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
52bb691f8e13e9d0b55fcc214018ee85846fa87frbowen<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.0.47 and later</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess</table>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>An internal redirect happens, for example, when using the <code class="directive"><a href="/mod/mod_actions.html#action">Action</a></code> directive, which internally
fb77c505254b6e9c925e23e734463e87574f8f40kess redirects the original request to a CGI script. A subrequest is Apache httpd's
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess mechanism to find out what would happen for some URI if it were requested.
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd For example, <code class="module"><a href="/mod/mod_dir.html">mod_dir</a></code> uses subrequests to look for the
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd files listed in the <code class="directive"><a href="/mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd directive.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p><code class="directive">LimitInternalRecursion</code> prevents the server
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd from crashing when entering an infinite loop of internal redirects or
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd subrequests. Such loops are usually caused by misconfigurations.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>The directive stores two different limits, which are evaluated on
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd per-request basis. The first <var>number</var> is the maximum number of
3386d67e54f92fdf6a3ffc5f7f8081eed6c44badslive internal redirects, that may follow each other. The second <var>number</var>
3386d67e54f92fdf6a3ffc5f7f8081eed6c44badslive determines, how deep subrequests may be nested. If you specify only one
05201775eaa6b363b8a119c8aea5db246b967591yoshiki <var>number</var>, it will be assigned to both limits.</p>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <div class="example"><h3>Example</h3><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive LimitInternalRecursion 5
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="LimitRequestBody" id="LimitRequestBody">LimitRequestBody</a> <a name="limitrequestbody" id="limitrequestbody">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restricts the total size of the HTTP request body sent
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivefrom the client</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestBody <var>bytes</var></code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestBody 0</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive specifies the number of <var>bytes</var> from 0
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive (meaning unlimited) to 2147483647 (2GB) that are allowed in a
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd request body.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">LimitRequestBody</code> 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
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess (server, per-directory, per-file or per-location). If the client
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request exceeds that limit, the server will return an error
fb77c505254b6e9c925e23e734463e87574f8f40kess 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.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Implementations of the <code>PUT</code> method will require
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive a value at least as large as any representation that the server
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive wishes to accept for that resource.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <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>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>If, for example, you are permitting file upload to a particular
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd location, and wish to limit the size of the uploaded file to 100K,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd you might use the following directive:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd LimitRequestBody 102400
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="LimitRequestFields" id="LimitRequestFields">LimitRequestFields</a> <a name="limitrequestfields" id="limitrequestfields">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of HTTP request header fields that
313bb560bc5c323cfd40c9cad7335b4b8e060aedkesswill be accepted from the client</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFields <var>number</var></code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFields 100</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess</table>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p><var>Number</var> is an integer from 0 (meaning unlimited) to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive 32767. The default value is defined by the compile-time
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive distributed).</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">LimitRequestFields</code> directive allows
fb77c505254b6e9c925e23e734463e87574f8f40kess the server administrator to modify the limit on the number of
fb77c505254b6e9c925e23e734463e87574f8f40kess request header fields allowed in an HTTP request. A server needs
fb77c505254b6e9c925e23e734463e87574f8f40kess this value to be larger than the number of fields that a normal
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive client request might include. The number of request header fields
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess 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
fb77c505254b6e9c925e23e734463e87574f8f40kess using request header fields.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <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>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive LimitRequestFields 50
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess</div>
fb77c505254b6e9c925e23e734463e87574f8f40kess<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
fb77c505254b6e9c925e23e734463e87574f8f40kess<div class="directive-section"><h2><a name="LimitRequestFieldSize" id="LimitRequestFieldSize">LimitRequestFieldSize</a> <a name="limitrequestfieldsize" id="limitrequestfieldsize">Directive</a></h2>
fb77c505254b6e9c925e23e734463e87574f8f40kess<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of the HTTP request header allowed from the
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveclient</td></tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFieldSize <var>bytes</var></code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFieldSize 8190</code></td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd</table>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>This directive specifies the number of <var>bytes</var>
130d299c4b2b15be45532a176604c71fdc7bea5bnd that will be allowed in an HTTP request header.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>The <code class="directive">LimitRequestFieldSize</code> directive
130d299c4b2b15be45532a176604c71fdc7bea5bnd allows the server administrator to reduce or increase the limit
130d299c4b2b15be45532a176604c71fdc7bea5bnd on the allowed size of an HTTP request header field. A server
130d299c4b2b15be45532a176604c71fdc7bea5bnd needs this value to be large enough to hold any one header field
130d299c4b2b15be45532a176604c71fdc7bea5bnd from a normal client request. The size of a normal request header
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd field will vary greatly among different client implementations,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive often depending upon the extent to which a user has configured
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive their browser to support detailed content negotiation. SPNEGO
fb77c505254b6e9c925e23e734463e87574f8f40kess authentication headers can be up to 12392 bytes.</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess <p>This directive gives the server administrator greater
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive control over abnormal client request behavior, which may be
130d299c4b2b15be45532a176604c71fdc7bea5bnd useful for avoiding some forms of denial-of-service attacks.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>For example:</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <div class="example"><p><code>
130d299c4b2b15be45532a176604c71fdc7bea5bnd LimitRequestFieldSize 4094
130d299c4b2b15be45532a176604c71fdc7bea5bnd </code></p></div>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <div class="note">Under normal conditions, the value should not be changed from
130d299c4b2b15be45532a176604c71fdc7bea5bnd the default.</div>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="LimitRequestLine" id="LimitRequestLine">LimitRequestLine</a> <a name="limitrequestline" id="limitrequestline">Directive</a></h2>
fb77c505254b6e9c925e23e734463e87574f8f40kess<table class="directive">
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limit the size of the HTTP request line that will be accepted
fb77c505254b6e9c925e23e734463e87574f8f40kessfrom the client</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestLine <var>bytes</var></code></td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestLine 8190</code></td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This directive sets the number of <var>bytes</var> that will be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive allowed on the HTTP request-line.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">LimitRequestLine</code> directive allows
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the server administrator to reduce or increase the limit on the allowed size
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of a client's HTTP request-line. Since the request-line consists of the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive HTTP method, URI, and protocol version, the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive">LimitRequestLine</code> directive places a
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess restriction on the length of a request-URI allowed for a request
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd on the server. A server needs this value to be large enough to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive hold any of its resource names, including any information that
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive might be passed in the query part of a <code>GET</code> request.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
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.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For example:</p>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <div class="example"><p><code>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess LimitRequestLine 4094
ef8e89e090461194ecadd31e8796a2c51e0531a2kess </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <div class="note">Under normal conditions, the value should not be changed from
ef8e89e090461194ecadd31e8796a2c51e0531a2kess the default.</div>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<div class="directive-section"><h2><a name="LimitXMLRequestBody" id="LimitXMLRequestBody">LimitXMLRequestBody</a> <a name="limitxmlrequestbody" id="limitxmlrequestbody">Directive</a></h2>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of an XML-based request body</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitXMLRequestBody <var>bytes</var></code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitXMLRequestBody 1000000</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <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>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd LimitXMLRequestBody 0
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="Location" id="Location">&lt;Location&gt;</a> <a name="location" id="location">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to matching
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveURLs</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;Location
9ed9eaf871c58d281af02e76125ceadb5060afa5nd <var>URL-path</var>|<var>URL</var>&gt; ... &lt;/Location&gt;</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">&lt;Location&gt;</code> directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive limits the scope of the enclosed directives by URL. It is similar to the
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive, and starts a subsection which is terminated with a
530eba85dbd41b8a0fa5255d3648d1440199a661slive <code>&lt;/Location&gt;</code> directive. <code class="directive">&lt;Location&gt;</code> sections are processed in the
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele order they appear in the configuration file, after the <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections and
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele <code>.htaccess</code> files are read, and after the <code class="directive"><a href="#files">&lt;Files&gt;</a></code> sections.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p><code class="directive">&lt;Location&gt;</code> sections operate
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive completely outside the filesystem. This has several consequences.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Most importantly, <code class="directive">&lt;Location&gt;</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directives should not be used to control access to filesystem
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd locations. Since several different URLs may map to the same
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive filesystem location, such access controls may by circumvented.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <div class="note"><h3>When to use <code class="directive">&lt;Location&gt;</code></h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Use <code class="directive">&lt;Location&gt;</code> to apply
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directives to content that lives outside the filesystem. For
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive content that lives in the filesystem, use <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> and <code class="directive"><a href="#files">&lt;Files&gt;</a></code>. An exception is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>&lt;Location /&gt;</code>, which is an easy way to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive apply a configuration to the entire server.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For all origin (non-proxy) requests, the URL to be matched is a
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive URL-path of the form <code>/path/</code>. <em>No scheme, hostname,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive port, or query string may be included.</em> For proxy requests, the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive URL to be matched is of the form
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>scheme://servername/path</code>, and you must include the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive prefix.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive any single character, and <code>*</code> matches any sequences of
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive characters. Neither wildcard character matches a / in the URL-path.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <p><a class="glossarylink" href="/glossary.html#regex" title="see glossary">Regular expressions</a>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive can also be used, with the addition of the <code>~</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive character. For example:</p>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Location ~ "/(extra|special)/data"&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>would match URLs that contained the substring <code>/extra/data</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive or <code>/special/data</code>. The directive <code class="directive"><a href="#locationmatch">&lt;LocationMatch&gt;</a></code> behaves
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd identical to the regex version of <code class="directive">&lt;Location&gt;</code>, and is preferred, for the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive simple reason that <code>~</code> is hard to distinguish from
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>-</code> in many fonts.</p>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">&lt;Location&gt;</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive functionality is especially useful when combined with the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#sethandler">SetHandler</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive. For example, to enable status requests, but allow them
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive only from browsers at <code>example.com</code>, you might use:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Location /status&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <span class="indent">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive SetHandler server-status<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Order Deny,Allow<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Deny from all<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Allow from .example.com<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </span>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/Location&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <div class="note"><h3>Note about / (slash)</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <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
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive where multiple adjacent slashes are frequently collapsed to a single
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele <code>/home/foo</code>). In URL-space this is not necessarily true.
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele The <code class="directive"><a href="#locationmatch">&lt;LocationMatch&gt;</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive and the regex version of <code class="directive">&lt;Location&gt;</code> require you to explicitly specify multiple
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive slashes if that is your intention.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For example, <code>&lt;LocationMatch ^/abc&gt;</code> would match
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the request URL <code>/abc</code> but not the request URL <code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive //abc</code>. The (non-regex) <code class="directive">&lt;Location&gt;</code> directive behaves similarly when used for
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive proxy requests. But when (non-regex) <code class="directive">&lt;Location&gt;</code> is used for non-proxy requests it will
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive implicitly match multiple slashes with a single slash. For example,
ef8e89e090461194ecadd31e8796a2c51e0531a2kess if you specify <code>&lt;Location /abc/def&gt;</code> and the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive request is to <code>/abc//def</code> then it will match.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<h3>See also</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><a href="/sections.html">How &lt;Directory&gt;, &lt;Location&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive and &lt;Files&gt; sections work</a> for an explanation of how these
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive different sections are combined when a request is received.</li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<li><code class="directive"><a href="#locationmatch">LocationMatch</a></code></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</ul>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess</div>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<div class="directive-section"><h2><a name="LocationMatch" id="LocationMatch">&lt;LocationMatch&gt;</a> <a name="locationmatch" id="locationmatch">Directive</a></h2>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<table class="directive">
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to regular-expression
313bb560bc5c323cfd40c9cad7335b4b8e060aedkessmatching URLs</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;LocationMatch
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <var>regex</var>&gt; ... &lt;/LocationMatch&gt;</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">&lt;LocationMatch&gt;</code> directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive limits the scope of the enclosed directives by URL, in an identical manner
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to <code class="directive"><a href="#location">&lt;Location&gt;</a></code>. However,
fb77c505254b6e9c925e23e734463e87574f8f40kess it takes a <a class="glossarylink" href="/glossary.html#regex" title="see glossary">regular expression</a>
003f0c9fda6664daf5092a0e42f65ede20098153slive as an argument instead of a simple string. For example:</p>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;LocationMatch "/(extra|special)/data"&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
003f0c9fda6664daf5092a0e42f65ede20098153slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>would match URLs that contained the substring <code>/extra/data</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive or <code>/special/data</code>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
9ed9eaf871c58d281af02e76125ceadb5060afa5nd<h3>See also</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<ul>
fb77c505254b6e9c925e23e734463e87574f8f40kess<li><a href="/sections.html">How &lt;Directory&gt;, &lt;Location&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive and &lt;Files&gt; sections work</a> for an explanation of how these
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive different sections are combined when a request is received</li>
fb77c505254b6e9c925e23e734463e87574f8f40kess</ul>
fb77c505254b6e9c925e23e734463e87574f8f40kess</div>
fb77c505254b6e9c925e23e734463e87574f8f40kess<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="LogLevel" id="LogLevel">LogLevel</a> <a name="loglevel" id="loglevel">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls the verbosity of the ErrorLog</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LogLevel [<var>module</var>:]<var>level</var>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen [<var>module</var>:<var>level</var>] ...
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen</code></td></tr>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LogLevel warn</code></td></tr>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Per-module and per-directory configuration is available in
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd Apache HTTP Server 2.3.6 and later</td></tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</table>
fb77c505254b6e9c925e23e734463e87574f8f40kess <p><code class="directive">LogLevel</code> adjusts the verbosity of the
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen messages recorded in the error logs (see <code class="directive"><a href="#errorlog">ErrorLog</a></code> directive). The following
fb77c505254b6e9c925e23e734463e87574f8f40kess <var>level</var>s are available, in order of decreasing
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive significance:</p>
9ed9eaf871c58d281af02e76125ceadb5060afa5nd
d3f27ec18dfa6283e852aa98253212edafaa0e2brbowen <table class="bordered">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <th><strong>Level</strong> </th>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
fb77c505254b6e9c925e23e734463e87574f8f40kess <th><strong>Description</strong> </th>
003f0c9fda6664daf5092a0e42f65ede20098153slive
fb77c505254b6e9c925e23e734463e87574f8f40kess <th><strong>Example</strong> </th>
fb77c505254b6e9c925e23e734463e87574f8f40kess </tr>
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele
18b4b0fd6056093002ddef488636bf5ebe415ef0erikabele <tr>
003f0c9fda6664daf5092a0e42f65ede20098153slive <td><code>emerg</code> </td>
fb77c505254b6e9c925e23e734463e87574f8f40kess
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <td>Emergencies - system is unusable.</td>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"Child cannot open lock file. Exiting"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess <td><code>alert</code> </td>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess <td>Action must be taken immediately.</td>
fb77c505254b6e9c925e23e734463e87574f8f40kess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"getpwuid: couldn't determine user name from uid"</td>
fb77c505254b6e9c925e23e734463e87574f8f40kess </tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess
fb77c505254b6e9c925e23e734463e87574f8f40kess <tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess <td><code>crit</code> </td>
fb77c505254b6e9c925e23e734463e87574f8f40kess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Critical Conditions.</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"socket: Failed to get a socket, exiting child"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
003f0c9fda6664daf5092a0e42f65ede20098153slive <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>error</code> </td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Error conditions.</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"Premature end of script headers"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>warn</code> </td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>Warning conditions.</td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>"child process 1234 did not exit, sending another
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd SIGHUP"</td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>notice</code> </td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Normal but significant condition.</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"httpd: caught SIGBUS, attempting to dump core in
003f0c9fda6664daf5092a0e42f65ede20098153slive ..."</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>info</code> </td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Informational.</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"Server seems busy, (you may need to increase
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive StartServers, or Min/MaxSpareServers)..."</td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td><code>debug</code> </td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>Debug-level messages</td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"Opening config file ..."</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>trace1</code> </td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Trace messages</td>
003f0c9fda6664daf5092a0e42f65ede20098153slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"proxy: FTP: control connection complete"</td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>trace2</code> </td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Trace messages</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"proxy: CONNECT: sending the CONNECT request to the remote proxy"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>trace3</code> </td>
fb77c505254b6e9c925e23e734463e87574f8f40kess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Trace messages</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"openssl: Handshake: start"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td><code>trace4</code> </td>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <td>Trace messages</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"read from buffered SSL brigade, mode 0, 17 bytes"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>trace5</code> </td>
fb77c505254b6e9c925e23e734463e87574f8f40kess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Trace messages</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"map lookup FAILED: map=rewritemap key=keyname"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>trace6</code> </td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Trace messages</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"cache lookup FAILED, forcing new map lookup"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>trace7</code> </td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Trace messages, dumping large amounts of data</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"| 0000: 02 23 44 30 13 40 ac 34 df 3d bf 9a 19 49 39 15 |"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <tr>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <td><code>trace8</code> </td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>Trace messages, dumping large amounts of data</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>"| 0000: 02 23 44 30 13 40 ac 34 df 3d bf 9a 19 49 39 15 |"</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>When a particular level is specified, messages from all
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive other levels of higher significance will be reported as well.
fb77c505254b6e9c925e23e734463e87574f8f40kess <em>E.g.</em>, when <code>LogLevel info</code> is specified,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive then messages with log levels of <code>notice</code> and
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <code>warn</code> will also be posted.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Using a level of at least <code>crit</code> is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive recommended.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>For example:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive LogLevel notice
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="note"><h3>Note</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>When logging to a regular file messages of the level
003f0c9fda6664daf5092a0e42f65ede20098153slive <code>notice</code> cannot be suppressed and thus are always
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd logged. However, this doesn't apply when logging is done
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive using <code>syslog</code>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Specifying a level without a module name will reset the level
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive for all modules to that level. Specifying a level with a module
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive name will set the level for that module only. It is possible to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive use the module source file name, the module identifier, or the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive module identifier with the trailing <code>_module</code> omitted
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive as module specification. This means the following three specifications
58e56a1d61ae176cc5ecb7c4863881736947d8b8rbowen are equivalent:</p>
58e56a1d61ae176cc5ecb7c4863881736947d8b8rbowen
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="example"><p><code>
58e56a1d61ae176cc5ecb7c4863881736947d8b8rbowen LogLevel info ssl:warn<br />
58e56a1d61ae176cc5ecb7c4863881736947d8b8rbowen LogLevel info mod_ssl.c:warn<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive LogLevel info ssl_module:warn<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>It is also possible to change the level per directory:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive LogLevel info<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;Directory /usr/local/apache/htdocs/app&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &nbsp; LogLevel debug<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/Files&gt;
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="note">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive Per directory loglevel configuration only affects messages that are
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive logged after the request has been parsed and that are associated with
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the request. Log messages which are associated with the connection or
003f0c9fda6664daf5092a0e42f65ede20098153slive the server are not affected.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
fb77c505254b6e9c925e23e734463e87574f8f40kess<div class="directive-section"><h2><a name="MaxKeepAliveRequests" id="MaxKeepAliveRequests">MaxKeepAliveRequests</a> <a name="maxkeepaliverequests" id="maxkeepaliverequests">Directive</a></h2>
fb77c505254b6e9c925e23e734463e87574f8f40kess<table class="directive">
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of requests allowed on a persistent
fb77c505254b6e9c925e23e734463e87574f8f40kessconnection</td></tr>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxKeepAliveRequests <var>number</var></code></td></tr>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxKeepAliveRequests 100</code></td></tr>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
530eba85dbd41b8a0fa5255d3648d1440199a661slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">MaxKeepAliveRequests</code> directive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive limits the number of requests allowed per connection when
530eba85dbd41b8a0fa5255d3648d1440199a661slive <code class="directive"><a href="#keepalive">KeepAlive</a></code> is on. If it is
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive 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>
23b36269d124e7a6aaa5221891f7ae2ef3eeb158jerenkrantz
23b36269d124e7a6aaa5221891f7ae2ef3eeb158jerenkrantz <p>For example:</p>
7b5535ed88e0f561b3bfb3330137bd804846afd4slive
7b5535ed88e0f561b3bfb3330137bd804846afd4slive <div class="example"><p><code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive MaxKeepAliveRequests 500
f35c904c3b359610a46e94fbb4ba8495b2338521slive </code></p></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="Mutex" id="Mutex">Mutex</a> <a name="mutex" id="mutex">Directive</a></h2>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<table class="directive">
ef8e89e090461194ecadd31e8796a2c51e0531a2kess<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures mutex mechanism and lock file directory for all
fb77c505254b6e9c925e23e734463e87574f8f40kessor specified mutexes</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Mutex <var>mechanism</var> [default|<var>mutex-name</var>] ... [OmitPID]</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Mutex default</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
530eba85dbd41b8a0fa5255d3648d1440199a661slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache HTTP Server 2.3.4 and later</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive</table>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">Mutex</code> directive sets the mechanism,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive and optionally the lock file location, that httpd and modules use
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive to serialize access to resources. Specify <code>default</code> as
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the first argument to change the settings for all mutexes; specify
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive a mutex name (see table below) as the first argument to override
530eba85dbd41b8a0fa5255d3648d1440199a661slive defaults only for that mutex.</p>
530eba85dbd41b8a0fa5255d3648d1440199a661slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The <code class="directive">Mutex</code> directive is typically used in
cf1595220a90759be0a39ab8b11c8cb834b698a9ianh the following exceptional situations:</p>
cf1595220a90759be0a39ab8b11c8cb834b698a9ianh
cf1595220a90759be0a39ab8b11c8cb834b698a9ianh <ul>
cf1595220a90759be0a39ab8b11c8cb834b698a9ianh <li>change the mutex mechanism when the default mechanism selected
cf1595220a90759be0a39ab8b11c8cb834b698a9ianh by <a class="glossarylink" href="/glossary.html#apr" title="see glossary">APR</a> has a functional or performance
cf1595220a90759be0a39ab8b11c8cb834b698a9ianh problem</li>
1a1cf0ee9229ee29e5750b25dd94dbb9b04072cfianh
1a1cf0ee9229ee29e5750b25dd94dbb9b04072cfianh <li>change the directory used by file-based mutexes when the
1a1cf0ee9229ee29e5750b25dd94dbb9b04072cfianh default directory does not support locking</li>
1a1cf0ee9229ee29e5750b25dd94dbb9b04072cfianh </ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="note"><h3>Supported modules</h3>
530eba85dbd41b8a0fa5255d3648d1440199a661slive <p>This directive only configures mutexes which have been registered
1a1cf0ee9229ee29e5750b25dd94dbb9b04072cfianh with the core server using the <code>ap_mutex_register()</code> API.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive All modules bundled with httpd support the <code class="directive">Mutex</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directive, but third-party modules may not. Consult the documentation
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive of the third-party module, which must indicate the mutex name(s) which
1a1cf0ee9229ee29e5750b25dd94dbb9b04072cfianh can be configured if this directive is supported.</p>
530eba85dbd41b8a0fa5255d3648d1440199a661slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The following mutex <em>mechanisms</em> are available:</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <ul>
1a1cf0ee9229ee29e5750b25dd94dbb9b04072cfianh <li><code>default | yes</code>
1a1cf0ee9229ee29e5750b25dd94dbb9b04072cfianh <p>This selects the default locking implementation, as determined by
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <a class="glossarylink" href="/glossary.html#apr" title="see glossary">APR</a>. The default locking implementation can
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive be displayed by running <code class="program"><a href="/programs/httpd.html">httpd</a></code> with the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>-V</code> option.</p></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
23b36269d124e7a6aaa5221891f7ae2ef3eeb158jerenkrantz <li><code>none | no</code>
23b36269d124e7a6aaa5221891f7ae2ef3eeb158jerenkrantz <p>This effectively disables the mutex, and is only allowed for a
7b5535ed88e0f561b3bfb3330137bd804846afd4slive mutex if the module indicates that it is a valid choice. Consult the
7b5535ed88e0f561b3bfb3330137bd804846afd4slive module documentation for more information.</p></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
f35c904c3b359610a46e94fbb4ba8495b2338521slive <li><code>posixsem</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This is a mutex variant based on a Posix semaphore.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="warning"><h3>Warning</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The semaphore ownership is not recovered if a thread in the process
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive holding the mutex segfaults, resulting in a hang of the web server.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
fb77c505254b6e9c925e23e734463e87574f8f40kess </li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li><code>sysvsem</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This is a mutex variant based on a SystemV IPC semaphore.</p>
003f0c9fda6664daf5092a0e42f65ede20098153slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="warning"><h3>Warning</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>It is possible to "leak" SysV semaphores if processes crash
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive before the semaphore is removed.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="warning"><h3>Security</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>The semaphore API allows for a denial of service attack by any
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive CGIs running under the same uid as the webserver (<em>i.e.</em>,
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd all CGIs, unless you use something like <code class="program"><a href="/programs/suexec.html">suexec</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive or <code>cgiwrapper</code>).</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </li>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <li><code>sem</code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>This selects the "best" available semaphore implementation, choosing
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd between Posix and SystemV IPC semaphores, in that order.</p></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li><code>pthread</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This is a mutex variant based on cross-process Posix thread
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive mutexes.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
db1b819ff8966e3c6a5ca03c59a8ae06c2cecc9frbowen <div class="warning"><h3>Warning</h3>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>On most systems, if a child process terminates abnormally while
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd holding a mutex that uses this implementation, the server will deadlock
130d299c4b2b15be45532a176604c71fdc7bea5bnd and stop responding to requests. When this occurs, the server will
130d299c4b2b15be45532a176604c71fdc7bea5bnd require a manual restart to recover.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>Solaris is a notable exception as it provides a mechanism which
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd usually allows the mutex to be recovered after a child process
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd terminates abnormally while holding a mutex.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>If your system implements the
db1b819ff8966e3c6a5ca03c59a8ae06c2cecc9frbowen <code>pthread_mutexattr_setrobust_np()</code> function, you may be able
db1b819ff8966e3c6a5ca03c59a8ae06c2cecc9frbowen to use the <code>pthread</code> option safely.</p>
db1b819ff8966e3c6a5ca03c59a8ae06c2cecc9frbowen </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li><code>fcntl:/path/to/mutex</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This is a mutex variant where a physical (lock-)file and the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>fcntl()</code> function are used as the mutex.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <div class="warning"><h3>Warning</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>When multiple mutexes based on this mechanism are used within
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive multi-threaded, multi-process environments, deadlock errors (EDEADLK)
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive can be reported for valid mutex operations if <code>fcntl()</code>
003f0c9fda6664daf5092a0e42f65ede20098153slive is not thread-aware, such as on Solaris.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li><code>flock:/path/to/mutex</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This is similar to the <code>fcntl:/path/to/mutex</code> method
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive with the exception that the <code>flock()</code> function is used to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive provide file locking.</p></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <li><code>file:/path/to/mutex</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>This selects the "best" available file locking implementation,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive choosing between <code>fcntl</code> and <code>flock</code>, in that
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive order.</p></li>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </ul>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Most mechanisms are only available on selected platforms, where the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive underlying platform and <a class="glossarylink" href="/glossary.html#apr" title="see glossary">APR</a> support it. Mechanisms
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive which aren't available on all platforms are <em>posixsem</em>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <em>sysvsem</em>, <em>sem</em>, <em>pthread</em>, <em>fcntl</em>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <em>flock</em>, and <em>file</em>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>With the file-based mechanisms <em>fcntl</em> and <em>flock</em>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive the path, if provided, is a directory where the lock file will be created.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive The default directory is httpd's run-time file directory relative to
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code class="directive"><a href="#serverroot">ServerRoot</a></code>. Always use a local disk
003f0c9fda6664daf5092a0e42f65ede20098153slive filesystem for <code>/path/to/mutex</code> and never a directory residing
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive on a NFS- or AFS-filesystem. The basename of the file will be the mutex
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive type, an optional instance string provided by the module, and unless the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>OmitPID</code> keyword is specified, the process id of the httpd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive parent process will be appended to to make the file name unique, avoiding
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive conflicts when multiple httpd instances share a lock file directory. For
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive example, if the mutex name is <code>mpm-accept</code> and the lock file
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive directory is <code>/var/httpd/locks</code>, the lock file name for the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive httpd instance with parent process id 12345 would be
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <code>/var/httpd/locks/mpm-accept.12345</code>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="warning"><h3>Security</h3>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>It is best to <em>avoid</em> putting mutex files in a world-writable
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd directory such as <code>/var/tmp</code> because someone could create
130d299c4b2b15be45532a176604c71fdc7bea5bnd a denial of service attack and prevent the server from starting by
130d299c4b2b15be45532a176604c71fdc7bea5bnd creating a lockfile with the same name as the one the server will try
130d299c4b2b15be45532a176604c71fdc7bea5bnd to create.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd </div>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>The following table documents the names of mutexes used by httpd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd and bundled modules.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <table class="bordered"><tr class="header">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <th>Mutex name</th>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <th>Module(s)</th>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <th>Protected resource</th>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>mpm-accept</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code class="module"><a href="/mod/prefork.html">prefork</a></code> and <code class="module"><a href="/mod/worker.html">worker</a></code> MPMs</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>incoming connections, to avoid the thundering herd problem;
003f0c9fda6664daf5092a0e42f65ede20098153slive for more information, refer to the
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <a href="/misc/perf-tuning.html">performance tuning</a>
6b64034fa2a644ba291c484c0c01c7df5b8d982ckess documentation</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr class="odd">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>authdigest-client</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code class="module"><a href="/mod/mod_auth_digest.html">mod_auth_digest</a></code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>client list in shared memory</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>authdigest-opaque</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code class="module"><a href="/mod/mod_auth_digest.html">mod_auth_digest</a></code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>counter in shared memory</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr class="odd">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>ldap-cache</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code class="module"><a href="/mod/mod_ldap.html">mod_ldap</a></code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>LDAP result cache</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <td><code>rewrite-map</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code class="module"><a href="/mod/mod_rewrite.html">mod_rewrite</a></code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>communication with external mapping programs, to avoid
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive intermixed I/O from multiple requests</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr class="odd">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>ssl-cache</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code class="module"><a href="/mod/mod_ssl.html">mod_ssl</a></code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>SSL session cache</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>ssl-stapling</code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code class="module"><a href="/mod/mod_ssl.html">mod_ssl</a></code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>OCSP stapling response cache</td>
fb77c505254b6e9c925e23e734463e87574f8f40kess </tr>
fb77c505254b6e9c925e23e734463e87574f8f40kess<tr class="odd">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td><code>watchdog-callback</code></td>
003f0c9fda6664daf5092a0e42f65ede20098153slive <td><code class="module"><a href="/mod/mod_watchdog.html">mod_watchdog</a></code></td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <td>callback function of a particular client module</td>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </tr>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd</table>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>The <code>OmitPID</code> keyword suppresses the addition of the httpd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd parent process id from the lock file name.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd <p>In the following example, the mutex mechanism for the MPM accept
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd mutex will be changed from the compiled-in default to <code>fcntl</code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive with the associated lock file created in directory
fb77c505254b6e9c925e23e734463e87574f8f40kess <code>/var/httpd/locks</code>. The mutex mechanism for all other mutexes
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive will be changed from the compiled-in default to <code>sysvsem</code>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen <div class="example"><p><code>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess Mutex default sysvsem<br />
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen Mutex mpm-accept fcntl:/var/httpd/locks
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess </code></p></div>
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen</div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<div class="directive-section"><h2><a name="NameVirtualHost" id="NameVirtualHost">NameVirtualHost</a> <a name="namevirtualhost" id="namevirtualhost">Directive</a></h2>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Designates an IP address for name-virtual
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivehosting</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NameVirtualHost <var>addr</var>[:<var>port</var>]</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen</table>
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowen<p>A single <code class="directive">NameVirtualHost</code> directive
3c6c63407f1855ddfc45ac69b69a2a9bf15135e6rbowenidentifies a set of identical virtual hosts on which the server will
fb77c505254b6e9c925e23e734463e87574f8f40kessfurther select from on the basis of the <em>hostname</em>
fb77c505254b6e9c925e23e734463e87574f8f40kessrequested by the client. The <code class="directive">NameVirtualHost</code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivedirective is a required directive if you want to configure
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<a href="/vhosts/">name-based virtual hosts</a>.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<p>This directive, and the corresponding <code class="directive">VirtualHost</code>,
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<em>must</em> be qualified with a port number if the server supports both HTTP
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveand HTTPS connections.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<p>Although <var>addr</var> can be a hostname, it is recommended
313bb560bc5c323cfd40c9cad7335b4b8e060aedkessthat you always use an IP address or a wildcard. A wildcard
130d299c4b2b15be45532a176604c71fdc7bea5bndNameVirtualHost matches only virtualhosts that also have a literal wildcard
130d299c4b2b15be45532a176604c71fdc7bea5bndas their argument.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd<p>In cases where a firewall or other proxy receives the requests and
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveforwards them on a different IP address to the server, you must specify the
130d299c4b2b15be45532a176604c71fdc7bea5bndIP address of the physical interface on the machine which will be
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveservicing the requests. </p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<p> In the example below, requests received on interface 192.0.2.1 and port 80
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivewill only select among the first two virtual hosts. Requests received on
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveport 80 on any other interface will only select among the third and fourth
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivevirtual hosts. In the common case where the interface isn't important
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveto the mapping, only the "*:80" NameVirtualHost and VirtualHost directives
80c4526970a11f37c0f8e3b82afdf03902dac3f3sliveare necessary.</p>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd NameVirtualHost 192.0.2.1:80<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive NameVirtualHost *:80<br /><br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;VirtualHost 192.0.2.1:80&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &nbsp; ServerName namebased-a.example.com<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/VirtualHost&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <br />
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive &lt;VirtualHost 192.0.2.1:80&gt;<br />
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive &nbsp; Servername namebased-b.example.com<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/VirtualHost&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;VirtualHost *:80&gt;<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &nbsp; ServerName namebased-c.example.com <br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/VirtualHost&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <br />
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive &lt;VirtualHost *:80&gt;<br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &nbsp; ServerName namebased-d.example.com <br />
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive &lt;/VirtualHost&gt;<br />
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive <br />
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive
fb77c505254b6e9c925e23e734463e87574f8f40kess </code></p></div>
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive <p>If no matching virtual host is found, then the first listed
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive virtual host that matches the IP address and port will be used.</p>
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <p>IPv6 addresses must be enclosed in square brackets, as shown
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd in the following example:</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <div class="example"><p><code>
130d299c4b2b15be45532a176604c71fdc7bea5bnd NameVirtualHost [2001:db8::a00:20ff:fea7:ccea]:8080
130d299c4b2b15be45532a176604c71fdc7bea5bnd </code></p></div>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <div class="note"><h3>Argument to <code class="directive">&lt;VirtualHost&gt;</code>
130d299c4b2b15be45532a176604c71fdc7bea5bnd directive</h3>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>Note that the argument to the <code class="directive">&lt;VirtualHost&gt;</code> directive must
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd exactly match the argument to the <code class="directive">NameVirtualHost</code> directive.</p>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="example"><p><code>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess NameVirtualHost 192.0.2.2:80<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &lt;VirtualHost 192.0.2.2:80&gt;<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd # ...<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd &lt;/VirtualHost&gt;<br />
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </code></p></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd </div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd<h3>See also</h3>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<ul>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<li><a href="/vhosts/">Virtual Hosts
130d299c4b2b15be45532a176604c71fdc7bea5bnddocumentation</a></li>
130d299c4b2b15be45532a176604c71fdc7bea5bnd</ul>
130d299c4b2b15be45532a176604c71fdc7bea5bnd</div>
130d299c4b2b15be45532a176604c71fdc7bea5bnd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
a7f40ca49262952d6dd69d021cf5b0c2b452ae4cnd<div class="directive-section"><h2><a name="Options" id="Options">Options</a> <a name="options" id="options">Directive</a></h2>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<table class="directive">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures what features are available in a particular
80c4526970a11f37c0f8e3b82afdf03902dac3f3slivedirectory</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Options
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Options All</code></td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
130d299c4b2b15be45532a176604c71fdc7bea5bnd</table>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>The <code class="directive">Options</code> directive controls which
fb77c505254b6e9c925e23e734463e87574f8f40kess server features are available in a particular directory.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p><var>option</var> can be set to <code>None</code>, in which
130d299c4b2b15be45532a176604c71fdc7bea5bnd case none of the extra features are enabled, or one or more of
130d299c4b2b15be45532a176604c71fdc7bea5bnd the following:</p>
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive <dl>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dt><code>All</code></dt>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
fb77c505254b6e9c925e23e734463e87574f8f40kess <dd>All options except for <code>MultiViews</code>. This is the default
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive setting.</dd>
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive <dt><code>ExecCGI</code></dt>
506ccad87840d0f348a9b9560b711f0a8398ce6aslive
fb77c505254b6e9c925e23e734463e87574f8f40kess <dd>
fb77c505254b6e9c925e23e734463e87574f8f40kess Execution of CGI scripts using <code class="module"><a href="/mod/mod_cgi.html">mod_cgi</a></code>
a23acbbd61b9565caecea9931b6bcdf0b6228cbbslive is permitted.</dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dt><code>FollowSymLinks</code></dt>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dd>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive The server will follow symbolic links in this directory.
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <div class="note">
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Even though the server follows the symlink it does <em>not</em>
130d299c4b2b15be45532a176604c71fdc7bea5bnd change the pathname used to match against <code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> sections.</p>
130d299c4b2b15be45532a176604c71fdc7bea5bnd <p>Note also, that this option <strong>gets ignored</strong> if set
130d299c4b2b15be45532a176604c71fdc7bea5bnd inside a <code class="directive"><a href="#location">&lt;Location&gt;</a></code>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive section.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <p>Omitting this option should not be considered a security restriction,
130d299c4b2b15be45532a176604c71fdc7bea5bnd since symlink testing is subject to race conditions that make it
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive circumventable.</p>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive </div></dd>
ef8e89e090461194ecadd31e8796a2c51e0531a2kess
ef8e89e090461194ecadd31e8796a2c51e0531a2kess <dt><code>Includes</code></dt>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dd>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess Server-side includes provided by <code class="module"><a href="/mod/mod_include.html">mod_include</a></code>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess are permitted.</dd>
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive <dt><code>IncludesNOEXEC</code></dt>
80c4526970a11f37c0f8e3b82afdf03902dac3f3slive
313bb560bc5c323cfd40c9cad7335b4b8e060aedkess <dd>
Server-side includes are permitted, but the <code>#exec
cmd</code> and <code>#exec cgi</code> are disabled. It is still
possible to <code>#include virtual</code> CGI scripts from
<code class="directive"><a href="/mod/mod_alias.html#scriptalias">ScriptAlias</a></code>ed
directories.</dd>
<dt><code>Indexes</code></dt>
<dd>
If a URL which maps to a directory is requested, and there
is no <code class="directive"><a href="/mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
(<em>e.g.</em>, <code>index.html</code>) in that directory, then
<code class="module"><a href="/mod/mod_autoindex.html">mod_autoindex</a></code> will return a formatted listing
of the directory.</dd>
<dt><code>MultiViews</code></dt>
<dd>
<a href="/content-negotiation.html">Content negotiated</a>
"MultiViews" are allowed using
<code class="module"><a href="/mod/mod_negotiation.html">mod_negotiation</a></code>.</dd>
<dt><code>SymLinksIfOwnerMatch</code></dt>
<dd>The server will only follow symbolic links for which the
target file or directory is owned by the same user id as the
link.
<div class="note"><h3>Note</h3> <p>This option gets ignored if
set inside a <code class="directive"><a href="#location">&lt;Location&gt;</a></code> section.</p>
<p>This option should not be considered a security restriction,
since symlink testing is subject to race conditions that make it
circumventable.</p></div>
</dd>
</dl>
<p>Normally, if multiple <code class="directive">Options</code> could
apply to a directory, then the most specific one is used and
others are ignored; the options are not merged. (See <a href="/sections.html#mergin">how sections are merged</a>.)
However if <em>all</em> the options on the
<code class="directive">Options</code> directive are preceded by a
<code>+</code> or <code>-</code> symbol, the options are
merged. Any options preceded by a <code>+</code> are added to the
options currently in force, and any options preceded by a
<code>-</code> are removed from the options currently in
force. </p>
<div class="warning"><h3>Warning</h3>
<p>Mixing <code class="directive">Options</code> with a <code>+</code> or
<code>-</code> with those without is not valid syntax, and is likely
to cause unexpected results.</p>
</div>
<p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
<div class="example"><p><code>
&lt;Directory /web/docs&gt;<br />
<span class="indent">
Options Indexes FollowSymLinks<br />
</span>
&lt;/Directory&gt;<br />
<br />
&lt;Directory /web/docs/spec&gt;<br />
<span class="indent">
Options Includes<br />
</span>
&lt;/Directory&gt;
</code></p></div>
<p>then only <code>Includes</code> will be set for the
<code>/web/docs/spec</code> directory. However if the second
<code class="directive">Options</code> directive uses the <code>+</code> and
<code>-</code> symbols:</p>
<div class="example"><p><code>
&lt;Directory /web/docs&gt;<br />
<span class="indent">
Options Indexes FollowSymLinks<br />
</span>
&lt;/Directory&gt;<br />
<br />
&lt;Directory /web/docs/spec&gt;<br />
<span class="indent">
Options +Includes -Indexes<br />
</span>
&lt;/Directory&gt;
</code></p></div>
<p>then the options <code>FollowSymLinks</code> and
<code>Includes</code> are set for the <code>/web/docs/spec</code>
directory.</p>
<div class="note"><h3>Note</h3>
<p>Using <code>-IncludesNOEXEC</code> or
<code>-Includes</code> disables server-side includes completely
regardless of the previous setting.</p>
</div>
<p>The default in the absence of any other settings is
<code>All</code>.</p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RLimitCPU" id="RLimitCPU">RLimitCPU</a> <a name="rlimitcpu" id="rlimitcpu">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the CPU consumption of processes launched
by Apache httpd children</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RLimitCPU <var>seconds</var>|max [<var>seconds</var>|max]</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>Takes 1 or 2 parameters. The first parameter sets the soft
resource limit for all processes and the second parameter sets
the maximum resource limit. Either parameter can be a number,
or <code>max</code> to indicate to the server that the limit should
be set to the maximum allowed by the operating system
configuration. Raising the maximum resource limit requires that
the server is running as <code>root</code>, or in the initial startup
phase.</p>
<p>This applies to processes forked off from Apache httpd children
servicing requests, not the Apache httpd children themselves. This
includes CGI scripts and SSI exec commands, but not any
processes forked off from the Apache httpd parent such as piped
logs.</p>
<p>CPU resource limits are expressed in seconds per
process.</p>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
<li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RLimitMEM" id="RLimitMEM">RLimitMEM</a> <a name="rlimitmem" id="rlimitmem">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the memory consumption of processes launched
by Apache httpd children</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RLimitMEM <var>bytes</var>|max [<var>bytes</var>|max]</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>Takes 1 or 2 parameters. The first parameter sets the soft
resource limit for all processes and the second parameter sets
the maximum resource limit. Either parameter can be a number,
or <code>max</code> to indicate to the server that the limit should
be set to the maximum allowed by the operating system
configuration. Raising the maximum resource limit requires that
the server is running as <code>root</code>, or in the initial startup
phase.</p>
<p>This applies to processes forked off from Apache httpd children
servicing requests, not the Apache httpd children themselves. This
includes CGI scripts and SSI exec commands, but not any
processes forked off from the Apache httpd parent such as piped
logs.</p>
<p>Memory resource limits are expressed in bytes per
process.</p>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
<li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="RLimitNPROC" id="RLimitNPROC">RLimitNPROC</a> <a name="rlimitnproc" id="rlimitnproc">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of processes that can be launched by
processes launched by Apache httpd children</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>RLimitNPROC <var>number</var>|max [<var>number</var>|max]</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>Takes 1 or 2 parameters. The first parameter sets the soft
resource limit for all processes and the second parameter sets
the maximum resource limit. Either parameter can be a number,
or <code>max</code> to indicate to the server that the limit
should be set to the maximum allowed by the operating system
configuration. Raising the maximum resource limit requires that
the server is running as <code>root</code>, or in the initial startup
phase.</p>
<p>This applies to processes forked off from Apache httpd children
servicing requests, not the Apache httpd children themselves. This
includes CGI scripts and SSI exec commands, but not any
processes forked off from the Apache httpd parent such as piped
logs.</p>
<p>Process limits control the number of processes per user.</p>
<div class="note"><h3>Note</h3>
<p>If CGI processes are <strong>not</strong> running
under user ids other than the web server user id, this directive
will limit the number of processes that the server itself can
create. Evidence of this situation will be indicated by
<strong><code>cannot fork</code></strong> messages in the
<code>error_log</code>.</p>
</div>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
<li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ScriptInterpreterSource" id="ScriptInterpreterSource">ScriptInterpreterSource</a> <a name="scriptinterpretersource" id="scriptinterpretersource">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
scripts</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScriptInterpreterSource Registry|Registry-Strict|Script</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ScriptInterpreterSource Script</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Win32 only;
option <code>Registry-Strict</code> is available in Apache HTTP Server 2.0 and
later</td></tr>
</table>
<p>This directive is used to control how Apache httpd finds the
interpreter used to run CGI scripts. The default setting is
<code>Script</code>. This causes Apache httpd to use the interpreter pointed to
by the shebang line (first line, starting with <code>#!</code>) in the
script. On Win32 systems this line usually looks like:</p>
<div class="example"><p><code>
#!C:/Perl/bin/perl.exe
</code></p></div>
<p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
<div class="example"><p><code>
#!perl
</code></p></div>
<p>Setting <code>ScriptInterpreterSource Registry</code> will
cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
searched using the script file extension (e.g., <code>.pl</code>) as a
search key. The command defined by the registry subkey
<code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
<code>Shell\Open\Command</code> is used to open the script file. If the
registry keys cannot be found, Apache httpd falls back to the behavior of the
<code>Script</code> option.</p>
<div class="warning"><h3>Security</h3>
<p>Be careful when using <code>ScriptInterpreterSource
Registry</code> with <code class="directive"><a href="/mod/mod_alias.html#scriptalias">ScriptAlias</a></code>'ed directories, because
Apache httpd will try to execute <strong>every</strong> file within this
directory. The <code>Registry</code> setting may cause undesired
program calls on files which are typically not executed. For
example, the default open command on <code>.htm</code> files on
most Windows systems will execute Microsoft Internet Explorer, so
any HTTP request for an <code>.htm</code> file existing within the
script directory would start the browser in the background on the
server. This is a good way to crash your system within a minute or
so.</p>
</div>
<p>The option <code>Registry-Strict</code> which is new in Apache HTTP Server
2.0 does the same thing as <code>Registry</code> but uses only the
subkey <code>Shell\ExecCGI\Command</code>. The
<code>ExecCGI</code> key is not a common one. It must be
configured manually in the windows registry and hence prevents
accidental program calls on your system.</p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="SeeRequestTail" id="SeeRequestTail">SeeRequestTail</a> <a name="seerequesttail" id="seerequesttail">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine if mod_status displays the first 63 characters
of a request or the last 63, assuming the request itself is greater than
63 chars.</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SeeRequestTail On|Off</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>SeeRequestTail Off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache httpd 2.2.7 and later.</td></tr>
</table>
<p>mod_status with <code>ExtendedStatus On</code>
displays the actual request being handled.
For historical purposes, only 63 characters of the request
are actually stored for display purposes. This directive
controls whether the 1st 63 characters are stored (the previous
behavior and the default) or if the last 63 characters are. This
is only applicable, of course, if the length of the request is
64 characters or greater.</p>
<p>If Apache httpd is handling <code>GET&nbsp;/disk1/storage/apache/htdocs/images/imagestore1/food/apples.jpg&nbsp;HTTP/1.1</code> mod_status displays as follows:
</p>
<table class="bordered">
<tr>
<th>Off (default)</th>
<td>GET&nbsp;/disk1/storage/apache/htdocs/images/imagestore1/food/apples</td>
</tr>
<tr>
<th>On</th>
<td>orage/apache/htdocs/images/imagestore1/food/apples.jpg&nbsp;HTTP/1.1</td>
</tr>
</table>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ServerAdmin" id="ServerAdmin">ServerAdmin</a> <a name="serveradmin" id="serveradmin">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Email address that the server includes in error
messages sent to the client</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAdmin <var>email-address</var>|<var>URL</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>The <code class="directive">ServerAdmin</code> sets the contact address
that the server includes in any error messages it returns to the
client. If the <code>httpd</code> doesn't recognize the supplied argument
as an URL, it
assumes, that it's an <var>email-address</var> and prepends it with
<code>mailto:</code> in hyperlink targets. However, it's recommended to
actually use an email address, since there are a lot of CGI scripts that
make that assumption. If you want to use an URL, it should point to another
server under your control. Otherwise users may not be able to contact you in
case of errors.</p>
<p>It may be worth setting up a dedicated address for this, e.g.</p>
<div class="example"><p><code>
ServerAdmin www-admin@foo.example.com
</code></p></div>
<p>as users do not always mention that they are talking about the
server!</p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ServerAlias" id="ServerAlias">ServerAlias</a> <a name="serveralias" id="serveralias">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate names for a host used when matching requests
to name-virtual hosts</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>The <code class="directive">ServerAlias</code> directive sets the
alternate names for a host, for use with <a href="/vhosts/name-based.html">name-based virtual hosts</a>. The
<code class="directive">ServerAlias</code> may include wildcards, if appropriate.</p>
<div class="example"><p><code>
&lt;VirtualHost *:80&gt;<br />
ServerName server.domain.com<br />
ServerAlias server server2.domain.com server2<br />
ServerAlias *.example.com<br />
UseCanonicalName Off<br />
# ...<br />
&lt;/VirtualHost&gt;
</code></p></div>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
<li><a href="/vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ServerName" id="ServerName">ServerName</a> <a name="servername" id="servername">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hostname and port that the server uses to identify
itself</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerName [<var>scheme</var>://]<var>fully-qualified-domain-name</var>[:<var>port</var>]</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>The <code class="directive">ServerName</code> directive sets the
request scheme, hostname and
port that the server uses to identify itself. This is used when
creating redirection URLs.</p>
<p>Additionally, <code class="directive">ServerName</code> is used (possibly
in conjunction with <code class="directive">ServerAlias</code>) to uniquely
identify a virtual host, when using <a href="/vhosts/name-based.html">name-based virtual hosts</a>.</p>
<p>For example, if the name of the
machine hosting the web server is <code>simple.example.com</code>,
but the machine also has the DNS alias <code>www.example.com</code>
and you wish the web server to be so identified, the following
directive should be used:</p>
<div class="example"><p><code>
ServerName www.example.com:80
</code></p></div>
<p>The <code class="directive">ServerName</code> directive
may appear anywhere within the definition of a server. However,
each appearance overrides the previous appearance (within that
server).</p>
<p>If no <code class="directive">ServerName</code> is specified, then the
server attempts to deduce the hostname by performing a reverse
lookup on the IP address. If no port is specified in the
<code class="directive">ServerName</code>, then the server will use the
port from the incoming request. For optimal reliability and
predictability, you should specify an explicit hostname and port
using the <code class="directive">ServerName</code> directive.</p>
<p>If you are using <a href="/vhosts/name-based.html">name-based virtual hosts</a>,
the <code class="directive">ServerName</code> inside a
<code class="directive"><a href="#virtualhost">&lt;VirtualHost&gt;</a></code>
section specifies what hostname must appear in the request's
<code>Host:</code> header to match this virtual host.</p>
<p>Sometimes, the server runs behind a device that processes SSL,
such as a reverse proxy, load balancer or SSL offload
appliance. When this is the case, specify the
<code>https://</code> scheme and the port number to which the
clients connect in the <code class="directive">ServerName</code> directive
to make sure that the server generates the correct
self-referential URLs.
</p>
<p>See the description of the
<code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> and
<code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code> directives for
settings which determine whether self-referential URLs (e.g., by the
<code class="module"><a href="/mod/mod_dir.html">mod_dir</a></code> module) will refer to the
specified port, or to the port number given in the client's request.
</p>
<div class="warning">
<p>Failure to set <code class="directive">ServerName</code> to a name that
your server can resolve to an IP address will result in a startup
warning. <code>httpd</code> will then use whatever hostname it can
determine, using the system's <code>hostname</code> command. This
will almost never be the hostname you actually want.</p>
<div class="example"><p><code>
httpd: Could not reliably determine the server's fully qualified domain name, using rocinante.local for ServerName
</code></p></div>
</div>
<h3>See also</h3>
<ul>
<li><a href="/dns-caveats.html">Issues Regarding DNS and
Apache HTTP Server</a></li>
<li><a href="/vhosts/">Apache HTTP Server virtual host
documentation</a></li>
<li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
<li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
<li><code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code></li>
<li><code class="directive"><a href="#serveralias">ServerAlias</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ServerPath" id="ServerPath">ServerPath</a> <a name="serverpath" id="serverpath">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Legacy URL pathname for a name-based virtual host that
is accessed by an incompatible browser</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerPath <var>URL-path</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>The <code class="directive">ServerPath</code> directive sets the legacy
URL pathname for a host, for use with <a href="/vhosts/">name-based virtual hosts</a>.</p>
<h3>See also</h3>
<ul>
<li><a href="/vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ServerRoot" id="ServerRoot">ServerRoot</a> <a name="serverroot" id="serverroot">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Base directory for the server installation</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerRoot <var>directory-path</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerRoot /usr/local/apache</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>The <code class="directive">ServerRoot</code> directive sets the
directory in which the server lives. Typically it will contain the
subdirectories <code>conf/</code> and <code>logs/</code>. Relative
paths in other configuration directives (such as <code class="directive"><a href="#include">Include</a></code> or <code class="directive"><a href="/mod/mod_so.html#loadmodule">LoadModule</a></code>, for example) are taken as
relative to this directory.</p>
<div class="example"><h3>Example</h3><p><code>
ServerRoot /home/httpd
</code></p></div>
<h3>See also</h3>
<ul>
<li><a href="/invoking.html">the <code>-d</code>
option to <code>httpd</code></a></li>
<li><a href="/misc/security_tips.html#serverroot">the
security tips</a> for information on how to properly set
permissions on the <code class="directive">ServerRoot</code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ServerSignature" id="ServerSignature">ServerSignature</a> <a name="serversignature" id="serversignature">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the footer on server-generated documents</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerSignature On|Off|EMail</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerSignature Off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>The <code class="directive">ServerSignature</code> directive allows the
configuration of a trailing footer line under server-generated
documents (error messages, <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code> ftp directory
listings, <code class="module"><a href="/mod/mod_info.html">mod_info</a></code> output, ...). The reason why you
would want to enable such a footer line is that in a chain of proxies,
the user often has no possibility to tell which of the chained servers
actually produced a returned error message.</p>
<p>The <code>Off</code>
setting, which is the default, suppresses the footer line (and is
therefore compatible with the behavior of Apache-1.2 and
below). The <code>On</code> setting simply adds a line with the
server version number and <code class="directive"><a href="#servername">ServerName</a></code> of the serving virtual host,
and the <code>EMail</code> setting additionally creates a
"mailto:" reference to the <code class="directive"><a href="#serveradmin">ServerAdmin</a></code> of the referenced
document.</p>
<p>After version 2.0.44, the details of the server version number
presented are controlled by the <code class="directive"><a href="#servertokens">ServerTokens</a></code> directive.</p>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#servertokens">ServerTokens</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="ServerTokens" id="ServerTokens">ServerTokens</a> <a name="servertokens" id="servertokens">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the <code>Server</code> HTTP response
header</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerTokens Major|Minor|Min[imal]|Prod[uctOnly]|OS|Full</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerTokens Full</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>This directive controls whether <code>Server</code> response
header field which is sent back to clients includes a
description of the generic OS-type of the server as well as
information about compiled-in modules.</p>
<dl>
<dt><code>ServerTokens Full</code> (or not specified)</dt>
<dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
(Unix) PHP/4.2.2 MyMod/1.2</code></dd>
<dt><code>ServerTokens Prod[uctOnly]</code></dt>
<dd>Server sends (<em>e.g.</em>): <code>Server:
Apache</code></dd>
<dt><code>ServerTokens Major</code></dt>
<dd>Server sends (<em>e.g.</em>): <code>Server:
Apache/2</code></dd>
<dt><code>ServerTokens Minor</code></dt>
<dd>Server sends (<em>e.g.</em>): <code>Server:
Apache/2.4</code></dd>
<dt><code>ServerTokens Min[imal]</code></dt>
<dd>Server sends (<em>e.g.</em>): <code>Server:
Apache/2.4.1</code></dd>
<dt><code>ServerTokens OS</code></dt>
<dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.4.1
(Unix)</code></dd>
</dl>
<p>This setting applies to the entire server, and cannot be
enabled or disabled on a virtualhost-by-virtualhost basis.</p>
<p>After version 2.0.44, this directive also controls the
information presented by the <code class="directive"><a href="#serversignature">ServerSignature</a></code> directive.</p>
<div class="note">Setting <code class="directive">ServerTokens</code> to less than
<code>minimal</code> is not recommended because it makes it more
difficult to debug interoperational problems. Also note that
disabling the Server: header does nothing at all to make your
server more secure; the idea of "security through obscurity"
is a myth and leads to a false sense of safety.</div>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#serversignature">ServerSignature</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="SetHandler" id="SetHandler">SetHandler</a> <a name="sethandler" id="sethandler">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be processed by a
handler</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetHandler <var>handler-name</var>|None</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved into the core in Apache httpd 2.0</td></tr>
</table>
<p>When placed into an <code>.htaccess</code> file or a
<code class="directive"><a href="#directory">&lt;Directory&gt;</a></code> or
<code class="directive"><a href="#location">&lt;Location&gt;</a></code>
section, this directive forces all matching files to be parsed
through the <a href="/handler.html">handler</a> given by
<var>handler-name</var>. For example, if you had a directory you
wanted to be parsed entirely as imagemap rule files, regardless
of extension, you might put the following into an
<code>.htaccess</code> file in that directory:</p>
<div class="example"><p><code>
SetHandler imap-file
</code></p></div>
<p>Another example: if you wanted to have the server display a
status report whenever a URL of
<code>http://servername/status</code> was called, you might put
the following into <code>httpd.conf</code>:</p>
<div class="example"><p><code>
&lt;Location /status&gt;<br />
<span class="indent">
SetHandler server-status<br />
</span>
&lt;/Location&gt;
</code></p></div>
<p>You can override an earlier defined <code class="directive">SetHandler</code>
directive by using the value <code>None</code>.</p>
<p><strong>Note:</strong> because SetHandler overrides default handlers,
normal behaviour such as handling of URLs ending in a slash (/) as
directories or index files is suppressed.</p>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="/mod/mod_mime.html#addhandler">AddHandler</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="SetInputFilter" id="SetInputFilter">SetInputFilter</a> <a name="setinputfilter" id="setinputfilter">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process client requests and POST
input</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetInputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>The <code class="directive">SetInputFilter</code> directive sets the
filter or filters which will process client requests and POST
input when they are received by the server. This is in addition to
any filters defined elsewhere, including the
<code class="directive"><a href="/mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>
directive.</p>
<p>If more than one filter is specified, they must be separated
by semicolons in the order in which they should process the
content.</p>
<h3>See also</h3>
<ul>
<li><a href="/filter.html">Filters</a> documentation</li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="SetOutputFilter" id="SetOutputFilter">SetOutputFilter</a> <a name="setoutputfilter" id="setoutputfilter">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process responses from the
server</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
<tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>The <code class="directive">SetOutputFilter</code> directive sets the filters
which will process responses from the server before they are
sent to the client. This is in addition to any filters defined
elsewhere, including the
<code class="directive"><a href="/mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
directive.</p>
<p>For example, the following configuration will process all files
in the <code>/www/data/</code> directory for server-side
includes.</p>
<div class="example"><p><code>
&lt;Directory /www/data/&gt;<br />
<span class="indent">
SetOutputFilter INCLUDES<br />
</span>
&lt;/Directory&gt;
</code></p></div>
<p>If more than one filter is specified, they must be separated
by semicolons in the order in which they should process the
content.</p>
<h3>See also</h3>
<ul>
<li><a href="/filter.html">Filters</a> documentation</li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="TimeOut" id="TimeOut">TimeOut</a> <a name="timeout" id="timeout">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for
certain events before failing a request</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TimeOut <var>seconds</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TimeOut 300</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>The <code class="directive">TimeOut</code> directive defines the length
of time Apache httpd will wait for I/O in various circumstances:</p>
<ol>
<li>When reading data from the client, the length of time to
wait for a TCP packet to arrive if the read buffer is
empty.</li>
<li>When writing data to the client, the length of time to wait
for an acknowledgement of a packet if the send buffer is
full.</li>
<li>In <code class="module"><a href="/mod/mod_cgi.html">mod_cgi</a></code>, the length of time to wait for
output from a CGI script.</li>
<li>In <code class="module"><a href="/mod/mod_ext_filter.html">mod_ext_filter</a></code>, the length of time to
wait for output from a filtering process.</li>
<li>In <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code>, the default timeout value if
<code class="directive"><a href="/mod/mod_proxy.html#proxytimeout">ProxyTimeout</a></code> is not
configured.</li>
</ol>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="TraceEnable" id="TraceEnable">TraceEnable</a> <a name="traceenable" id="traceenable">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines the behaviour on <code>TRACE</code>
requests</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TraceEnable <var>[on|off|extended]</var></code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TraceEnable on</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
<tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache HTTP Server 1.3.34, 2.0.55 and later</td></tr>
</table>
<p>This directive overrides the behavior of <code>TRACE</code> for both
the core server and <code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code>. The default
<code>TraceEnable on</code> permits <code>TRACE</code> requests per
RFC 2616, which disallows any request body to accompany the request.
<code>TraceEnable off</code> causes the core server and
<code class="module"><a href="/mod/mod_proxy.html">mod_proxy</a></code> to return a <code>405</code> (Method not
allowed) error to the client.</p>
<p>Finally, for testing and diagnostic purposes only, request
bodies may be allowed using the non-compliant <code>TraceEnable
extended</code> directive. The core (as an origin server) will
restrict the request body to 64k (plus 8k for chunk headers if
<code>Transfer-Encoding: chunked</code> is used). The core will
reflect the full headers and all chunk headers with the response
body. As a proxy server, the request body is not restricted to 64k.</p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="UnDefine" id="UnDefine">UnDefine</a> <a name="undefine" id="undefine">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Undefine the existence of a variable</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UnDefine <var>parameter-name</var></code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>Undoes the effect of a <code class="directive"><a href="#define">Define</a></code> or
of passing a <code>-D</code> argument to <code class="program"><a href="/programs/httpd.html">httpd</a></code>.</p>
<p>This directive can be used to toggle the use of <code class="directive"><a href="#ifdefine">&lt;IfDefine&gt;</a></code> sections without needing to alter
<code>-D</code> arguments in any startup scripts.</p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="UseCanonicalName" id="UseCanonicalName">UseCanonicalName</a> <a name="usecanonicalname" id="usecanonicalname">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
port</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalName On|Off|DNS</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalName Off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>In many situations Apache httpd must construct a <em>self-referential</em>
URL -- that is, a URL that refers back to the same server. With
<code>UseCanonicalName On</code> Apache httpd will use the hostname and port
specified in the <code class="directive"><a href="#servername">ServerName</a></code>
directive to construct the canonical name for the server. This name
is used in all self-referential URLs, and for the values of
<code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
<p>With <code>UseCanonicalName Off</code> Apache httpd will form
self-referential URLs using the hostname and port supplied by
the client if any are supplied (otherwise it will use the
canonical name, as defined above). These values are the same
that are used to implement <a href="/vhosts/name-based.html">name-based virtual hosts</a>,
and are available with the same clients. The CGI variables
<code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
constructed from the client supplied values as well.</p>
<p>An example where this may be useful is on an intranet server
where you have users connecting to the machine using short
names such as <code>www</code>. You'll notice that if the users
type a shortname, and a URL which is a directory, such as
<code>http://www/splat</code>, <em>without the trailing
slash</em> then Apache httpd will redirect them to
<code>http://www.domain.com/splat/</code>. If you have
authentication enabled, this will cause the user to have to
authenticate twice (once for <code>www</code> and once again
for <code>www.domain.com</code> -- see <a href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
FAQ on this subject for more information</a>). But if
<code class="directive">UseCanonicalName</code> is set <code>Off</code>, then
Apache httpd will redirect to <code>http://www/splat/</code>.</p>
<p>There is a third option, <code>UseCanonicalName DNS</code>,
which is intended for use with mass IP-based virtual hosting to
support ancient clients that do not provide a
<code>Host:</code> header. With this option Apache httpd does a
reverse DNS lookup on the server IP address that the client
connected to in order to work out self-referential URLs.</p>
<div class="warning"><h3>Warning</h3>
<p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
they may be broken by this option. The client is essentially free
to give whatever value they want as a hostname. But if the CGI is
only using <code>SERVER_NAME</code> to construct self-referential URLs
then it should be just fine.</p>
</div>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
<li><code class="directive"><a href="#servername">ServerName</a></code></li>
<li><code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="UseCanonicalPhysicalPort" id="UseCanonicalPhysicalPort">UseCanonicalPhysicalPort</a> <a name="usecanonicalphysicalport" id="usecanonicalphysicalport">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
port</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalPhysicalPort On|Off</code></td></tr>
<tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalPhysicalPort Off</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p>In many situations Apache httpd must construct a <em>self-referential</em>
URL -- that is, a URL that refers back to the same server. With
<code>UseCanonicalPhysicalPort On</code> Apache httpd will, when
constructing the canonical port for the server to honor
the <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> directive,
provide the actual physical port number being used by this request
as a potential port. With <code>UseCanonicalPhysicalPort Off</code>
Apache httpd will not ever use the actual physical port number, instead
relying on all configured information to construct a valid port number.</p>
<div class="note"><h3>Note</h3>
<p>The ordering of when the physical port is used is as follows:<br /><br />
<code>UseCanonicalName On</code></p>
<ul>
<li>Port provided in <code>Servername</code></li>
<li>Physical port</li>
<li>Default port</li>
</ul>
<code>UseCanonicalName Off | DNS</code>
<ul>
<li>Parsed port from <code>Host:</code> header</li>
<li>Physical port</li>
<li>Port provided in <code>Servername</code></li>
<li>Default port</li>
</ul>
<p>With <code>UseCanonicalPhysicalPort Off</code>, the
physical ports are removed from the ordering.</p>
</div>
<h3>See also</h3>
<ul>
<li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
<li><code class="directive"><a href="#servername">ServerName</a></code></li>
<li><code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code></li>
</ul>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
<div class="directive-section"><h2><a name="VirtualHost" id="VirtualHost">&lt;VirtualHost&gt;</a> <a name="virtualhost" id="virtualhost">Directive</a></h2>
<table class="directive">
<tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply only to a specific
hostname or IP address</td></tr>
<tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>&lt;VirtualHost
<var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
...&gt; ... &lt;/VirtualHost&gt;</code></td></tr>
<tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
<tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
<tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
</table>
<p><code class="directive">&lt;VirtualHost&gt;</code> and
<code>&lt;/VirtualHost&gt;</code> are used to enclose a group of
directives that will apply only to a particular virtual host. Any
directive that is allowed in a virtual host context may be
used. When the server receives a request for a document on a
particular virtual host, it uses the configuration directives
enclosed in the <code class="directive">&lt;VirtualHost&gt;</code>
section. <var>Addr</var> can be:</p>
<ul>
<li>The IP address of the virtual host;</li>
<li>A fully qualified domain name for the IP address of the
virtual host (not recommended);</li>
<li>The character <code>*</code>, which is used only in combination with
<code>NameVirtualHost *</code> to match all IP addresses; or</li>
<li>The string <code>_default_</code>, which is used only
with IP virtual hosting to catch unmatched IP addresses.</li>
</ul>
<div class="example"><h3>Example</h3><p><code>
&lt;VirtualHost 10.1.2.3&gt;<br />
<span class="indent">
ServerAdmin webmaster@host.example.com<br />
DocumentRoot /www/docs/host.example.com<br />
ServerName host.example.com<br />
ErrorLog logs/host.example.com-error_log<br />
TransferLog logs/host.example.com-access_log<br />
</span>
&lt;/VirtualHost&gt;
</code></p></div>
<p>IPv6 addresses must be specified in square brackets because
the optional port number could not be determined otherwise. An
IPv6 example is shown below:</p>
<div class="example"><p><code>
&lt;VirtualHost [2001:db8::a00:20ff:fea7:ccea]&gt;<br />
<span class="indent">
ServerAdmin webmaster@host.example.com<br />
DocumentRoot /www/docs/host.example.com<br />
ServerName host.example.com<br />
ErrorLog logs/host.example.com-error_log<br />
TransferLog logs/host.example.com-access_log<br />
</span>
&lt;/VirtualHost&gt;
</code></p></div>
<p>Each Virtual Host must correspond to a different IP address,
different port number or a different host name for the server,
in the former case the server machine must be configured to
accept IP packets for multiple addresses. (If the machine does
not have multiple network interfaces, then this can be
accomplished with the <code>ifconfig alias</code> command -- if
your OS supports it).</p>
<div class="note"><h3>Note</h3>
<p>The use of <code class="directive">&lt;VirtualHost&gt;</code> does
<strong>not</strong> affect what addresses Apache httpd listens on. You
may need to ensure that Apache httpd is listening on the correct addresses
using <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code>.</p>
</div>
<p>When using IP-based virtual hosting, the special name
<code>_default_</code> can be specified in
which case this virtual host will match any IP address that is
not explicitly listed in another virtual host. In the absence
of any <code>_default_</code> virtual host the "main" server config,
consisting of all those definitions outside any VirtualHost
section, is used when no IP-match occurs.</p>
<p>You can specify a <code>:port</code> to change the port that is
matched. If unspecified then it defaults to the same port as the
most recent <code class="directive"><a href="/mod/mpm_common.html#listen">Listen</a></code>
statement of the main server. You may also specify <code>:*</code>
to match all ports on that address. (This is recommended when used
with <code>_default_</code>.)</p>
<p>A <code class="directive"><a href="#servername">ServerName</a></code> should be
specified inside each <code class="directive">&lt;VirtualHost&gt;</code> block. If it is absent, the
<code class="directive"><a href="#servername">ServerName</a></code> from the "main"
server configuration will be inherited.</p>
<p>If no matching virtual host is found, then the first listed
virtual host that matches the IP address will be used. As a
consequence, the first listed virtual host is the default virtual
host.</p>
<div class="warning"><h3>Security</h3>
<p>See the <a href="/misc/security_tips.html">security tips</a>
document for details on why your security could be compromised if the
directory where log files are stored is writable by anyone other
than the user that starts the server.</p>
</div>
<h3>See also</h3>
<ul>
<li><a href="/vhosts/">Apache HTTP Server Virtual Host documentation</a></li>
<li><a href="/dns-caveats.html">Issues Regarding DNS and
Apache HTTP Server</a></li>
<li><a href="/bind.html">Setting
which addresses and ports Apache HTTP Server uses</a></li>
<li><a href="/sections.html">How &lt;Directory&gt;, &lt;Location&gt;
and &lt;Files&gt; sections work</a> for an explanation of how these
different sections are combined when a request is received</li>
</ul>
</div>
</div>
<div class="bottomlang">
<p><span>Available Languages: </span><a href="/de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch">&nbsp;de&nbsp;</a> |
<a href="/en/mod/core.html" title="English">&nbsp;en&nbsp;</a> |
<a href="/fr/mod/core.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a> |
<a href="/ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
<a href="/tr/mod/core.html" hreflang="tr" rel="alternate" title="T�rk�e">&nbsp;tr&nbsp;</a></p>
</div><div id="footer">
<p class="apache">Copyright 2010 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p>
<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>
</body></html>