home *** CD-ROM | disk | FTP | other *** search
/ Cricao de Sites - 650 Layouts Prontos / WebMasters.iso / Servidores / apache_2.2.8-win32-x86-no_ssl.msi / Data1.cab / _F90CCAEC977D2FE6653DF25F2559B2C2 < prev    next >
Extensible Markup Language  |  2008-01-02  |  195KB  |  3,431 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
  4.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  5.               This file is generated from xml source: DO NOT EDIT
  6.         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  7.       -->
  8. <title>core - Apache HTTP Server</title>
  9. <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
  10. <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
  11. <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
  12. <link href="../images/favicon.ico" rel="shortcut icon" /></head>
  13. <body>
  14. <div id="page-header">
  15. <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>
  16. <p class="apache">Apache HTTP Server Version 2.2</p>
  17. <img alt="" src="../images/feather.gif" /></div>
  18. <div class="up"><a href="./"><img title="<-" alt="<-" src="../images/left.gif" /></a></div>
  19. <div id="path">
  20. <a href="http://www.apache.org/">Apache</a> > <a href="http://httpd.apache.org/">HTTP Server</a> > <a href="http://httpd.apache.org/docs/">Documentation</a> > <a href="../">Version 2.2</a> > <a href="./">Modules</a></div>
  21. <div id="page-content">
  22. <div id="preamble"><h1>Apache Core Features</h1>
  23. <div class="toplang">
  24. <p><span>Available Languages: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
  25. <a href="../en/mod/core.html" title="English"> en </a> |
  26. <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
  27. </div>
  28. <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Core Apache HTTP Server features that are always
  29. available</td></tr>
  30. <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Core</td></tr></table>
  31. </div>
  32. <div id="quickview"><h3 class="directives">Directives</h3>
  33. <ul id="toc">
  34. <li><img alt="" src="../images/down.gif" /> <a href="#acceptfilter">AcceptFilter</a></li>
  35. <li><img alt="" src="../images/down.gif" /> <a href="#acceptpathinfo">AcceptPathInfo</a></li>
  36. <li><img alt="" src="../images/down.gif" /> <a href="#accessfilename">AccessFileName</a></li>
  37. <li><img alt="" src="../images/down.gif" /> <a href="#adddefaultcharset">AddDefaultCharset</a></li>
  38. <li><img alt="" src="../images/down.gif" /> <a href="#addoutputfilterbytype">AddOutputFilterByType</a></li>
  39. <li><img alt="" src="../images/down.gif" /> <a href="#allowencodedslashes">AllowEncodedSlashes</a></li>
  40. <li><img alt="" src="../images/down.gif" /> <a href="#allowoverride">AllowOverride</a></li>
  41. <li><img alt="" src="../images/down.gif" /> <a href="#authname">AuthName</a></li>
  42. <li><img alt="" src="../images/down.gif" /> <a href="#authtype">AuthType</a></li>
  43. <li><img alt="" src="../images/down.gif" /> <a href="#cgimapextension">CGIMapExtension</a></li>
  44. <li><img alt="" src="../images/down.gif" /> <a href="#contentdigest">ContentDigest</a></li>
  45. <li><img alt="" src="../images/down.gif" /> <a href="#defaulttype">DefaultType</a></li>
  46. <li><img alt="" src="../images/down.gif" /> <a href="#directory"><Directory></a></li>
  47. <li><img alt="" src="../images/down.gif" /> <a href="#directorymatch"><DirectoryMatch></a></li>
  48. <li><img alt="" src="../images/down.gif" /> <a href="#documentroot">DocumentRoot</a></li>
  49. <li><img alt="" src="../images/down.gif" /> <a href="#enablemmap">EnableMMAP</a></li>
  50. <li><img alt="" src="../images/down.gif" /> <a href="#enablesendfile">EnableSendfile</a></li>
  51. <li><img alt="" src="../images/down.gif" /> <a href="#errordocument">ErrorDocument</a></li>
  52. <li><img alt="" src="../images/down.gif" /> <a href="#errorlog">ErrorLog</a></li>
  53. <li><img alt="" src="../images/down.gif" /> <a href="#fileetag">FileETag</a></li>
  54. <li><img alt="" src="../images/down.gif" /> <a href="#files"><Files></a></li>
  55. <li><img alt="" src="../images/down.gif" /> <a href="#filesmatch"><FilesMatch></a></li>
  56. <li><img alt="" src="../images/down.gif" /> <a href="#forcetype">ForceType</a></li>
  57. <li><img alt="" src="../images/down.gif" /> <a href="#hostnamelookups">HostnameLookups</a></li>
  58. <li><img alt="" src="../images/down.gif" /> <a href="#ifdefine"><IfDefine></a></li>
  59. <li><img alt="" src="../images/down.gif" /> <a href="#ifmodule"><IfModule></a></li>
  60. <li><img alt="" src="../images/down.gif" /> <a href="#include">Include</a></li>
  61. <li><img alt="" src="../images/down.gif" /> <a href="#keepalive">KeepAlive</a></li>
  62. <li><img alt="" src="../images/down.gif" /> <a href="#keepalivetimeout">KeepAliveTimeout</a></li>
  63. <li><img alt="" src="../images/down.gif" /> <a href="#limit"><Limit></a></li>
  64. <li><img alt="" src="../images/down.gif" /> <a href="#limitexcept"><LimitExcept></a></li>
  65. <li><img alt="" src="../images/down.gif" /> <a href="#limitinternalrecursion">LimitInternalRecursion</a></li>
  66. <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestbody">LimitRequestBody</a></li>
  67. <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfields">LimitRequestFields</a></li>
  68. <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestfieldsize">LimitRequestFieldSize</a></li>
  69. <li><img alt="" src="../images/down.gif" /> <a href="#limitrequestline">LimitRequestLine</a></li>
  70. <li><img alt="" src="../images/down.gif" /> <a href="#limitxmlrequestbody">LimitXMLRequestBody</a></li>
  71. <li><img alt="" src="../images/down.gif" /> <a href="#location"><Location></a></li>
  72. <li><img alt="" src="../images/down.gif" /> <a href="#locationmatch"><LocationMatch></a></li>
  73. <li><img alt="" src="../images/down.gif" /> <a href="#loglevel">LogLevel</a></li>
  74. <li><img alt="" src="../images/down.gif" /> <a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></li>
  75. <li><img alt="" src="../images/down.gif" /> <a href="#namevirtualhost">NameVirtualHost</a></li>
  76. <li><img alt="" src="../images/down.gif" /> <a href="#options">Options</a></li>
  77. <li><img alt="" src="../images/down.gif" /> <a href="#require">Require</a></li>
  78. <li><img alt="" src="../images/down.gif" /> <a href="#rlimitcpu">RLimitCPU</a></li>
  79. <li><img alt="" src="../images/down.gif" /> <a href="#rlimitmem">RLimitMEM</a></li>
  80. <li><img alt="" src="../images/down.gif" /> <a href="#rlimitnproc">RLimitNPROC</a></li>
  81. <li><img alt="" src="../images/down.gif" /> <a href="#satisfy">Satisfy</a></li>
  82. <li><img alt="" src="../images/down.gif" /> <a href="#scriptinterpretersource">ScriptInterpreterSource</a></li>
  83. <li><img alt="" src="../images/down.gif" /> <a href="#serveradmin">ServerAdmin</a></li>
  84. <li><img alt="" src="../images/down.gif" /> <a href="#serveralias">ServerAlias</a></li>
  85. <li><img alt="" src="../images/down.gif" /> <a href="#servername">ServerName</a></li>
  86. <li><img alt="" src="../images/down.gif" /> <a href="#serverpath">ServerPath</a></li>
  87. <li><img alt="" src="../images/down.gif" /> <a href="#serverroot">ServerRoot</a></li>
  88. <li><img alt="" src="../images/down.gif" /> <a href="#serversignature">ServerSignature</a></li>
  89. <li><img alt="" src="../images/down.gif" /> <a href="#servertokens">ServerTokens</a></li>
  90. <li><img alt="" src="../images/down.gif" /> <a href="#sethandler">SetHandler</a></li>
  91. <li><img alt="" src="../images/down.gif" /> <a href="#setinputfilter">SetInputFilter</a></li>
  92. <li><img alt="" src="../images/down.gif" /> <a href="#setoutputfilter">SetOutputFilter</a></li>
  93. <li><img alt="" src="../images/down.gif" /> <a href="#timeout">TimeOut</a></li>
  94. <li><img alt="" src="../images/down.gif" /> <a href="#traceenable">TraceEnable</a></li>
  95. <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalname">UseCanonicalName</a></li>
  96. <li><img alt="" src="../images/down.gif" /> <a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></li>
  97. <li><img alt="" src="../images/down.gif" /> <a href="#virtualhost"><VirtualHost></a></li>
  98. </ul>
  99. </div>
  100.  
  101. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  102. <div class="directive-section"><h2><a name="AcceptFilter" id="AcceptFilter">AcceptFilter</a> <a name="acceptfilter" id="acceptfilter">Directive</a></h2>
  103. <table class="directive">
  104. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures optimizations for a Protocol's Listener Sockets</td></tr>
  105. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptFilter <var>protocol</var> <var>accept_filter</var></code></td></tr>
  106. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  107. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  108. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  109. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.1.5 and later</td></tr>
  110. </table>
  111.     <p>This directive enables operating system specific optimizations for a 
  112.        listening socket by the Protocol type. The basic premise is for the 
  113.        kernel to not send a socket to the server process until either data 
  114.        is received or an entire HTTP Request is buffered. Only
  115.        <a href="http://www.freebsd.org/cgi/man.cgi?query=accept_filter&sektion=9">
  116.        FreeBSD's Accept Filters</a> and Linux's more primitive 
  117.        <code>TCP_DEFER_ACCEPT</code> are currently supported.</p>
  118.  
  119.     <p>The default values on FreeBSD are:</p>
  120.     <div class="example"><p><code>
  121.         AcceptFilter http httpready <br />
  122.         AcceptFilter https dataready
  123.     </code></p></div>
  124.     
  125.     <p>The <code>httpready</code> accept filter buffers entire HTTP requests at
  126.        the kernel level.  Once an entire request is received, the kernel then 
  127.        sends it to the server. See the 
  128.        <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_http&sektion=9">
  129.        accf_http(9)</a> man page for more details.  Since HTTPS requests are 
  130.        encrypted only the <a href="http://www.freebsd.org/cgi/man.cgi?query=accf_data&sektion=9">
  131.        accf_data(9)</a> filter is used.</p>
  132.  
  133.     <p>The default values on Linux are:</p>
  134.     <div class="example"><p><code>
  135.         AcceptFilter http data <br />
  136.         AcceptFilter https data
  137.     </code></p></div>
  138.  
  139.     <p>Linux's <code>TCP_DEFER_ACCEPT</code> does not support buffering http
  140.        requests.  Any value besides <code>none</code> will enable 
  141.        <code>TCP_DEFER_ACCEPT</code> on that listener. For more details
  142.        see the Linux 
  143.        <a href="http://homepages.cwi.nl/~aeb/linux/man2html/man7/tcp.7.html">
  144.        tcp(7)</a> man page.</p>
  145.  
  146.     <p>Using <code>none</code> for an argument will disable any accept filters 
  147.        for that protocol.  This is useful for protocols that require a server
  148.        send data first, such as <code>nntp</code>:</p>
  149.     <div class="example"><p><code>AcceptFilter nntp none</code></p></div>
  150.  
  151.  
  152. </div>
  153. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  154. <div class="directive-section"><h2><a name="AcceptPathInfo" id="AcceptPathInfo">AcceptPathInfo</a> <a name="acceptpathinfo" id="acceptpathinfo">Directive</a></h2>
  155. <table class="directive">
  156. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Resources accept trailing pathname information</td></tr>
  157. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AcceptPathInfo On|Off|Default</code></td></tr>
  158. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AcceptPathInfo Default</code></td></tr>
  159. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  160. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  161. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  162. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  163. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.30 and later</td></tr>
  164. </table>
  165.  
  166.     <p>This directive controls whether requests that contain trailing
  167.     pathname information that follows an actual filename (or
  168.     non-existent file in an existing directory) will be accepted or
  169.     rejected.  The trailing pathname information can be made
  170.     available to scripts in the <code>PATH_INFO</code> environment
  171.     variable.</p>
  172.  
  173.     <p>For example, assume the location <code>/test/</code> points to
  174.     a directory that contains only the single file
  175.     <code>here.html</code>.  Then requests for
  176.     <code>/test/here.html/more</code> and
  177.     <code>/test/nothere.html/more</code> both collect
  178.     <code>/more</code> as <code>PATH_INFO</code>.</p>
  179.  
  180.     <p>The three possible arguments for the
  181.     <code class="directive">AcceptPathInfo</code> directive are:</p>
  182.     <dl>
  183.     <dt><code>Off</code></dt><dd>A request will only be accepted if it
  184.     maps to a literal path that exists.  Therefore a request with
  185.     trailing pathname information after the true filename such as
  186.     <code>/test/here.html/more</code> in the above example will return
  187.     a 404 NOT FOUND error.</dd>
  188.  
  189.     <dt><code>On</code></dt><dd>A request will be accepted if a
  190.     leading path component maps to a file that exists.  The above
  191.     example <code>/test/here.html/more</code> will be accepted if
  192.     <code>/test/here.html</code> maps to a valid file.</dd>
  193.  
  194.     <dt><code>Default</code></dt><dd>The treatment of requests with
  195.     trailing pathname information is determined by the <a href="../handler.html">handler</a> responsible for the request.
  196.     The core handler for normal files defaults to rejecting
  197.     <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
  198.     <code>PATH_INFO</code> by default.</dd>
  199.     </dl>
  200.  
  201.     <p>The primary purpose of the <code>AcceptPathInfo</code>
  202.     directive is to allow you to override the handler's choice of
  203.     accepting or rejecting <code>PATH_INFO</code>. This override is required,
  204.     for example, when you use a <a href="../filter.html">filter</a>, such
  205.     as <a href="mod_include.html">INCLUDES</a>, to generate content
  206.     based on <code>PATH_INFO</code>.  The core handler would usually reject
  207.     the request, so you can use the following configuration to enable
  208.     such a script:</p>
  209.  
  210.     <div class="example"><p><code>
  211.       <Files "mypaths.shtml"><br />
  212.       <span class="indent">
  213.         Options +Includes<br />
  214.         SetOutputFilter INCLUDES<br />
  215.         AcceptPathInfo On<br />
  216.       </span>
  217.       </Files>
  218.     </code></p></div>
  219.  
  220.  
  221. </div>
  222. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  223. <div class="directive-section"><h2><a name="AccessFileName" id="AccessFileName">AccessFileName</a> <a name="accessfilename" id="accessfilename">Directive</a></h2>
  224. <table class="directive">
  225. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Name of the distributed configuration file</td></tr>
  226. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AccessFileName <var>filename</var> [<var>filename</var>] ...</code></td></tr>
  227. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AccessFileName .htaccess</code></td></tr>
  228. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  229. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  230. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  231. </table>
  232.     <p>While processing a request the server looks for
  233.     the first existing configuration file from this list of names in
  234.     every directory of the path to the document, if distributed
  235.     configuration files are <a href="#allowoverride">enabled for that
  236.     directory</a>. For example:</p>
  237.  
  238.     <div class="example"><p><code>
  239.       AccessFileName .acl
  240.     </code></p></div>
  241.  
  242.     <p>before returning the document
  243.     <code>/usr/local/web/index.html</code>, the server will read
  244.     <code>/.acl</code>, <code>/usr/.acl</code>,
  245.     <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code>
  246.     for directives, unless they have been disabled with</p>
  247.  
  248.     <div class="example"><p><code>
  249.       <Directory /><br />
  250.       <span class="indent">
  251.         AllowOverride None<br />
  252.       </span>
  253.       </Directory>
  254.     </code></p></div>
  255.  
  256. <h3>See also</h3>
  257. <ul>
  258. <li><code class="directive"><a href="#allowoverride">AllowOverride</a></code></li>
  259. <li><a href="../configuring.html">Configuration Files</a></li>
  260. <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
  261. </ul>
  262. </div>
  263. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  264. <div class="directive-section"><h2><a name="AddDefaultCharset" id="AddDefaultCharset">AddDefaultCharset</a> <a name="adddefaultcharset" id="adddefaultcharset">Directive</a></h2>
  265. <table class="directive">
  266. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Default charset parameter to be added when a response
  267. content-type is <code>text/plain</code> or <code>text/html</code></td></tr>
  268. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddDefaultCharset On|Off|<var>charset</var></code></td></tr>
  269. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AddDefaultCharset Off</code></td></tr>
  270. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  271. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  272. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  273. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  274. </table>
  275.     <p>This directive specifies a default value for the media type
  276.     charset parameter (the name of a character encoding) to be added
  277.     to a response if and only if the response's content-type is either
  278.     <code>text/plain</code> or <code>text/html</code>.  This should override
  279.     any charset specified in the body of the response via a <code>META</code>
  280.     element, though the exact behavior is often dependent on the user's client
  281.     configuration. A setting of <code>AddDefaultCharset Off</code>
  282.     disables this functionality. <code>AddDefaultCharset On</code> enables
  283.     a default charset of <code>iso-8859-1</code>. Any other value is assumed
  284.     to be the <var>charset</var> to be used, which should be one of the
  285.     <a href="http://www.iana.org/assignments/character-sets">IANA registered
  286.     charset values</a> for use in MIME media types.
  287.     For example:</p>
  288.  
  289.     <div class="example"><p><code>
  290.       AddDefaultCharset utf-8
  291.     </code></p></div>
  292.  
  293.     <p><code class="directive">AddDefaultCharset</code> should only be used when all
  294.     of the text resources to which it applies are known to be in that
  295.     character encoding and it is too inconvenient to label their charset
  296.     individually. One such example is to add the charset parameter
  297.     to resources containing generated content, such as legacy CGI
  298.     scripts, that might be vulnerable to cross-site scripting attacks
  299.     due to user-provided data being included in the output.  Note, however,
  300.     that a better solution is to just fix (or delete) those scripts, since
  301.     setting a default charset does not protect users that have enabled
  302.     the "auto-detect character encoding" feature on their browser.</p>
  303.  
  304. <h3>See also</h3>
  305. <ul>
  306. <li><code class="directive"><a href="../mod/mod_mime.html#addcharset">AddCharset</a></code></li>
  307. </ul>
  308. </div>
  309. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  310. <div class="directive-section"><h2><a name="AddOutputFilterByType" id="AddOutputFilterByType">AddOutputFilterByType</a> <a name="addoutputfilterbytype" id="addoutputfilterbytype">Directive</a></h2>
  311. <table class="directive">
  312. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>assigns an output filter to a particular MIME-type</td></tr>
  313. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AddOutputFilterByType <var>filter</var>[;<var>filter</var>...]
  314. <var>MIME-type</var> [<var>MIME-type</var>] ...</code></td></tr>
  315. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  316. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  317. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  318. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  319. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.33 and later; deprecated in Apache 2.1 and later</td></tr>
  320. </table>
  321.     <p>This directive activates a particular output <a href="../filter.html">filter</a> for a request depending on the
  322.     response <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME-type</a>.  Because of certain
  323.     problems discussed below, this directive is deprecated.  The same
  324.     functionality is available using <code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code>.</p>
  325.  
  326.     <p>The following example uses the <code>DEFLATE</code> filter, which
  327.     is provided by <code class="module"><a href="../mod/mod_deflate.html">mod_deflate</a></code>. It will compress all
  328.     output (either static or dynamic) which is labeled as
  329.     <code>text/html</code> or <code>text/plain</code> before it is sent
  330.     to the client.</p>
  331.  
  332.     <div class="example"><p><code>
  333.       AddOutputFilterByType DEFLATE text/html text/plain
  334.     </code></p></div>
  335.  
  336.     <p>If you want the content to be processed by more than one filter, their
  337.     names have to be separated by semicolons. It's also possible to use one
  338.     <code class="directive">AddOutputFilterByType</code> directive for each of
  339.     these filters.</p>
  340.  
  341.     <p>The configuration below causes all script output labeled as
  342.     <code>text/html</code> to be processed at first by the
  343.     <code>INCLUDES</code> filter and then by the <code>DEFLATE</code>
  344.     filter.</p>
  345.  
  346.     <div class="example"><p><code>
  347.     <Location /cgi-bin/><br />
  348.     <span class="indent">
  349.       Options Includes<br />
  350.       AddOutputFilterByType INCLUDES;DEFLATE text/html<br />
  351.     </span>
  352.     </Location>
  353.     </code></p></div>
  354.  
  355.     <div class="warning"><h3>Note</h3>
  356.       <p>Enabling filters with <code class="directive">AddOutputFilterByType</code>
  357.       may fail partially or completely in some cases. For example, no
  358.       filters are applied if the <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME-type</a> could not be determined  and falls
  359.       back to the <code class="directive"><a href="#defaulttype">DefaultType</a></code> setting,
  360.       even if the <code class="directive"><a href="#defaulttype">DefaultType</a></code> is the
  361.       same.</p>
  362.  
  363.       <p>However, if you want to make sure, that the filters will be
  364.       applied, assign the content type to a resource explicitly, for
  365.       example with <code class="directive"><a href="../mod/mod_mime.html#addtype">AddType</a></code> or
  366.       <code class="directive"><a href="#forcetype">ForceType</a></code>. Setting the
  367.       content type within a (non-nph) CGI script is also safe.</p>
  368.  
  369.     </div>
  370.  
  371. <h3>See also</h3>
  372. <ul>
  373. <li><code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code></li>
  374. <li><code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code></li>
  375. <li><a href="../filter.html">filters</a></li>
  376. </ul>
  377. </div>
  378. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  379. <div class="directive-section"><h2><a name="AllowEncodedSlashes" id="AllowEncodedSlashes">AllowEncodedSlashes</a> <a name="allowencodedslashes" id="allowencodedslashes">Directive</a></h2>
  380. <table class="directive">
  381. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines whether encoded path separators in URLs are allowed to
  382. be passed through</td></tr>
  383. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowEncodedSlashes On|Off</code></td></tr>
  384. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowEncodedSlashes Off</code></td></tr>
  385. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  386. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  387. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  388. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.46 and later</td></tr>
  389. </table>
  390.     <p>The <code class="directive">AllowEncodedSlashes</code> directive allows URLs
  391.     which contain encoded path separators (<code>%2F</code> for <code>/</code>
  392.     and additionally <code>%5C</code> for <code>\</code> on according systems)
  393.     to be used. Normally such URLs are refused with a 404 (Not found) error.</p>
  394.  
  395.     <p>Turning <code class="directive">AllowEncodedSlashes</code> <code>On</code> is
  396.     mostly useful when used in conjunction with <code>PATH_INFO</code>.</p>
  397.  
  398.     <div class="note"><h3>Note</h3>
  399.       <p>Allowing encoded slashes does <em>not</em> imply <em>decoding</em>.
  400.       Occurrences of <code>%2F</code> or <code>%5C</code> (<em>only</em> on
  401.       according systems) will be left as such in the otherwise decoded URL
  402.       string.</p>
  403.     </div>
  404.  
  405. <h3>See also</h3>
  406. <ul>
  407. <li><code class="directive"><a href="#acceptpathinfo">AcceptPathInfo</a></code></li>
  408. </ul>
  409. </div>
  410. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  411. <div class="directive-section"><h2><a name="AllowOverride" id="AllowOverride">AllowOverride</a> <a name="allowoverride" id="allowoverride">Directive</a></h2>
  412. <table class="directive">
  413. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Types of directives that are allowed in
  414. <code>.htaccess</code> files</td></tr>
  415. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AllowOverride All|None|<var>directive-type</var>
  416. [<var>directive-type</var>] ...</code></td></tr>
  417. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>AllowOverride All</code></td></tr>
  418. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory</td></tr>
  419. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  420. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  421. </table>
  422.     <p>When the server finds an <code>.htaccess</code> file (as
  423.     specified by <code class="directive"><a href="#accessfilename">AccessFileName</a></code>)
  424.     it needs to know which directives declared in that file can override
  425.     earlier configuration directives.</p>
  426.  
  427.     <div class="note"><h3>Only available in <Directory> sections</h3>
  428.     <code class="directive">AllowOverride</code> is valid only in
  429.     <code class="directive"><a href="#directory"><Directory></a></code>
  430.     sections specified without regular expressions, not in <code class="directive"><a href="#location"><Location></a></code>, <code class="directive"><a href="#directorymatch"><DirectoryMatch></a></code> or
  431.     <code class="directive"><a href="#files"><Files></a></code> sections.
  432.     </div>
  433.  
  434.     <p>When this directive is set to <code>None</code>, then
  435.     <a href="#accessfilename">.htaccess</a> files are completely ignored.
  436.     In this case, the server will not even attempt to read
  437.     <code>.htaccess</code> files in the filesystem.</p>
  438.  
  439.     <p>When this directive is set to <code>All</code>, then any
  440.     directive which has the .htaccess <a href="directive-dict.html#Context">Context</a> is allowed in
  441.     <code>.htaccess</code> files.</p>
  442.  
  443.     <p>The <var>directive-type</var> can be one of the following
  444.     groupings of directives.</p>
  445.  
  446.     <dl>
  447.       <dt>AuthConfig</dt>
  448.  
  449.       <dd>
  450.  
  451.       Allow use of the authorization directives (<code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmgroupfile">AuthDBMGroupFile</a></code>,
  452.       <code class="directive"><a href="../mod/mod_authn_dbm.html#authdbmuserfile">AuthDBMUserFile</a></code>,
  453.       <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code>,
  454.       <code class="directive"><a href="#authname">AuthName</a></code>,
  455.       <code class="directive"><a href="#authtype">AuthType</a></code>, <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>, <code class="directive"><a href="#require">Require</a></code>, <em>etc.</em>).</dd>
  456.  
  457.       <dt>FileInfo</dt>
  458.  
  459.       <dd>
  460.       Allow use of the directives controlling document types (<code class="directive"><a href="#defaulttype">DefaultType</a></code>, <code class="directive"><a href="#errordocument">ErrorDocument</a></code>, <code class="directive"><a href="#forcetype">ForceType</a></code>, <code class="directive"><a href="../mod/mod_negotiation.html#languagepriority">LanguagePriority</a></code>,
  461.       <code class="directive"><a href="#sethandler">SetHandler</a></code>, <code class="directive"><a href="#setinputfilter">SetInputFilter</a></code>, <code class="directive"><a href="#setoutputfilter">SetOutputFilter</a></code>, and
  462.       <code class="module"><a href="../mod/mod_mime.html">mod_mime</a></code> Add* and Remove*
  463.       directives, <em>etc.</em>), 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>),
  464.       <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
  465.       <code class="directive"><a href="../mod/mod_actions.html#action">Action</a></code> from
  466.       <code class="module"><a href="../mod/mod_actions.html">mod_actions</a></code>.
  467.       </dd>
  468.  
  469.       <dt>Indexes</dt>
  470.  
  471.       <dd>
  472.       Allow use of the directives controlling directory indexing
  473.       (<code class="directive"><a href="../mod/mod_autoindex.html#adddescription">AddDescription</a></code>,
  474.       <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>,
  475.       <code class="directive"><a href="../mod/mod_autoindex.html#addiconbytype">AddIconByType</a></code>,
  476.       <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>,
  477.       <em>etc.</em>).</dd>
  478.  
  479.       <dt>Limit</dt>
  480.  
  481.       <dd>
  482.       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>
  483.  
  484.       <dt>Options[=<var>Option</var>,...]</dt>
  485.  
  486.       <dd>
  487.       Allow use of the directives controlling specific directory
  488.       features (<code class="directive"><a href="#options">Options</a></code> and
  489.       <code class="directive"><a href="../mod/mod_include.html#xbithack">XBitHack</a></code>).
  490.       An equal sign may be given followed by a comma (but no spaces)
  491.       separated lists of options that may be set using the <code class="directive"><a href="#options">Options</a></code> command.</dd>
  492.     </dl>
  493.  
  494.     <p>Example:</p>
  495.  
  496.     <div class="example"><p><code>
  497.       AllowOverride AuthConfig Indexes
  498.     </code></p></div>
  499.  
  500.     <p>In the example above all directives that are neither in the group
  501.     <code>AuthConfig</code> nor <code>Indexes</code> cause an internal
  502.     server error.</p>
  503.  
  504. <h3>See also</h3>
  505. <ul>
  506. <li><code class="directive"><a href="#accessfilename">AccessFileName</a></code></li>
  507. <li><a href="../configuring.html">Configuration Files</a></li>
  508. <li><a href="../howto/htaccess.html">.htaccess Files</a></li>
  509. </ul>
  510. </div>
  511. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  512. <div class="directive-section"><h2><a name="AuthName" id="AuthName">AuthName</a> <a name="authname" id="authname">Directive</a></h2>
  513. <table class="directive">
  514. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Authorization realm for use in HTTP
  515. authentication</td></tr>
  516. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthName <var>auth-domain</var></code></td></tr>
  517. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  518. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  519. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  520. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  521. </table>
  522.     <p>This directive sets the name of the authorization realm for a
  523.     directory. This realm is given to the client so that the user
  524.     knows which username and password to send.
  525.     <code class="directive">AuthName</code> takes a single argument; if the
  526.     realm name contains spaces, it must be enclosed in quotation
  527.     marks.  It must be accompanied by <code class="directive"><a href="#authtype">AuthType</a></code> and <code class="directive"><a href="#require">Require</a></code> directives, and directives such
  528.     as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code> and
  529.     <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> to
  530.     work.</p>
  531.  
  532.    <p>For example:</p>
  533.  
  534.    <div class="example"><p><code>
  535.      AuthName "Top Secret"
  536.    </code></p></div>
  537.  
  538.     <p>The string provided for the <code>AuthName</code> is what will
  539.     appear in the password dialog provided by most browsers.</p>
  540.  
  541. <h3>See also</h3>
  542. <ul>
  543. <li><a href="../howto/auth.html">Authentication, Authorization, and
  544.     Access Control</a></li>
  545. </ul>
  546. </div>
  547. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  548. <div class="directive-section"><h2><a name="AuthType" id="AuthType">AuthType</a> <a name="authtype" id="authtype">Directive</a></h2>
  549. <table class="directive">
  550. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Type of user authentication</td></tr>
  551. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>AuthType Basic|Digest</code></td></tr>
  552. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  553. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  554. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  555. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  556. </table>
  557.     <p>This directive selects the type of user authentication for a
  558.     directory. The authentication types available are
  559.     <code>Basic</code> (implemented by
  560.     <code class="module"><a href="../mod/mod_auth_basic.html">mod_auth_basic</a></code>) and <code>Digest</code>
  561.     (implemented by <code class="module"><a href="../mod/mod_auth_digest.html">mod_auth_digest</a></code>).</p>
  562.  
  563.     <p>To implement authentication, you must also use the <code class="directive"><a href="#authname">AuthName</a></code> and <code class="directive"><a href="#require">Require</a></code> directives.  In addition, the
  564.     server must have an authentication-provider module such as
  565.     <code class="module"><a href="../mod/mod_authn_file.html">mod_authn_file</a></code> and an authorization module such
  566.     as <code class="module"><a href="../mod/mod_authz_user.html">mod_authz_user</a></code>.</p>
  567.  
  568. <h3>See also</h3>
  569. <ul>
  570. <li><a href="../howto/auth.html">Authentication, Authorization,
  571.     and Access Control</a></li>
  572. </ul>
  573. </div>
  574. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  575. <div class="directive-section"><h2><a name="CGIMapExtension" id="CGIMapExtension">CGIMapExtension</a> <a name="cgimapextension" id="cgimapextension">Directive</a></h2>
  576. <table class="directive">
  577. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
  578. scripts</td></tr>
  579. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>CGIMapExtension <var>cgi-path</var> <var>.extension</var></code></td></tr>
  580. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  581. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  582. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  583. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  584. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>NetWare only</td></tr>
  585. </table>
  586.     <p>This directive is used to control how Apache finds the
  587.     interpreter used to run CGI scripts. For example, setting
  588.     <code>CGIMapExtension sys:\foo.nlm .foo</code> will
  589.     cause all CGI script files with a <code>.foo</code> extension to
  590.     be passed to the FOO interpreter.</p>
  591.  
  592. </div>
  593. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  594. <div class="directive-section"><h2><a name="ContentDigest" id="ContentDigest">ContentDigest</a> <a name="contentdigest" id="contentdigest">Directive</a></h2>
  595. <table class="directive">
  596. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables the generation of <code>Content-MD5</code> HTTP Response
  597. headers</td></tr>
  598. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ContentDigest On|Off</code></td></tr>
  599. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ContentDigest Off</code></td></tr>
  600. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  601. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
  602. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  603. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  604. </table>
  605.     <p>This directive enables the generation of
  606.     <code>Content-MD5</code> headers as defined in RFC1864
  607.     respectively RFC2068.</p>
  608.  
  609.     <p>MD5 is an algorithm for computing a "message digest"
  610.     (sometimes called "fingerprint") of arbitrary-length data, with
  611.     a high degree of confidence that any alterations in the data
  612.     will be reflected in alterations in the message digest.</p>
  613.  
  614.     <p>The <code>Content-MD5</code> header provides an end-to-end
  615.     message integrity check (MIC) of the entity-body. A proxy or
  616.     client may check this header for detecting accidental
  617.     modification of the entity-body in transit. Example header:</p>
  618.  
  619.     <div class="example"><p><code>
  620.       Content-MD5: AuLb7Dp1rqtRtxz2m9kRpA==
  621.     </code></p></div>
  622.  
  623.     <p>Note that this can cause performance problems on your server
  624.     since the message digest is computed on every request (the
  625.     values are not cached).</p>
  626.  
  627.     <p><code>Content-MD5</code> is only sent for documents served
  628.     by the <code class="module"><a href="../mod/core.html">core</a></code>, and not by any module. For example,
  629.     SSI documents, output from CGI scripts, and byte range responses
  630.     do not have this header.</p>
  631.  
  632. </div>
  633. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  634. <div class="directive-section"><h2><a name="DefaultType" id="DefaultType">DefaultType</a> <a name="defaulttype" id="defaulttype">Directive</a></h2>
  635. <table class="directive">
  636. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>MIME content-type that will be sent if the
  637. server cannot determine a type in any other way</td></tr>
  638. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DefaultType <var>MIME-type|none</var></code></td></tr>
  639. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DefaultType text/plain</code></td></tr>
  640. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  641. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  642. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  643. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  644. </table>
  645.     <p>There will be times when the server is asked to provide a
  646.     document whose type cannot be determined by its <a class="glossarylink" href="../glossary.html#mime-type" title="see glossary">MIME types</a> mappings.</p>
  647.  
  648.     <p>The server SHOULD inform the client of the content-type of the
  649.     document.  If the server is unable to determine this by normal
  650.     means, it will set it to the configured
  651.     <code>DefaultType</code>. For example:</p>
  652.  
  653.     <div class="example"><p><code>
  654.       DefaultType image/gif
  655.     </code></p></div>
  656.  
  657.     <p>would be appropriate for a directory which contained many GIF
  658.     images with filenames missing the <code>.gif</code> extension.</p>
  659.  
  660.     <p>In cases where it can neither be determined by the server nor
  661.     the administrator (e.g. a proxy), it is preferable to omit the MIME
  662.     type altogether rather than provide information that may be false.
  663.     This can be accomplished using</p>
  664.     <div class="example"><p><code>
  665.       DefaultType None
  666.     </code></p></div>
  667.     <p>DefaultType None is only available in httpd-2.2.7 and later.</p>
  668.  
  669.     <p>Note that unlike <code class="directive"><a href="#forcetype">ForceType</a></code>, this directive only
  670.     provides the default mime-type. All other mime-type definitions,
  671.     including filename extensions, that might identify the media type
  672.     will override this default.</p>
  673.  
  674. </div>
  675. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  676. <div class="directive-section"><h2><a name="Directory" id="Directory"><Directory></a> <a name="directory" id="directory">Directive</a></h2>
  677. <table class="directive">
  678. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose a group of directives that apply only to the
  679. named file-system directory and sub-directories</td></tr>
  680. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Directory <var>directory-path</var>>
  681. ... </Directory></code></td></tr>
  682. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  683. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  684. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  685. </table>
  686.     <p><code class="directive"><Directory></code> and
  687.     <code></Directory></code> are used to enclose a group of
  688.     directives that will apply only to the named directory and
  689.     sub-directories of that directory. Any directive that is allowed
  690.     in a directory context may be used. <var>Directory-path</var> is
  691.     either the full path to a directory, or a wild-card string using
  692.     Unix shell-style matching. In a wild-card string, <code>?</code> matches
  693.     any single character, and <code>*</code> matches any sequences of
  694.     characters. You may also use <code>[]</code> character ranges. None
  695.     of the wildcards match a `/' character, so <code><Directory
  696.     /*/public_html></code> will not match
  697.     <code>/home/user/public_html</code>, but <code><Directory
  698.     /home/*/public_html></code> will match. Example:</p>
  699.  
  700.     <div class="example"><p><code>
  701.       <Directory /usr/local/httpd/htdocs><br />
  702.       <span class="indent">
  703.         Options Indexes FollowSymLinks<br />
  704.       </span>
  705.       </Directory>
  706.     </code></p></div>
  707.  
  708.     <div class="note">
  709.       <p>Be careful with the <var>directory-path</var> arguments:
  710.       They have to literally match the filesystem path which Apache uses
  711.       to access the files. Directives applied to a particular
  712.       <code><Directory></code> will not apply to files accessed from
  713.       that same directory via a different path, such as via different symbolic
  714.       links.</p>
  715.     </div>
  716.  
  717.     <p><a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular
  718.     expressions</a> can also be used, with the addition of the
  719.     <code>~</code> character. For example:</p>
  720.  
  721.     <div class="example"><p><code>
  722.       <Directory ~ "^/www/.*/[0-9]{3}">
  723.     </code></p></div>
  724.  
  725.     <p>would match directories in <code>/www/</code> that consisted of
  726.     three numbers.</p>
  727.  
  728.     <p>If multiple (non-regular expression) <code class="directive"><Directory></code> sections
  729.     match the directory (or one of its parents) containing a document,
  730.     then the directives are applied in the order of shortest match
  731.     first, interspersed with the directives from the <a href="#accessfilename">.htaccess</a> files. For example,
  732.     with</p>
  733.  
  734.     <div class="example"><p><code>
  735.       <Directory /><br />
  736.       <span class="indent">
  737.         AllowOverride None<br />
  738.       </span>
  739.       </Directory><br />
  740.       <br />
  741.       <Directory /home/><br />
  742.       <span class="indent">
  743.         AllowOverride FileInfo<br />
  744.       </span>
  745.       </Directory>
  746.     </code></p></div>
  747.  
  748.     <p>for access to the document <code>/home/web/dir/doc.html</code>
  749.     the steps are:</p>
  750.  
  751.     <ul>
  752.       <li>Apply directive <code>AllowOverride None</code>
  753.       (disabling <code>.htaccess</code> files).</li>
  754.  
  755.       <li>Apply directive <code>AllowOverride FileInfo</code> (for
  756.       directory <code>/home</code>).</li>
  757.  
  758.       <li>Apply any <code>FileInfo</code> directives in
  759.       <code>/home/.htaccess</code>, <code>/home/web/.htaccess</code> and
  760.       <code>/home/web/dir/.htaccess</code> in that order.</li>
  761.     </ul>
  762.  
  763.     <p>Regular expressions are not considered until after all of the
  764.     normal sections have been applied. Then all of the regular
  765.     expressions are tested in the order they appeared in the
  766.     configuration file. For example, with</p>
  767.  
  768.     <div class="example"><p><code>
  769.       <Directory ~ abc$><br />
  770.       <span class="indent">
  771.         # ... directives here ...<br />
  772.       </span>
  773.       </Directory>
  774.     </code></p></div>
  775.  
  776.     <p>the regular expression section won't be considered until after
  777.     all normal <code class="directive"><Directory></code>s and
  778.     <code>.htaccess</code> files have been applied. Then the regular
  779.     expression will match on <code>/home/abc/public_html/abc</code> and
  780.     the corresponding <code class="directive"><Directory></code> will
  781.     be applied.</p>
  782.  
  783.    <p><strong>Note that the default Apache access for
  784.     <code><Directory /></code> is <code>Allow from All</code>.
  785.     This means that Apache will serve any file mapped from an URL. It is
  786.     recommended that you change this with a block such
  787.     as</strong></p>
  788.  
  789.     <div class="example"><p><code>
  790.       <Directory /><br />
  791.       <span class="indent">
  792.         Order Deny,Allow<br />
  793.         Deny from All<br />
  794.       </span>
  795.       </Directory>
  796.     </code></p></div>
  797.  
  798.     <p><strong>and then override this for directories you
  799.     <em>want</em> accessible. See the <a href="../misc/security_tips.html">Security Tips</a> page for more
  800.     details.</strong></p>
  801.  
  802.     <p>The directory sections occur in the <code>httpd.conf</code> file.
  803.     <code class="directive"><Directory></code> directives
  804.     cannot nest, and cannot appear in a <code class="directive"><a href="#limit"><Limit></a></code> or <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section.</p>
  805.  
  806. <h3>See also</h3>
  807. <ul>
  808. <li><a href="../sections.html">How <Directory>,
  809.     <Location> and <Files> sections work</a> for an
  810.     explanation of how these different sections are combined when a
  811.     request is received</li>
  812. </ul>
  813. </div>
  814. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  815. <div class="directive-section"><h2><a name="DirectoryMatch" id="DirectoryMatch"><DirectoryMatch></a> <a name="directorymatch" id="directorymatch">Directive</a></h2>
  816. <table class="directive">
  817. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enclose directives that apply to
  818. file-system directories matching a regular expression and their
  819. subdirectories</td></tr>
  820. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><DirectoryMatch <var>regex</var>>
  821. ... </DirectoryMatch></code></td></tr>
  822. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  823. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  824. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  825. </table>
  826.     <p><code class="directive"><DirectoryMatch></code> and
  827.     <code></DirectoryMatch></code> are used to enclose a group
  828.     of directives which will apply only to the named directory and
  829.     sub-directories of that directory, the same as <code class="directive"><a href="#directory"><Directory></a></code>. However, it
  830.     takes as an argument a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular 
  831.     expression</a>. For example:</p>
  832.  
  833.     <div class="example"><p><code>
  834.       <DirectoryMatch "^/www/(.+/)?[0-9]{3}">
  835.     </code></p></div>
  836.  
  837.     <p>would match directories in <code>/www/</code> that consisted of three
  838.     numbers.</p>
  839.  
  840. <h3>See also</h3>
  841. <ul>
  842. <li><code class="directive"><a href="#directory"><Directory></a></code> for
  843. a description of how regular expressions are mixed in with normal
  844. <code class="directive"><Directory></code>s</li>
  845. <li><a href="../sections.html">How <Directory>, <Location> and
  846. <Files> sections work</a> for an explanation of how these different
  847. sections are combined when a request is received</li>
  848. </ul>
  849. </div>
  850. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  851. <div class="directive-section"><h2><a name="DocumentRoot" id="DocumentRoot">DocumentRoot</a> <a name="documentroot" id="documentroot">Directive</a></h2>
  852. <table class="directive">
  853. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Directory that forms the main document tree visible
  854. from the web</td></tr>
  855. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>DocumentRoot <var>directory-path</var></code></td></tr>
  856. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>DocumentRoot /usr/local/apache/htdocs</code></td></tr>
  857. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  858. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  859. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  860. </table>
  861.     <p>This directive sets the directory from which <code class="program"><a href="../programs/httpd.html">httpd</a></code>
  862.     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
  863.     path from the requested URL to the document root to make the
  864.     path to the document. Example:</p>
  865.  
  866.     <div class="example"><p><code>
  867.       DocumentRoot /usr/web
  868.     </code></p></div>
  869.  
  870.     <p>then an access to
  871.     <code>http://www.my.host.com/index.html</code> refers to
  872.     <code>/usr/web/index.html</code>. If the <var>directory-path</var> is 
  873.     not absolute then it is assumed to be relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
  874.  
  875.     <p>The <code class="directive">DocumentRoot</code> should be specified without
  876.     a trailing slash.</p>
  877.  
  878. <h3>See also</h3>
  879. <ul>
  880. <li><a href="../urlmapping.html">Mapping URLs to Filesystem
  881. Location</a></li>
  882. </ul>
  883. </div>
  884. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  885. <div class="directive-section"><h2><a name="EnableMMAP" id="EnableMMAP">EnableMMAP</a> <a name="enablemmap" id="enablemmap">Directive</a></h2>
  886. <table class="directive">
  887. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Use memory-mapping to read files during delivery</td></tr>
  888. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableMMAP On|Off</code></td></tr>
  889. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableMMAP On</code></td></tr>
  890. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  891. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  892. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  893. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  894. </table>
  895.     <p>This directive controls whether the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use
  896.     memory-mapping if it needs to read the contents of a file during
  897.     delivery.  By default, when the handling of a request requires
  898.     access to the data within a file -- for example, when delivering a
  899.     server-parsed file using <code class="module"><a href="../mod/mod_include.html">mod_include</a></code> -- Apache
  900.     memory-maps the file if the OS supports it.</p>
  901.  
  902.     <p>This memory-mapping sometimes yields a performance improvement.
  903.     But in some environments, it is better to disable the memory-mapping
  904.     to prevent operational problems:</p>
  905.  
  906.     <ul>
  907.     <li>On some multiprocessor systems, memory-mapping can reduce the
  908.     performance of the <code class="program"><a href="../programs/httpd.html">httpd</a></code>.</li>
  909.     <li>With an NFS-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code>,
  910.     the <code class="program"><a href="../programs/httpd.html">httpd</a></code> may crash due to a segmentation fault if a file
  911.     is deleted or truncated while the <code class="program"><a href="../programs/httpd.html">httpd</a></code> has it
  912.     memory-mapped.</li>
  913.     </ul>
  914.  
  915.     <p>For server configurations that are vulnerable to these problems,
  916.     you should disable memory-mapping of delivered files by specifying:</p>
  917.  
  918.     <div class="example"><p><code>
  919.       EnableMMAP Off
  920.     </code></p></div>
  921.  
  922.     <p>For NFS mounted files, this feature may be disabled explicitly for
  923.     the offending files by specifying:</p>
  924.  
  925.     <div class="example"><p><code>
  926.       <Directory "/path-to-nfs-files">
  927.       <span class="indent">
  928.         EnableMMAP Off
  929.       </span>
  930.       </Directory>
  931.     </code></p></div>
  932.  
  933. </div>
  934. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  935. <div class="directive-section"><h2><a name="EnableSendfile" id="EnableSendfile">EnableSendfile</a> <a name="enablesendfile" id="enablesendfile">Directive</a></h2>
  936. <table class="directive">
  937. <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>
  938. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>EnableSendfile On|Off</code></td></tr>
  939. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>EnableSendfile On</code></td></tr>
  940. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  941. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  942. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  943. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  944. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in version 2.0.44 and later</td></tr>
  945. </table>
  946.     <p>This directive controls whether <code class="program"><a href="../programs/httpd.html">httpd</a></code> may use the
  947.     sendfile support from the kernel to transmit file contents to the client.
  948.     By default, when the handling of a request requires no access
  949.     to the data within a file -- for example, when delivering a
  950.     static file -- Apache uses sendfile to deliver the file contents
  951.     without ever reading the file if the OS supports it.</p>
  952.  
  953.     <p>This sendfile mechanism avoids separate read and send operations,
  954.     and buffer allocations. But on some platforms or within some
  955.     filesystems, it is better to disable this feature to avoid
  956.     operational problems:</p>
  957.  
  958.     <ul>
  959.     <li>Some platforms may have broken sendfile support that the build
  960.     system did not detect, especially if the binaries were built on
  961.     another box and moved to such a machine with broken sendfile
  962.     support.</li>
  963.     <li>On Linux the use of sendfile triggers TCP-checksum
  964.     offloading bugs on certain networking cards when using IPv6.</li>
  965.     <li>On Linux on Itanium, sendfile may be unable to handle files
  966.     over 2GB in size.</li>
  967.     <li>With a network-mounted <code class="directive"><a href="#documentroot">DocumentRoot</a></code> (e.g., NFS or SMB),
  968.     the kernel may be unable to serve the network file through
  969.     its own cache.</li>
  970.     </ul>
  971.  
  972.     <p>For server configurations that are vulnerable to these problems,
  973.     you should disable this feature by specifying:</p>
  974.  
  975.     <div class="example"><p><code>
  976.       EnableSendfile Off
  977.     </code></p></div>
  978.  
  979.     <p>For NFS or SMB mounted files, this feature may be disabled explicitly
  980.     for the offending files by specifying:</p>
  981.  
  982.     <div class="example"><p><code>
  983.       <Directory "/path-to-nfs-files">
  984.       <span class="indent">
  985.         EnableSendfile Off
  986.       </span>
  987.       </Directory>
  988.     </code></p></div>
  989.  
  990. </div>
  991. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  992. <div class="directive-section"><h2><a name="ErrorDocument" id="ErrorDocument">ErrorDocument</a> <a name="errordocument" id="errordocument">Directive</a></h2>
  993. <table class="directive">
  994. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>What the server will return to the client
  995. in case of an error</td></tr>
  996. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ErrorDocument <var>error-code</var> <var>document</var></code></td></tr>
  997. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  998. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  999. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1000. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1001. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Quoting syntax for text messages is different in Apache
  1002. 2.0</td></tr>
  1003. </table>
  1004.     <p>In the event of a problem or error, Apache can be configured
  1005.     to do one of four things,</p>
  1006.  
  1007.     <ol>
  1008.       <li>output a simple hardcoded error message</li>
  1009.  
  1010.       <li>output a customized message</li>
  1011.  
  1012.       <li>redirect to a local <var>URL-path</var> to handle the
  1013.       problem/error</li>
  1014.  
  1015.       <li>redirect to an external <var>URL</var> to handle the
  1016.       problem/error</li>
  1017.     </ol>
  1018.  
  1019.     <p>The first option is the default, while options 2-4 are
  1020.     configured using the <code class="directive">ErrorDocument</code>
  1021.     directive, which is followed by the HTTP response code and a URL
  1022.     or a message. Apache will sometimes offer additional information
  1023.     regarding the problem/error.</p>
  1024.  
  1025.     <p>URLs can begin with a slash (/) for local web-paths (relative
  1026.     to the <code class="directive"><a href="#documentroot">DocumentRoot</a></code>), or be a
  1027.     full URL which the client can resolve. Alternatively, a message
  1028.     can be provided to be displayed by the browser. Examples:</p>
  1029.  
  1030.     <div class="example"><p><code>
  1031.       ErrorDocument 500 http://foo.example.com/cgi-bin/tester<br />
  1032.       ErrorDocument 404 /cgi-bin/bad_urls.pl<br />
  1033.       ErrorDocument 401 /subscription_info.html<br />
  1034.       ErrorDocument 403 "Sorry can't allow you access today"
  1035.     </code></p></div>
  1036.  
  1037.     <p>Additionally, the special value <code>default</code> can be used
  1038.     to specify Apache's simple hardcoded message.  While not required
  1039.     under normal circumstances, <code>default</code> will restore
  1040.     Apache's simple hardcoded message for configurations that would
  1041.     otherwise inherit an existing <code class="directive">ErrorDocument</code>.</p>
  1042.  
  1043.     <div class="example"><p><code>
  1044.       ErrorDocument 404 /cgi-bin/bad_urls.pl<br /><br />
  1045.       <Directory /web/docs><br />
  1046.       <span class="indent">
  1047.         ErrorDocument 404 default<br />
  1048.       </span>
  1049.       </Directory>
  1050.     </code></p></div>
  1051.  
  1052.     <p>Note that when you specify an <code class="directive">ErrorDocument</code>
  1053.     that points to a remote URL (ie. anything with a method such as
  1054.     <code>http</code> in front of it), Apache will send a redirect to the
  1055.     client to tell it where to find the document, even if the
  1056.     document ends up being on the same server. This has several
  1057.     implications, the most important being that the client will not
  1058.     receive the original error status code, but instead will
  1059.     receive a redirect status code. This in turn can confuse web
  1060.     robots and other clients which try to determine if a URL is
  1061.     valid using the status code. In addition, if you use a remote
  1062.     URL in an <code>ErrorDocument 401</code>, the client will not
  1063.     know to prompt the user for a password since it will not
  1064.     receive the 401 status code. Therefore, <strong>if you use an
  1065.     <code>ErrorDocument 401</code> directive then it must refer to a local
  1066.     document.</strong></p>
  1067.  
  1068.     <p>Microsoft Internet Explorer (MSIE) will by default ignore
  1069.     server-generated error messages when they are "too small" and substitute
  1070.     its own "friendly" error messages. The size threshold varies depending on
  1071.     the type of error, but in general, if you make your error document
  1072.     greater than 512 bytes, then MSIE will show the server-generated
  1073.     error rather than masking it.  More information is available in
  1074.     Microsoft Knowledge Base article <a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;Q294807">Q294807</a>.</p>
  1075.  
  1076.     <p>Although most error messages can be overriden, there are certain
  1077.     circumstances where the internal messages are used regardless of the
  1078.     setting of <code class="directive"><a href="#errordocument">ErrorDocument</a></code>.  In
  1079.     particular, if a malformed request is detected, normal request processing
  1080.     will be immediately halted and the internal error message returned.
  1081.     This is necessary to guard against security problems caused by
  1082.     bad requests.</p>
  1083.  
  1084.     <p>Prior to version 2.0, messages were indicated by prefixing
  1085.     them with a single unmatched double quote character.</p>
  1086.  
  1087. <h3>See also</h3>
  1088. <ul>
  1089. <li><a href="../custom-error.html">documentation of
  1090.     customizable responses</a></li>
  1091. </ul>
  1092. </div>
  1093. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1094. <div class="directive-section"><h2><a name="ErrorLog" id="ErrorLog">ErrorLog</a> <a name="errorlog" id="errorlog">Directive</a></h2>
  1095. <table class="directive">
  1096. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Location where the server will log errors</td></tr>
  1097. <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>
  1098. <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>
  1099. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1100. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1101. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1102. </table>
  1103.     <p>The <code class="directive">ErrorLog</code> directive sets the name of
  1104.     the file to which the server will log any errors it encounters. If
  1105.     the <var>file-path</var> is not absolute then it is assumed to be 
  1106.     relative to the <code class="directive"><a href="#serverroot">ServerRoot</a></code>.</p>
  1107.  
  1108.     <div class="example"><h3>Example</h3><p><code>
  1109.     ErrorLog /var/log/httpd/error_log
  1110.     </code></p></div>
  1111.  
  1112.     <p>If the <var>file-path</var>
  1113.     begins with a pipe (|) then it is assumed to be a command to spawn
  1114.     to handle the error log.</p>
  1115.  
  1116.     <div class="example"><h3>Example</h3><p><code>
  1117.     ErrorLog "|/usr/local/bin/httpd_errors"
  1118.     </code></p></div>
  1119.  
  1120.     <p>Using <code>syslog</code> instead of a filename enables logging
  1121.     via syslogd(8) if the system supports it. The default is to use
  1122.     syslog facility <code>local7</code>, but you can override this by
  1123.     using the <code>syslog:<var>facility</var></code> syntax where
  1124.     <var>facility</var> can be one of the names usually documented in
  1125.     syslog(1).</p>
  1126.  
  1127.     <div class="example"><h3>Example</h3><p><code>
  1128.     ErrorLog syslog:user
  1129.     </code></p></div>
  1130.  
  1131.     <p>SECURITY: See the <a href="../misc/security_tips.html#serverroot">security tips</a>
  1132.     document for details on why your security could be compromised
  1133.     if the directory where log files are stored is writable by
  1134.     anyone other than the user that starts the server.</p>
  1135.     <div class="warning"><h3>Note</h3>
  1136.       <p>When entering a file path on non-Unix platforms, care should be taken
  1137.       to make sure that only forward slashed are used even though the platform
  1138.       may allow the use of back slashes. In general it is a good idea to always 
  1139.       use forward slashes throughout the configuration files.</p>
  1140.     </div>
  1141.  
  1142. <h3>See also</h3>
  1143. <ul>
  1144. <li><code class="directive"><a href="#loglevel">LogLevel</a></code></li>
  1145. <li><a href="../logs.html">Apache Log Files</a></li>
  1146. </ul>
  1147. </div>
  1148. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1149. <div class="directive-section"><h2><a name="FileETag" id="FileETag">FileETag</a> <a name="fileetag" id="fileetag">Directive</a></h2>
  1150. <table class="directive">
  1151. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>File attributes used to create the ETag
  1152. HTTP response header</td></tr>
  1153. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>FileETag <var>component</var> ...</code></td></tr>
  1154. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>FileETag INode MTime Size</code></td></tr>
  1155. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  1156. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  1157. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1158. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1159. </table>
  1160.     <p>
  1161.     The <code class="directive">FileETag</code> directive configures the file
  1162.     attributes that are used to create the <code>ETag</code> (entity
  1163.     tag) response header field when the document is based on a file.
  1164.     (The <code>ETag</code> value is used in cache management to save
  1165.     network bandwidth.) In Apache 1.3.22 and earlier, the
  1166.     <code>ETag</code> value was <em>always</em> formed
  1167.     from the file's inode, size, and last-modified time (mtime). The
  1168.     <code class="directive">FileETag</code> directive allows you to choose
  1169.     which of these -- if any -- should be used. The recognized keywords are:
  1170.     </p>
  1171.  
  1172.     <dl>
  1173.      <dt><strong>INode</strong></dt>
  1174.      <dd>The file's i-node number will be included in the calculation</dd>
  1175.      <dt><strong>MTime</strong></dt>
  1176.      <dd>The date and time the file was last modified will be included</dd>
  1177.      <dt><strong>Size</strong></dt>
  1178.      <dd>The number of bytes in the file will be included</dd>
  1179.      <dt><strong>All</strong></dt>
  1180.      <dd>All available fields will be used. This is equivalent to:
  1181.          <div class="example"><p><code>FileETag INode MTime Size</code></p></div></dd>
  1182.      <dt><strong>None</strong></dt>
  1183.      <dd>If a document is file-based, no <code>ETag</code> field will be
  1184.        included in the response</dd>
  1185.     </dl>
  1186.  
  1187.     <p>The <code>INode</code>, <code>MTime</code>, and <code>Size</code>
  1188.     keywords may be prefixed with either <code>+</code> or <code>-</code>,
  1189.     which allow changes to be made to the default setting inherited
  1190.     from a broader scope. Any keyword appearing without such a prefix
  1191.     immediately and completely cancels the inherited setting.</p>
  1192.  
  1193.     <p>If a directory's configuration includes
  1194.     <code>FileETag INode MTime Size</code>, and a
  1195.     subdirectory's includes <code>FileETag -INode</code>,
  1196.     the setting for that subdirectory (which will be inherited by
  1197.     any sub-subdirectories that don't override it) will be equivalent to
  1198.     <code>FileETag MTime Size</code>.</p>
  1199.     <div class="warning"><h3>Warning</h3>
  1200.     Do not change the default for directories or locations that have WebDAV
  1201.     enabled and use <code class="module"><a href="../mod/mod_dav_fs.html">mod_dav_fs</a></code> as a storage provider.
  1202.     <code class="module"><a href="../mod/mod_dav_fs.html">mod_dav_fs</a></code> uses <code>INode MTime Size</code>
  1203.     as a fixed format for <code>ETag</code> comparisons on conditional requests.
  1204.     These conditional requests will break if the <code>ETag</code> format is
  1205.     changed via <code class="directive">FileETag</code>.
  1206.     </div>
  1207.  
  1208. </div>
  1209. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1210. <div class="directive-section"><h2><a name="Files" id="Files"><Files></a> <a name="files" id="files">Directive</a></h2>
  1211. <table class="directive">
  1212. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to matched
  1213. filenames</td></tr>
  1214. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Files <var>filename</var>> ... </Files></code></td></tr>
  1215. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  1216. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  1217. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1218. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1219. </table>
  1220.     <p>The <code class="directive"><Files></code> directive
  1221.     limits the scope of the enclosed directives by filename. It is comparable
  1222.     to the <code class="directive"><a href="#directory"><Directory></a></code>
  1223.     and <code class="directive"><a href="#location"><Location></a></code>
  1224.     directives. It should be matched with a <code></Files></code>
  1225.     directive. The directives given within this section will be applied to
  1226.     any object with a basename (last component of filename) matching the
  1227.     specified filename. <code class="directive"><Files></code>
  1228.     sections are processed in the order they appear in the
  1229.     configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
  1230.     <code>.htaccess</code> files are read, but before <code class="directive"><a href="#location"><Location></a></code> sections. Note
  1231.     that <code class="directive"><Files></code> can be nested
  1232.     inside <code class="directive"><a href="#directory"><Directory></a></code> sections to restrict the
  1233.     portion of the filesystem they apply to.</p>
  1234.  
  1235.     <p>The <var>filename</var> argument should include a filename, or
  1236.     a wild-card string, where <code>?</code> matches any single character,
  1237.     and <code>*</code> matches any sequences of characters.
  1238.     <a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular expressions</a> 
  1239.     can also be used, with the addition of the
  1240.     <code>~</code> character. For example:</p>
  1241.  
  1242.     <div class="example"><p><code>
  1243.       <Files ~ "\.(gif|jpe?g|png)$">
  1244.     </code></p></div>
  1245.  
  1246.     <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch"><FilesMatch></a></code> is preferred,
  1247.     however.</p>
  1248.  
  1249.     <p>Note that unlike <code class="directive"><a href="#directory"><Directory></a></code> and <code class="directive"><a href="#location"><Location></a></code> sections, <code class="directive"><Files></code> sections can be used inside
  1250.     <code>.htaccess</code> files. This allows users to control access to
  1251.     their own files, at a file-by-file level.</p>
  1252.  
  1253.  
  1254. <h3>See also</h3>
  1255. <ul>
  1256. <li><a href="../sections.html">How <Directory>, <Location>
  1257.     and <Files> sections work</a> for an explanation of how these
  1258.     different sections are combined when a request is received</li>
  1259. </ul>
  1260. </div>
  1261. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1262. <div class="directive-section"><h2><a name="FilesMatch" id="FilesMatch"><FilesMatch></a> <a name="filesmatch" id="filesmatch">Directive</a></h2>
  1263. <table class="directive">
  1264. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply to regular-expression matched
  1265. filenames</td></tr>
  1266. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><FilesMatch <var>regex</var>> ... </FilesMatch></code></td></tr>
  1267. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  1268. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  1269. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1270. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1271. </table>
  1272.     <p>The <code class="directive"><FilesMatch></code> directive
  1273.     limits the scope of the enclosed directives by filename, just as the
  1274.     <code class="directive"><a href="#files"><Files></a></code> directive
  1275.     does. However, it accepts a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular 
  1276.     expression</a>. For example:</p>
  1277.  
  1278.     <div class="example"><p><code>
  1279.       <FilesMatch "\.(gif|jpe?g|png)$">
  1280.     </code></p></div>
  1281.  
  1282.     <p>would match most common Internet graphics formats.</p>
  1283.  
  1284. <h3>See also</h3>
  1285. <ul>
  1286. <li><a href="../sections.html">How <Directory>, <Location>
  1287.     and <Files> sections work</a> for an explanation of how these
  1288.     different sections are combined when a request is received</li>
  1289. </ul>
  1290. </div>
  1291. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1292. <div class="directive-section"><h2><a name="ForceType" id="ForceType">ForceType</a> <a name="forcetype" id="forcetype">Directive</a></h2>
  1293. <table class="directive">
  1294. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be served with the specified
  1295. MIME content-type</td></tr>
  1296. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ForceType <var>MIME-type</var>|None</code></td></tr>
  1297. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  1298. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  1299. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1300. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1301. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved to the core in Apache 2.0</td></tr>
  1302. </table>
  1303.     <p>When placed into an <code>.htaccess</code> file or a
  1304.     <code class="directive"><a href="#directory"><Directory></a></code>, or
  1305.     <code class="directive"><a href="#location"><Location></a></code> or
  1306.     <code class="directive"><a href="#files"><Files></a></code>
  1307.     section, this directive forces all matching files to be served
  1308.     with the content type identification given by
  1309.     <var>MIME-type</var>. For example, if you had a directory full of
  1310.     GIF files, but did not want to label them all with <code>.gif</code>,
  1311.     you might want to use:</p>
  1312.  
  1313.     <div class="example"><p><code>
  1314.       ForceType image/gif
  1315.     </code></p></div>
  1316.  
  1317.     <p>Note that unlike <code class="directive"><a href="#defaulttype">DefaultType</a></code>,
  1318.     this directive overrides all mime-type associations, including
  1319.     filename extensions, that might identify the media type.</p>
  1320.  
  1321.     <p>You can override any <code class="directive">ForceType</code> setting
  1322.     by using the value of <code>None</code>:</p>
  1323.  
  1324.     <div class="example"><p><code>
  1325.       # force all files to be image/gif:<br />
  1326.       <Location /images><br />
  1327.         <span class="indent">
  1328.           ForceType image/gif<br />
  1329.         </span>
  1330.       </Location><br />
  1331.       <br />
  1332.       # but normal mime-type associations here:<br />
  1333.       <Location /images/mixed><br />
  1334.       <span class="indent">
  1335.         ForceType None<br />
  1336.       </span>
  1337.       </Location>
  1338.     </code></p></div>
  1339.  
  1340. </div>
  1341. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1342. <div class="directive-section"><h2><a name="HostnameLookups" id="HostnameLookups">HostnameLookups</a> <a name="hostnamelookups" id="hostnamelookups">Directive</a></h2>
  1343. <table class="directive">
  1344. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables DNS lookups on client IP addresses</td></tr>
  1345. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>HostnameLookups On|Off|Double</code></td></tr>
  1346. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>HostnameLookups Off</code></td></tr>
  1347. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
  1348. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1349. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1350. </table>
  1351.     <p>This directive enables DNS lookups so that host names can be
  1352.     logged (and passed to CGIs/SSIs in <code>REMOTE_HOST</code>).
  1353.     The value <code>Double</code> refers to doing double-reverse
  1354.     DNS lookup. That is, after a reverse lookup is performed, a forward
  1355.     lookup is then performed on that result. At least one of the IP
  1356.     addresses in the forward lookup must match the original
  1357.     address. (In "tcpwrappers" terminology this is called
  1358.     <code>PARANOID</code>.)</p>
  1359.  
  1360.     <p>Regardless of the setting, when <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code> is
  1361.     used for controlling access by hostname, a double reverse lookup
  1362.     will be performed.  This is necessary for security. Note that the
  1363.     result of this double-reverse isn't generally available unless you
  1364.     set <code>HostnameLookups Double</code>. For example, if only
  1365.     <code>HostnameLookups On</code> and a request is made to an object
  1366.     that is protected by hostname restrictions, regardless of whether
  1367.     the double-reverse fails or not, CGIs will still be passed the
  1368.     single-reverse result in <code>REMOTE_HOST</code>.</p>
  1369.  
  1370.     <p>The default is <code>Off</code> in order to save the network
  1371.     traffic for those sites that don't truly need the reverse
  1372.     lookups done. It is also better for the end users because they
  1373.     don't have to suffer the extra latency that a lookup entails.
  1374.     Heavily loaded sites should leave this directive
  1375.     <code>Off</code>, since DNS lookups can take considerable
  1376.     amounts of time. The utility <code class="program"><a href="../programs/logresolve.html">logresolve</a></code>, compiled by
  1377.     default to the <code>bin</code> subdirectory of your installation
  1378.     directory, can be used to look up host names from logged IP addresses
  1379.     offline.</p>
  1380.  
  1381. </div>
  1382. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1383. <div class="directive-section"><h2><a name="IfDefine" id="IfDefine"><IfDefine></a> <a name="ifdefine" id="ifdefine">Directive</a></h2>
  1384. <table class="directive">
  1385. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that will be processed only
  1386. if a test is true at startup</td></tr>
  1387. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><IfDefine [!]<var>parameter-name</var>> ...
  1388.     </IfDefine></code></td></tr>
  1389. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  1390. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  1391. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1392. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1393. </table>
  1394.     <p>The <code><IfDefine <var>test</var>>...</IfDefine>
  1395.     </code> section is used to mark directives that are conditional. The
  1396.     directives within an <code class="directive"><IfDefine></code>
  1397.     section are only processed if the <var>test</var> is true. If <var>
  1398.     test</var> is false, everything between the start and end markers is
  1399.     ignored.</p>
  1400.  
  1401.     <p>The <var>test</var> in the <code class="directive"><IfDefine></code> section directive can be one of two forms:</p>
  1402.  
  1403.     <ul>
  1404.       <li><var>parameter-name</var></li>
  1405.  
  1406.       <li><code>!</code><var>parameter-name</var></li>
  1407.     </ul>
  1408.  
  1409.     <p>In the former case, the directives between the start and end
  1410.     markers are only processed if the parameter named
  1411.     <var>parameter-name</var> is defined. The second format reverses
  1412.     the test, and only processes the directives if
  1413.     <var>parameter-name</var> is <strong>not</strong> defined.</p>
  1414.  
  1415.     <p>The <var>parameter-name</var> argument is a define as given on
  1416.     the <code class="program"><a href="../programs/httpd.html">httpd</a></code> command line via <code>-D<var>parameter-</var>
  1417.     </code>, at the time the server was started.</p>
  1418.  
  1419.     <p><code class="directive"><IfDefine></code> sections are
  1420.     nest-able, which can be used to implement simple
  1421.     multiple-parameter tests. Example:</p>
  1422.  
  1423.     <div class="example"><p><code>
  1424.       httpd -DReverseProxy ...<br />
  1425.       <br />
  1426.       # httpd.conf<br />
  1427.       <IfDefine ReverseProxy><br />
  1428.       <span class="indent">
  1429.         LoadModule rewrite_module modules/mod_rewrite.so<br />
  1430.         LoadModule proxy_module   modules/libproxy.so<br />
  1431.       </span>
  1432.       </IfDefine>
  1433.     </code></p></div>
  1434.  
  1435. </div>
  1436. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1437. <div class="directive-section"><h2><a name="IfModule" id="IfModule"><IfModule></a> <a name="ifmodule" id="ifmodule">Directive</a></h2>
  1438. <table class="directive">
  1439. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Encloses directives that are processed conditional on the
  1440. presence or absence of a specific module</td></tr>
  1441. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><IfModule [!]<var>module-file</var>|<var>module-identifier</var>> ...
  1442.     </IfModule></code></td></tr>
  1443. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  1444. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  1445. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1446. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1447. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Module identifiers are available in version 2.1 and
  1448. later.</td></tr>
  1449. </table>
  1450.     <p>The <code><IfModule <var>test</var>>...</IfModule></code>
  1451.     section is used to mark directives that are conditional on the presence of
  1452.     a specific module. The directives within an <code class="directive"><IfModule></code> section are only processed if the <var>test</var>
  1453.     is true. If <var>test</var> is false, everything between the start and
  1454.     end markers is ignored.</p>
  1455.  
  1456.     <p>The <var>test</var> in the <code class="directive"><IfModule></code> section directive can be one of two forms:</p>
  1457.  
  1458.     <ul>
  1459.       <li><var>module</var></li>
  1460.  
  1461.       <li>!<var>module</var></li>
  1462.     </ul>
  1463.  
  1464.     <p>In the former case, the directives between the start and end
  1465.     markers are only processed if the module named <var>module</var>
  1466.     is included in Apache -- either compiled in or
  1467.     dynamically loaded using <code class="directive"><a href="../mod/mod_so.html#loadmodule">LoadModule</a></code>. The second format reverses the test,
  1468.     and only processes the directives if <var>module</var> is
  1469.     <strong>not</strong> included.</p>
  1470.  
  1471.     <p>The <var>module</var> argument can be either the module identifier or
  1472.     the file name of the module, at the time it was compiled.  For example,
  1473.     <code>rewrite_module</code> is the identifier and
  1474.     <code>mod_rewrite.c</code> is the file name. If a module consists of
  1475.     several source files, use the name of the file containing the string
  1476.     <code>STANDARD20_MODULE_STUFF</code>.</p>
  1477.  
  1478.     <p><code class="directive"><IfModule></code> sections are
  1479.     nest-able, which can be used to implement simple multiple-module
  1480.     tests.</p>
  1481.  
  1482.     <div class="note">This section should only be used if you need to have one
  1483.     configuration file that works whether or not a specific module
  1484.     is available. In normal operation, directives need not be
  1485.     placed in <code class="directive"><IfModule></code>
  1486.     sections.</div>
  1487.  
  1488. </div>
  1489. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1490. <div class="directive-section"><h2><a name="Include" id="Include">Include</a> <a name="include" id="include">Directive</a></h2>
  1491. <table class="directive">
  1492. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Includes other configuration files from within
  1493. the server configuration files</td></tr>
  1494. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Include <var>file-path</var>|<var>directory-path</var></code></td></tr>
  1495. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
  1496. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1497. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1498. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Wildcard matching available in 2.0.41 and later</td></tr>
  1499. </table>
  1500.     <p>This directive allows inclusion of other configuration files
  1501.     from within the server configuration files.</p>
  1502.  
  1503.     <p>Shell-style (<code>fnmatch()</code>) wildcard characters can be used to
  1504.     include several files at once, in alphabetical order. In
  1505.     addition, if <code class="directive">Include</code> points to a directory,
  1506.     rather than a file, Apache will read all files in that directory
  1507.     and any subdirectory.  But including entire directories is not
  1508.     recommended, because it is easy to accidentally leave temporary
  1509.     files in a directory that can cause <code class="program"><a href="../programs/httpd.html">httpd</a></code> to
  1510.     fail.</p>
  1511.  
  1512.     <p>The file path specified may be an absolute path, or may be relative 
  1513.     to the <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory.</p>
  1514.  
  1515.     <p>Examples:</p>
  1516.  
  1517.     <div class="example"><p><code>
  1518.       Include /usr/local/apache2/conf/ssl.conf<br />
  1519.       Include /usr/local/apache2/conf/vhosts/*.conf
  1520.     </code></p></div>
  1521.  
  1522.     <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p>
  1523.  
  1524.     <div class="example"><p><code>
  1525.       Include conf/ssl.conf<br />
  1526.       Include conf/vhosts/*.conf
  1527.     </code></p></div>
  1528.  
  1529.     <p>Running <code>apachectl configtest</code> will give you a list
  1530.     of the files that are being processed during the configuration
  1531.     check:</p>
  1532.  
  1533.     <div class="example"><p><code>
  1534.       root@host# apachectl configtest<br />
  1535.       Processing config file: /usr/local/apache2/conf/ssl.conf<br />
  1536.       Processing config file: /usr/local/apache2/conf/vhosts/vhost1.conf<br />
  1537.       Processing config file: /usr/local/apache2/conf/vhosts/vhost2.conf<br />
  1538.       Syntax OK
  1539.     </code></p></div>
  1540.  
  1541. <h3>See also</h3>
  1542. <ul>
  1543. <li><code class="program"><a href="../programs/apachectl.html">apachectl</a></code></li>
  1544. </ul>
  1545. </div>
  1546. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1547. <div class="directive-section"><h2><a name="KeepAlive" id="KeepAlive">KeepAlive</a> <a name="keepalive" id="keepalive">Directive</a></h2>
  1548. <table class="directive">
  1549. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Enables HTTP persistent connections</td></tr>
  1550. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAlive On|Off</code></td></tr>
  1551. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAlive On</code></td></tr>
  1552. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1553. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1554. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1555. </table>
  1556.     <p>The Keep-Alive extension to HTTP/1.0 and the persistent
  1557.     connection feature of HTTP/1.1 provide long-lived HTTP sessions
  1558.     which allow multiple requests to be sent over the same TCP
  1559.     connection. In some cases this has been shown to result in an
  1560.     almost 50% speedup in latency times for HTML documents with
  1561.     many images. To enable Keep-Alive connections, set
  1562.     <code>KeepAlive On</code>.</p>
  1563.  
  1564.     <p>For HTTP/1.0 clients, Keep-Alive connections will only be
  1565.     used if they are specifically requested by a client. In
  1566.     addition, a Keep-Alive connection with an HTTP/1.0 client can
  1567.     only be used when the length of the content is known in
  1568.     advance. This implies that dynamic content such as CGI output,
  1569.     SSI pages, and server-generated directory listings will
  1570.     generally not use Keep-Alive connections to HTTP/1.0 clients.
  1571.     For HTTP/1.1 clients, persistent connections are the default
  1572.     unless otherwise specified. If the client requests it, chunked
  1573.     encoding will be used in order to send content of unknown
  1574.     length over persistent connections.</p>
  1575.  
  1576. <h3>See also</h3>
  1577. <ul>
  1578. <li><code class="directive"><a href="#maxkeepaliverequests">MaxKeepAliveRequests</a></code></li>
  1579. </ul>
  1580. </div>
  1581. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1582. <div class="directive-section"><h2><a name="KeepAliveTimeout" id="KeepAliveTimeout">KeepAliveTimeout</a> <a name="keepalivetimeout" id="keepalivetimeout">Directive</a></h2>
  1583. <table class="directive">
  1584. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for subsequent
  1585. requests on a persistent connection</td></tr>
  1586. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>KeepAliveTimeout <var>seconds</var></code></td></tr>
  1587. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>KeepAliveTimeout 5</code></td></tr>
  1588. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1589. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1590. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1591. </table>
  1592.     <p>The number of seconds Apache will wait for a subsequent
  1593.     request before closing the connection. Once a request has been
  1594.     received, the timeout value specified by the
  1595.     <code class="directive"><a href="#timeout">Timeout</a></code> directive applies.</p>
  1596.  
  1597.     <p>Setting <code class="directive">KeepAliveTimeout</code> to a high value
  1598.     may cause performance problems in heavily loaded servers. The
  1599.     higher the timeout, the more server processes will be kept
  1600.     occupied waiting on connections with idle clients.</p>
  1601.  
  1602. </div>
  1603. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1604. <div class="directive-section"><h2><a name="Limit" id="Limit"><Limit></a> <a name="limit" id="limit">Directive</a></h2>
  1605. <table class="directive">
  1606. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict enclosed access controls to only certain HTTP
  1607. methods</td></tr>
  1608. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Limit <var>method</var> [<var>method</var>] ... > ...
  1609.     </Limit></code></td></tr>
  1610. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  1611. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  1612. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1613. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1614. </table>
  1615.     <p>Access controls are normally effective for
  1616.     <strong>all</strong> access methods, and this is the usual
  1617.     desired behavior. <strong>In the general case, access control
  1618.     directives should not be placed within a
  1619.     <code class="directive"><Limit></code> section.</strong></p>
  1620.  
  1621.     <p>The purpose of the <code class="directive"><Limit></code>
  1622.     directive is to restrict the effect of the access controls to the
  1623.     nominated HTTP methods. For all other methods, the access
  1624.     restrictions that are enclosed in the <code class="directive"><Limit></code> bracket <strong>will have no
  1625.     effect</strong>. The following example applies the access control
  1626.     only to the methods <code>POST</code>, <code>PUT</code>, and
  1627.     <code>DELETE</code>, leaving all other methods unprotected:</p>
  1628.  
  1629.     <div class="example"><p><code>
  1630.       <Limit POST PUT DELETE><br />
  1631.       <span class="indent">
  1632.         Require valid-user<br />
  1633.       </span>
  1634.       </Limit>
  1635.     </code></p></div>
  1636.  
  1637.     <p>The method names listed can be one or more of: <code>GET</code>,
  1638.     <code>POST</code>, <code>PUT</code>, <code>DELETE</code>,
  1639.     <code>CONNECT</code>, <code>OPTIONS</code>,
  1640.     <code>PATCH</code>, <code>PROPFIND</code>, <code>PROPPATCH</code>,
  1641.     <code>MKCOL</code>, <code>COPY</code>, <code>MOVE</code>,
  1642.     <code>LOCK</code>, and <code>UNLOCK</code>. <strong>The method name is
  1643.     case-sensitive.</strong> If <code>GET</code> is used it will also
  1644.     restrict <code>HEAD</code> requests. The <code>TRACE</code> method
  1645.     cannot be limited.</p>
  1646.  
  1647.     <div class="warning">A <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section should always be
  1648.     used in preference to a <code class="directive"><a href="#limit"><Limit></a></code> section when restricting access,
  1649.     since a <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> section provides protection
  1650.     against arbitrary methods.</div>
  1651.  
  1652.  
  1653. </div>
  1654. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1655. <div class="directive-section"><h2><a name="LimitExcept" id="LimitExcept"><LimitExcept></a> <a name="limitexcept" id="limitexcept">Directive</a></h2>
  1656. <table class="directive">
  1657. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restrict access controls to all HTTP methods
  1658. except the named ones</td></tr>
  1659. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><LimitExcept <var>method</var> [<var>method</var>] ... > ...
  1660.     </LimitExcept></code></td></tr>
  1661. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  1662. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  1663. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1664. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1665. </table>
  1666.     <p><code class="directive"><LimitExcept></code> and
  1667.     <code></LimitExcept></code> are used to enclose
  1668.     a group of access control directives which will then apply to any
  1669.     HTTP access method <strong>not</strong> listed in the arguments;
  1670.     i.e., it is the opposite of a <code class="directive"><a href="#limit"><Limit></a></code> section and can be used to control
  1671.     both standard and nonstandard/unrecognized methods. See the
  1672.     documentation for <code class="directive"><a href="#limit"><Limit></a></code> for more details.</p>
  1673.  
  1674.     <p>For example:</p>
  1675.  
  1676.     <div class="example"><p><code>
  1677.       <LimitExcept POST GET><br />
  1678.       <span class="indent">
  1679.         Require valid-user<br />
  1680.       </span>
  1681.       </LimitExcept>
  1682.     </code></p></div>
  1683.  
  1684.  
  1685. </div>
  1686. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1687. <div class="directive-section"><h2><a name="LimitInternalRecursion" id="LimitInternalRecursion">LimitInternalRecursion</a> <a name="limitinternalrecursion" id="limitinternalrecursion">Directive</a></h2>
  1688. <table class="directive">
  1689. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determine maximum number of internal redirects and nested
  1690. subrequests</td></tr>
  1691. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitInternalRecursion <var>number</var> [<var>number</var>]</code></td></tr>
  1692. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitInternalRecursion 10</code></td></tr>
  1693. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1694. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1695. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1696. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.0.47 and later</td></tr>
  1697. </table>
  1698.     <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
  1699.     redirects the original request to a CGI script. A subrequest is Apache's
  1700.     mechanism to find out what would happen for some URI if it were requested.
  1701.     For example, <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> uses subrequests to look for the
  1702.     files listed in the <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
  1703.     directive.</p>
  1704.  
  1705.     <p><code class="directive">LimitInternalRecursion</code> prevents the server
  1706.     from crashing when entering an infinite loop of internal redirects or
  1707.     subrequests. Such loops are usually caused by misconfigurations.</p>
  1708.  
  1709.     <p>The directive stores two different limits, which are evaluated on
  1710.     per-request basis. The first <var>number</var> is the maximum number of
  1711.     internal redirects, that may follow each other. The second <var>number</var>
  1712.     determines, how deep subrequests may be nested. If you specify only one
  1713.     <var>number</var>, it will be assigned to both limits.</p>
  1714.  
  1715.     <div class="example"><h3>Example</h3><p><code>
  1716.       LimitInternalRecursion 5
  1717.     </code></p></div>
  1718.  
  1719. </div>
  1720. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1721. <div class="directive-section"><h2><a name="LimitRequestBody" id="LimitRequestBody">LimitRequestBody</a> <a name="limitrequestbody" id="limitrequestbody">Directive</a></h2>
  1722. <table class="directive">
  1723. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Restricts the total size of the HTTP request body sent
  1724. from the client</td></tr>
  1725. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestBody <var>bytes</var></code></td></tr>
  1726. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestBody 0</code></td></tr>
  1727. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  1728. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  1729. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1730. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1731. </table>
  1732.     <p>This directive specifies the number of <var>bytes</var> from 0
  1733.     (meaning unlimited) to 2147483647 (2GB) that are allowed in a
  1734.     request body.</p>
  1735.  
  1736.     <p>The <code class="directive">LimitRequestBody</code> directive allows
  1737.     the user to set a limit on the allowed size of an HTTP request
  1738.     message body within the context in which the directive is given
  1739.     (server, per-directory, per-file or per-location). If the client
  1740.     request exceeds that limit, the server will return an error
  1741.     response instead of servicing the request. The size of a normal
  1742.     request message body will vary greatly depending on the nature of
  1743.     the resource and the methods allowed on that resource. CGI scripts
  1744.     typically use the message body for retrieving form information.
  1745.     Implementations of the <code>PUT</code> method will require
  1746.     a value at least as large as any representation that the server
  1747.     wishes to accept for that resource.</p>
  1748.  
  1749.     <p>This directive gives the server administrator greater
  1750.     control over abnormal client request behavior, which may be
  1751.     useful for avoiding some forms of denial-of-service
  1752.     attacks.</p>
  1753.  
  1754.     <p>If, for example, you are permitting file upload to a particular
  1755.     location, and wish to limit the size of the uploaded file to 100K,
  1756.     you might use the following directive:</p>
  1757.  
  1758.     <div class="example"><p><code>
  1759.       LimitRequestBody 102400
  1760.     </code></p></div>
  1761.  
  1762.  
  1763. </div>
  1764. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1765. <div class="directive-section"><h2><a name="LimitRequestFields" id="LimitRequestFields">LimitRequestFields</a> <a name="limitrequestfields" id="limitrequestfields">Directive</a></h2>
  1766. <table class="directive">
  1767. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of HTTP request header fields that
  1768. will be accepted from the client</td></tr>
  1769. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFields <var>number</var></code></td></tr>
  1770. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFields 100</code></td></tr>
  1771. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  1772. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1773. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1774. </table>
  1775.     <p><var>Number</var> is an integer from 0 (meaning unlimited) to
  1776.     32767. The default value is defined by the compile-time
  1777.     constant <code>DEFAULT_LIMIT_REQUEST_FIELDS</code> (100 as
  1778.     distributed).</p>
  1779.  
  1780.     <p>The <code class="directive">LimitRequestFields</code> directive allows
  1781.     the server administrator to modify the limit on the number of
  1782.     request header fields allowed in an HTTP request. A server needs
  1783.     this value to be larger than the number of fields that a normal
  1784.     client request might include. The number of request header fields
  1785.     used by a client rarely exceeds 20, but this may vary among
  1786.     different client implementations, often depending upon the extent
  1787.     to which a user has configured their browser to support detailed
  1788.     content negotiation. Optional HTTP extensions are often expressed
  1789.     using request header fields.</p>
  1790.  
  1791.     <p>This directive gives the server administrator greater
  1792.     control over abnormal client request behavior, which may be
  1793.     useful for avoiding some forms of denial-of-service attacks.
  1794.     The value should be increased if normal clients see an error
  1795.     response from the server that indicates too many fields were
  1796.     sent in the request.</p>
  1797.  
  1798.     <p>For example:</p>
  1799.  
  1800.     <div class="example"><p><code>
  1801.       LimitRequestFields 50
  1802.     </code></p></div>
  1803.  
  1804.  
  1805. </div>
  1806. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1807. <div class="directive-section"><h2><a name="LimitRequestFieldSize" id="LimitRequestFieldSize">LimitRequestFieldSize</a> <a name="limitrequestfieldsize" id="limitrequestfieldsize">Directive</a></h2>
  1808. <table class="directive">
  1809. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of the HTTP request header allowed from the
  1810. client</td></tr>
  1811. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestFieldsize <var>bytes</var></code></td></tr>
  1812. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestFieldsize 8190</code></td></tr>
  1813. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  1814. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1815. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1816. </table>
  1817.     <p>This directive specifies the number of <var>bytes</var>
  1818.     that will be allowed in an HTTP request header.</p>
  1819.  
  1820.     <p>The <code class="directive">LimitRequestFieldSize</code> directive
  1821.     allows the server administrator to reduce or increase the limit 
  1822.     on the allowed size of an HTTP request header field. A server
  1823.     needs this value to be large enough to hold any one header field 
  1824.     from a normal client request. The size of a normal request header 
  1825.     field will vary greatly among different client implementations, 
  1826.     often depending upon the extent to which a user has configured
  1827.     their browser to support detailed content negotiation. SPNEGO
  1828.     authentication headers can be up to 12392 bytes.</p>
  1829.  
  1830.     <p>This directive gives the server administrator greater
  1831.     control over abnormal client request behavior, which may be
  1832.     useful for avoiding some forms of denial-of-service attacks.</p>
  1833.  
  1834.     <p>For example:</p>
  1835.  
  1836.     <div class="example"><p><code>
  1837.       LimitRequestFieldSize 4094
  1838.     </code></p></div>
  1839.  
  1840.     <div class="note">Under normal conditions, the value should not be changed from
  1841.     the default.</div>
  1842.  
  1843.  
  1844. </div>
  1845. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1846. <div class="directive-section"><h2><a name="LimitRequestLine" id="LimitRequestLine">LimitRequestLine</a> <a name="limitrequestline" id="limitrequestline">Directive</a></h2>
  1847. <table class="directive">
  1848. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limit the size of the HTTP request line that will be accepted
  1849. from the client</td></tr>
  1850. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitRequestLine <var>bytes</var></code></td></tr>
  1851. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitRequestLine 8190</code></td></tr>
  1852. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  1853. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1854. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1855. </table>
  1856.     <p>This directive sets the number of <var>bytes</var> that will be 
  1857.     allowed on the HTTP request-line.</p>
  1858.  
  1859.     <p>The <code class="directive">LimitRequestLine</code> directive allows
  1860.     the server administrator to reduce or increase the limit on the allowed size
  1861.     of a client's HTTP request-line. Since the request-line consists of the
  1862.     HTTP method, URI, and protocol version, the
  1863.     <code class="directive">LimitRequestLine</code> directive places a
  1864.     restriction on the length of a request-URI allowed for a request
  1865.     on the server. A server needs this value to be large enough to
  1866.     hold any of its resource names, including any information that
  1867.     might be passed in the query part of a <code>GET</code> request.</p>
  1868.  
  1869.     <p>This directive gives the server administrator greater
  1870.     control over abnormal client request behavior, which may be
  1871.     useful for avoiding some forms of denial-of-service attacks.</p>
  1872.  
  1873.     <p>For example:</p>
  1874.  
  1875.     <div class="example"><p><code>
  1876.       LimitRequestLine 4094
  1877.     </code></p></div>
  1878.  
  1879.     <div class="note">Under normal conditions, the value should not be changed from
  1880.     the default.</div>
  1881.  
  1882. </div>
  1883. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1884. <div class="directive-section"><h2><a name="LimitXMLRequestBody" id="LimitXMLRequestBody">LimitXMLRequestBody</a> <a name="limitxmlrequestbody" id="limitxmlrequestbody">Directive</a></h2>
  1885. <table class="directive">
  1886. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the size of an XML-based request body</td></tr>
  1887. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LimitXMLRequestBody <var>bytes</var></code></td></tr>
  1888. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LimitXMLRequestBody 1000000</code></td></tr>
  1889. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  1890. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  1891. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1892. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1893. </table>
  1894.     <p>Limit (in bytes) on maximum size of an XML-based request
  1895.     body. A value of <code>0</code> will disable any checking.</p>
  1896.  
  1897.     <p>Example:</p>
  1898.  
  1899.     <div class="example"><p><code>
  1900.       LimitXMLRequestBody 0
  1901.     </code></p></div>
  1902.  
  1903.  
  1904. </div>
  1905. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  1906. <div class="directive-section"><h2><a name="Location" id="Location"><Location></a> <a name="location" id="location">Directive</a></h2>
  1907. <table class="directive">
  1908. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to matching
  1909. URLs</td></tr>
  1910. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><Location
  1911.     <var>URL-path</var>|<var>URL</var>> ... </Location></code></td></tr>
  1912. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  1913. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  1914. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  1915. </table>
  1916.     <p>The <code class="directive"><Location></code> directive
  1917.     limits the scope of the enclosed directives by URL. It is similar to the
  1918.     <code class="directive"><a href="#directory"><Directory></a></code>
  1919.     directive, and starts a subsection which is terminated with a
  1920.     <code></Location></code> directive. <code class="directive"><Location></code> sections are processed in the
  1921.     order they appear in the configuration file, after the <code class="directive"><a href="#directory"><Directory></a></code> sections and
  1922.     <code>.htaccess</code> files are read, and after the <code class="directive"><a href="#files"><Files></a></code> sections.</p>
  1923.  
  1924.     <p><code class="directive"><Location></code> sections operate
  1925.     completely outside the filesystem.  This has several consequences.
  1926.     Most importantly, <code class="directive"><Location></code>
  1927.     directives should not be used to control access to filesystem
  1928.     locations.  Since several different URLs may map to the same
  1929.     filesystem location, such access controls may by circumvented.</p>
  1930.  
  1931.     <div class="note"><h3>When to use <code class="directive"><Location></code></h3>
  1932.  
  1933.     <p>Use <code class="directive"><Location></code> to apply
  1934.     directives to content that lives outside the filesystem.  For
  1935.     content that lives in the filesystem, use <code class="directive"><a href="#directory"><Directory></a></code> and <code class="directive"><a href="#files"><Files></a></code>.  An exception is
  1936.     <code><Location /></code>, which is an easy way to 
  1937.     apply a configuration to the entire server.</p>
  1938.     </div>
  1939.  
  1940.     <p>For all origin (non-proxy) requests, the URL to be matched is a
  1941.     URL-path of the form <code>/path/</code>.  No scheme, hostname,
  1942.     port, or query string may be included.  For proxy requests, the
  1943.     URL to be matched is of the form
  1944.     <code>scheme://servername/path</code>, and you must include the
  1945.     prefix.</p>
  1946.  
  1947.     <p>The URL may use wildcards. In a wild-card string, <code>?</code> matches
  1948.     any single character, and <code>*</code> matches any sequences of
  1949.     characters. Neither wildcard character matches a / in the URL-path.</p>
  1950.  
  1951.     <p><a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular expressions</a>
  1952.     can also be used, with the addition of the
  1953.     <code>~</code> character. For example:</p>
  1954.  
  1955.     <div class="example"><p><code>
  1956.       <Location ~ "/(extra|special)/data">
  1957.     </code></p></div>
  1958.  
  1959.     <p>would match URLs that contained the substring <code>/extra/data</code>
  1960.     or <code>/special/data</code>. The directive <code class="directive"><a href="#locationmatch"><LocationMatch></a></code> behaves
  1961.     identical to the regex version of <code class="directive"><Location></code>.</p>
  1962.  
  1963.     <p>The <code class="directive"><Location></code>
  1964.     functionality is especially useful when combined with the
  1965.     <code class="directive"><a href="#sethandler">SetHandler</a></code>
  1966.     directive. For example, to enable status requests, but allow them
  1967.     only from browsers at <code>foo.com</code>, you might use:</p>
  1968.  
  1969.     <div class="example"><p><code>
  1970.       <Location /status><br />
  1971.       <span class="indent">
  1972.         SetHandler server-status<br />
  1973.         Order Deny,Allow<br />
  1974.         Deny from all<br />
  1975.         Allow from .foo.com<br />
  1976.       </span>
  1977.       </Location>
  1978.     </code></p></div>
  1979.  
  1980.     <div class="note"><h3>Note about / (slash)</h3>
  1981.       <p>The slash character has special meaning depending on where in a
  1982.       URL it appears. People may be used to its behavior in the filesystem
  1983.       where multiple adjacent slashes are frequently collapsed to a single
  1984.       slash (<em>i.e.</em>, <code>/home///foo</code> is the same as
  1985.       <code>/home/foo</code>). In URL-space this is not necessarily true.
  1986.       The <code class="directive"><a href="#locationmatch"><LocationMatch></a></code>
  1987.       directive and the regex version of <code class="directive"><Location></code> require you to explicitly specify multiple
  1988.       slashes if that is your intention.</p>
  1989.  
  1990.       <p>For example, <code><LocationMatch ^/abc></code> would match
  1991.       the request URL <code>/abc</code> but not the request URL <code>
  1992.       //abc</code>. The (non-regex) <code class="directive"><Location></code> directive behaves similarly when used for
  1993.       proxy requests. But when (non-regex) <code class="directive"><Location></code> is used for non-proxy requests it will
  1994.       implicitly match multiple slashes with a single slash. For example,
  1995.       if you specify <code><Location /abc/def></code> and the
  1996.       request is to <code>/abc//def</code> then it will match.</p>
  1997.     </div>
  1998.  
  1999. <h3>See also</h3>
  2000. <ul>
  2001. <li><a href="../sections.html">How <Directory>, <Location>
  2002.     and <Files> sections work</a> for an explanation of how these
  2003.     different sections are combined when a request is received</li>
  2004. </ul>
  2005. </div>
  2006. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2007. <div class="directive-section"><h2><a name="LocationMatch" id="LocationMatch"><LocationMatch></a> <a name="locationmatch" id="locationmatch">Directive</a></h2>
  2008. <table class="directive">
  2009. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Applies the enclosed directives only to regular-expression
  2010. matching URLs</td></tr>
  2011. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><LocationMatch
  2012.     <var>regex</var>> ... </LocationMatch></code></td></tr>
  2013. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  2014. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2015. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2016. </table>
  2017.     <p>The <code class="directive"><LocationMatch></code> directive
  2018.     limits the scope of the enclosed directives by URL, in an identical manner
  2019.     to <code class="directive"><a href="#location"><Location></a></code>. However,
  2020.     it takes a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>
  2021.     as an argument instead of a simple string. For example:</p>
  2022.  
  2023.     <div class="example"><p><code>
  2024.       <LocationMatch "/(extra|special)/data">
  2025.     </code></p></div>
  2026.  
  2027.     <p>would match URLs that contained the substring <code>/extra/data</code>
  2028.     or <code>/special/data</code>.</p>
  2029.  
  2030. <h3>See also</h3>
  2031. <ul>
  2032. <li><a href="../sections.html">How <Directory>, <Location>
  2033.     and <Files> sections work</a> for an explanation of how these
  2034.     different sections are combined when a request is received</li>
  2035. </ul>
  2036. </div>
  2037. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2038. <div class="directive-section"><h2><a name="LogLevel" id="LogLevel">LogLevel</a> <a name="loglevel" id="loglevel">Directive</a></h2>
  2039. <table class="directive">
  2040. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls the verbosity of the ErrorLog</td></tr>
  2041. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>LogLevel <var>level</var></code></td></tr>
  2042. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>LogLevel warn</code></td></tr>
  2043. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  2044. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2045. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2046. </table>
  2047.     <p><code class="directive">LogLevel</code> adjusts the verbosity of the
  2048.     messages recorded in the error logs (see <code class="directive"><a href="#errorlog">ErrorLog</a></code> directive). The following
  2049.     <var>level</var>s are available, in order of decreasing
  2050.     significance:</p>
  2051.  
  2052.     <table class="bordered">
  2053.     
  2054.       <tr>
  2055.         <th><strong>Level</strong> </th>
  2056.  
  2057.         <th><strong>Description</strong> </th>
  2058.  
  2059.         <th><strong>Example</strong> </th>
  2060.       </tr>
  2061.  
  2062.       <tr>
  2063.         <td><code>emerg</code> </td>
  2064.  
  2065.         <td>Emergencies - system is unusable.</td>
  2066.  
  2067.         <td>"Child cannot open lock file. Exiting"</td>
  2068.       </tr>
  2069.  
  2070.       <tr>
  2071.         <td><code>alert</code> </td>
  2072.  
  2073.         <td>Action must be taken immediately.</td>
  2074.  
  2075.         <td>"getpwuid: couldn't determine user name from uid"</td>
  2076.       </tr>
  2077.  
  2078.       <tr>
  2079.         <td><code>crit</code> </td>
  2080.  
  2081.         <td>Critical Conditions.</td>
  2082.  
  2083.         <td>"socket: Failed to get a socket, exiting child"</td>
  2084.       </tr>
  2085.  
  2086.       <tr>
  2087.         <td><code>error</code> </td>
  2088.  
  2089.         <td>Error conditions.</td>
  2090.  
  2091.         <td>"Premature end of script headers"</td>
  2092.       </tr>
  2093.  
  2094.       <tr>
  2095.         <td><code>warn</code> </td>
  2096.  
  2097.         <td>Warning conditions.</td>
  2098.  
  2099.         <td>"child process 1234 did not exit, sending another
  2100.         SIGHUP"</td>
  2101.       </tr>
  2102.  
  2103.       <tr>
  2104.         <td><code>notice</code> </td>
  2105.  
  2106.         <td>Normal but significant condition.</td>
  2107.  
  2108.         <td>"httpd: caught SIGBUS, attempting to dump core in
  2109.         ..."</td>
  2110.       </tr>
  2111.  
  2112.       <tr>
  2113.         <td><code>info</code> </td>
  2114.  
  2115.         <td>Informational.</td>
  2116.  
  2117.         <td>"Server seems busy, (you may need to increase
  2118.         StartServers, or Min/MaxSpareServers)..."</td>
  2119.       </tr>
  2120.  
  2121.       <tr>
  2122.         <td><code>debug</code> </td>
  2123.  
  2124.         <td>Debug-level messages</td>
  2125.  
  2126.         <td>"Opening config file ..."</td>
  2127.       </tr>
  2128.     </table>
  2129.  
  2130.     <p>When a particular level is specified, messages from all
  2131.     other levels of higher significance will be reported as well.
  2132.     <em>E.g.</em>, when <code>LogLevel info</code> is specified,
  2133.     then messages with log levels of <code>notice</code> and
  2134.     <code>warn</code> will also be posted.</p>
  2135.  
  2136.     <p>Using a level of at least <code>crit</code> is
  2137.     recommended.</p>
  2138.  
  2139.     <p>For example:</p>
  2140.  
  2141.     <div class="example"><p><code>
  2142.       LogLevel notice
  2143.     </code></p></div>
  2144.  
  2145.     <div class="note"><h3>Note</h3>
  2146.       <p>When logging to a regular file messages of the level
  2147.       <code>notice</code> cannot be suppressed and thus are always
  2148.       logged. However, this doesn't apply when logging is done
  2149.       using <code>syslog</code>.</p>
  2150.     </div>
  2151.  
  2152. </div>
  2153. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2154. <div class="directive-section"><h2><a name="MaxKeepAliveRequests" id="MaxKeepAliveRequests">MaxKeepAliveRequests</a> <a name="maxkeepaliverequests" id="maxkeepaliverequests">Directive</a></h2>
  2155. <table class="directive">
  2156. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Number of requests allowed on a persistent
  2157. connection</td></tr>
  2158. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>MaxKeepAliveRequests <var>number</var></code></td></tr>
  2159. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>MaxKeepAliveRequests 100</code></td></tr>
  2160. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  2161. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2162. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2163. </table>
  2164.     <p>The <code class="directive">MaxKeepAliveRequests</code> directive
  2165.     limits the number of requests allowed per connection when
  2166.     <code class="directive"><a href="#keepalive">KeepAlive</a></code> is on. If it is
  2167.     set to <code>0</code>, unlimited requests will be allowed. We
  2168.     recommend that this setting be kept to a high value for maximum
  2169.     server performance.</p>
  2170.  
  2171.     <p>For example:</p>
  2172.  
  2173.     <div class="example"><p><code>
  2174.       MaxKeepAliveRequests 500
  2175.     </code></p></div>
  2176.  
  2177. </div>
  2178. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2179. <div class="directive-section"><h2><a name="NameVirtualHost" id="NameVirtualHost">NameVirtualHost</a> <a name="namevirtualhost" id="namevirtualhost">Directive</a></h2>
  2180. <table class="directive">
  2181. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Designates an IP address for name-virtual
  2182. hosting</td></tr>
  2183. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>NameVirtualHost <var>addr</var>[:<var>port</var>]</code></td></tr>
  2184. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  2185. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2186. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2187. </table>
  2188.     <p>The <code class="directive">NameVirtualHost</code> directive is a
  2189.     required directive if you want to configure <a href="../vhosts/">name-based virtual hosts</a>.</p>
  2190.  
  2191.     <p>Although <var>addr</var> can be hostname it is recommended
  2192.     that you always use an IP address, e.g.</p>
  2193.  
  2194.     <div class="example"><p><code>
  2195.       NameVirtualHost 111.22.33.44
  2196.     </code></p></div>
  2197.  
  2198.     <p>With the <code class="directive">NameVirtualHost</code> directive you
  2199.     specify the IP address on which the server will receive requests
  2200.     for the name-based virtual hosts. This will usually be the address
  2201.     to which your name-based virtual host names resolve. In cases
  2202.     where a firewall or other proxy receives the requests and forwards
  2203.     them on a different IP address to the server, you must specify the
  2204.     IP address of the physical interface on the machine which will be
  2205.     servicing the requests. If you have multiple name-based hosts on
  2206.     multiple addresses, repeat the directive for each address.</p>
  2207.  
  2208.     <div class="note"><h3>Note</h3>
  2209.       <p>Note, that the "main server" and any <code>_default_</code> servers
  2210.       will <strong>never</strong> be served for a request to a
  2211.       <code class="directive">NameVirtualHost</code> IP address (unless for some
  2212.       reason you specify <code class="directive">NameVirtualHost</code> but then
  2213.       don't define any <code class="directive">VirtualHost</code>s for that
  2214.       address).</p>
  2215.     </div>
  2216.  
  2217.     <p>Optionally you can specify a port number on which the
  2218.     name-based virtual hosts should be used, e.g.</p>
  2219.  
  2220.     <div class="example"><p><code>
  2221.       NameVirtualHost 111.22.33.44:8080
  2222.     </code></p></div>
  2223.  
  2224.     <p>IPv6 addresses must be enclosed in square brackets, as shown
  2225.     in the following example:</p>
  2226.  
  2227.     <div class="example"><p><code>
  2228.       NameVirtualHost [2001:db8::a00:20ff:fea7:ccea]:8080
  2229.     </code></p></div>
  2230.  
  2231.     <p>To receive requests on all interfaces, you can use an argument of
  2232.     <code>*</code></p>
  2233.  
  2234.     <div class="example"><p><code>
  2235.       NameVirtualHost *
  2236.     </code></p></div>
  2237.  
  2238.     <div class="note"><h3>Argument to <code class="directive"><VirtualHost></code>
  2239.       directive</h3>
  2240.       <p>Note that the argument to the <code class="directive"><VirtualHost></code> directive must
  2241.       exactly match the argument to the <code class="directive">NameVirtualHost</code> directive.</p>
  2242.  
  2243.       <div class="example"><p><code>
  2244.         NameVirtualHost 1.2.3.4<br />
  2245.         <VirtualHost 1.2.3.4><br />
  2246.         # ...<br />
  2247.         </VirtualHost><br />
  2248.       </code></p></div>
  2249.     </div>
  2250.  
  2251. <h3>See also</h3>
  2252. <ul>
  2253. <li><a href="../vhosts/">Virtual Hosts
  2254. documentation</a></li>
  2255. </ul>
  2256. </div>
  2257. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2258. <div class="directive-section"><h2><a name="Options" id="Options">Options</a> <a name="options" id="options">Directive</a></h2>
  2259. <table class="directive">
  2260. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures what features are available in a particular
  2261. directory</td></tr>
  2262. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Options
  2263.     [+|-]<var>option</var> [[+|-]<var>option</var>] ...</code></td></tr>
  2264. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Options All</code></td></tr>
  2265. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  2266. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Options</td></tr>
  2267. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2268. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2269. </table>
  2270.     <p>The <code class="directive">Options</code> directive controls which
  2271.     server features are available in a particular directory.</p>
  2272.  
  2273.     <p><var>option</var> can be set to <code>None</code>, in which
  2274.     case none of the extra features are enabled, or one or more of
  2275.     the following:</p>
  2276.  
  2277.     <dl>
  2278.       <dt><code>All</code></dt>
  2279.  
  2280.       <dd>All options except for <code>MultiViews</code>. This is the default
  2281.       setting.</dd>
  2282.  
  2283.       <dt><code>ExecCGI</code></dt>
  2284.  
  2285.       <dd>
  2286.       Execution of CGI scripts using <code class="module"><a href="../mod/mod_cgi.html">mod_cgi</a></code>
  2287.       is permitted.</dd>
  2288.  
  2289.       <dt><code>FollowSymLinks</code></dt>
  2290.  
  2291.       <dd>
  2292.  
  2293.       The server will follow symbolic links in this directory.
  2294.       <div class="note">
  2295.       <p>Even though the server follows the symlink it does <em>not</em>
  2296.       change the pathname used to match against <code class="directive"><a href="#directory"><Directory></a></code> sections.</p>
  2297.       <p>Note also, that this option <strong>gets ignored</strong> if set
  2298.       inside a <code class="directive"><a href="#location"><Location></a></code>
  2299.       section.</p>
  2300.       <p>Omitting this option should not be considered a security restriction,
  2301.       since symlink testing is subject to race conditions that make it
  2302.       circumventable.</p>
  2303.       </div></dd>
  2304.  
  2305.       <dt><code>Includes</code></dt>
  2306.  
  2307.       <dd>
  2308.       Server-side includes provided by <code class="module"><a href="../mod/mod_include.html">mod_include</a></code>
  2309.       are permitted.</dd>
  2310.  
  2311.       <dt><code>IncludesNOEXEC</code></dt>
  2312.  
  2313.       <dd>
  2314.  
  2315.       Server-side includes are permitted, but the <code>#exec
  2316.       cmd</code> and <code>#exec cgi</code> are disabled. It is still
  2317.       possible to <code>#include virtual</code> CGI scripts from
  2318.       <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>ed
  2319.       directories.</dd>
  2320.  
  2321.       <dt><code>Indexes</code></dt>
  2322.  
  2323.       <dd>
  2324.       If a URL which maps to a directory is requested, and there
  2325.       is no <code class="directive"><a href="../mod/mod_dir.html#directoryindex">DirectoryIndex</a></code>
  2326.       (<em>e.g.</em>, <code>index.html</code>) in that directory, then
  2327.       <code class="module"><a href="../mod/mod_autoindex.html">mod_autoindex</a></code> will return a formatted listing
  2328.       of the directory.</dd>
  2329.  
  2330.       <dt><code>MultiViews</code></dt>
  2331.  
  2332.       <dd>
  2333.       <a href="../content-negotiation.html">Content negotiated</a>
  2334.       "MultiViews" are allowed using
  2335.       <code class="module"><a href="../mod/mod_negotiation.html">mod_negotiation</a></code>.</dd>
  2336.  
  2337.       <dt><code>SymLinksIfOwnerMatch</code></dt>
  2338.  
  2339.       <dd>The server will only follow symbolic links for which the
  2340.       target file or directory is owned by the same user id as the
  2341.       link.
  2342.  
  2343.       <div class="note"><h3>Note</h3> <p>This option gets ignored if
  2344.       set inside a <code class="directive"><a href="#location"><Location></a></code> section.</p>
  2345.       <p>This option should not be considered a security restriction,
  2346.       since symlink testing is subject to race conditions that make it
  2347.       circumventable.</p></div>
  2348.       </dd>
  2349.     </dl>
  2350.  
  2351.     <p>Normally, if multiple <code class="directive">Options</code> could
  2352.     apply to a directory, then the most specific one is used and
  2353.     others are ignored; the options are not merged. (See <a href="../sections.html#mergin">how sections are merged</a>.)
  2354.     However if <em>all</em> the options on the
  2355.     <code class="directive">Options</code> directive are preceded by a
  2356.     <code>+</code> or <code>-</code> symbol, the options are
  2357.     merged. Any options preceded by a <code>+</code> are added to the
  2358.     options currently in force, and any options preceded by a
  2359.     <code>-</code> are removed from the options currently in
  2360.     force. </p>
  2361.  
  2362.     <div class="warning"><h3>Warning</h3>
  2363.     <p>Mixing <code class="directive">Options</code> with a <code>+</code> or
  2364.     <code>-</code> with those without is not valid syntax, and is likely
  2365.     to cause unexpected results.</p>
  2366.     </div>
  2367.  
  2368.     <p>For example, without any <code>+</code> and <code>-</code> symbols:</p>
  2369.  
  2370.     <div class="example"><p><code>
  2371.       <Directory /web/docs><br />
  2372.       <span class="indent">
  2373.         Options Indexes FollowSymLinks<br />
  2374.       </span>
  2375.       </Directory><br />
  2376.       <br />
  2377.       <Directory /web/docs/spec><br />
  2378.       <span class="indent">
  2379.         Options Includes<br />
  2380.       </span>
  2381.       </Directory>
  2382.     </code></p></div>
  2383.  
  2384.     <p>then only <code>Includes</code> will be set for the
  2385.     <code>/web/docs/spec</code> directory. However if the second
  2386.     <code class="directive">Options</code> directive uses the <code>+</code> and
  2387.     <code>-</code> symbols:</p>
  2388.  
  2389.     <div class="example"><p><code>
  2390.       <Directory /web/docs><br />
  2391.       <span class="indent">
  2392.         Options Indexes FollowSymLinks<br />
  2393.       </span>
  2394.       </Directory><br />
  2395.       <br />
  2396.       <Directory /web/docs/spec><br />
  2397.       <span class="indent">
  2398.         Options +Includes -Indexes<br />
  2399.       </span>
  2400.       </Directory>
  2401.     </code></p></div>
  2402.  
  2403.     <p>then the options <code>FollowSymLinks</code> and
  2404.     <code>Includes</code> are set for the <code>/web/docs/spec</code>
  2405.     directory.</p>
  2406.  
  2407.     <div class="note"><h3>Note</h3>
  2408.       <p>Using <code>-IncludesNOEXEC</code> or
  2409.       <code>-Includes</code> disables server-side includes completely
  2410.       regardless of the previous setting.</p>
  2411.     </div>
  2412.  
  2413.     <p>The default in the absence of any other settings is
  2414.     <code>All</code>.</p>
  2415.  
  2416. </div>
  2417. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2418. <div class="directive-section"><h2><a name="Require" id="Require">Require</a> <a name="require" id="require">Directive</a></h2>
  2419. <table class="directive">
  2420. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Selects which authenticated users can access
  2421. a resource</td></tr>
  2422. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Require <var>entity-name</var> [<var>entity-name</var>] ...</code></td></tr>
  2423. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  2424. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  2425. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2426. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2427. </table>
  2428.     <p>This directive selects which authenticated users can access a
  2429.     resource.  The restrictions are processed by authorization
  2430.     modules.  Some of the allowed syntaxes provided by
  2431.     <code class="module"><a href="../mod/mod_authz_user.html">mod_authz_user</a></code> and
  2432.     <code class="module"><a href="../mod/mod_authz_groupfile.html">mod_authz_groupfile</a></code> are:</p>
  2433.  
  2434.     <dl>
  2435.       <dt><code>Require user <var>userid</var> [<var>userid</var>]
  2436.       ...</code></dt>
  2437.       <dd>Only the named users can access the resource.</dd>
  2438.  
  2439.       <dt><code>Require group <var>group-name</var> [<var>group-name</var>]
  2440.       ...</code></dt>
  2441.       <dd>Only users in the named groups can access the resource.</dd>
  2442.  
  2443.       <dt><code>Require valid-user</code></dt>
  2444.       <dd>All valid users can access the resource.</dd>
  2445.     </dl>
  2446.  
  2447.     <p>Other authorization modules that implement require options
  2448.     include <code class="module"><a href="../mod/mod_authnz_ldap.html">mod_authnz_ldap</a></code>,
  2449.     <code class="module"><a href="../mod/mod_authz_dbm.html">mod_authz_dbm</a></code>, and
  2450.     <code class="module"><a href="../mod/mod_authz_owner.html">mod_authz_owner</a></code>.</p>
  2451.  
  2452.     <p><code class="directive">Require</code> must be accompanied by
  2453.     <code class="directive"><a href="#authname">AuthName</a></code> and <code class="directive"><a href="#authtype">AuthType</a></code> directives, and directives such
  2454.     as <code class="directive"><a href="../mod/mod_authn_file.html#authuserfile">AuthUserFile</a></code>
  2455.     and <code class="directive"><a href="../mod/mod_authz_groupfile.html#authgroupfile">AuthGroupFile</a></code> (to
  2456.     define users and groups) in order to work correctly. Example:</p>
  2457.  
  2458.     <div class="example"><p><code>
  2459.        AuthType Basic<br />
  2460.        AuthName "Restricted Resource"<br />
  2461.        AuthUserFile /web/users<br />
  2462.        AuthGroupFile /web/groups<br />
  2463.        Require group admin
  2464.     </code></p></div>
  2465.  
  2466.     <p>Access controls which are applied in this way are effective for
  2467.     <strong>all</strong> methods. <strong>This is what is normally
  2468.     desired.</strong> If you wish to apply access controls only to
  2469.     specific methods, while leaving other methods unprotected, then
  2470.     place the <code class="directive">Require</code> statement into a
  2471.     <code class="directive"><a href="#limit"><Limit></a></code>
  2472.     section.</p>
  2473.  
  2474.     <p>If <code class="directive">Require</code> is used together with 
  2475.     the <code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code> or
  2476.     <code class="directive"><a href="../mod/mod_authz_host.html#deny">Deny</a></code> directives,
  2477.     then the interaction of these restrictions is controlled by
  2478.     the <code class="directive"><a href="#satisfy">Satisfy</a></code> directive.</p>
  2479.  
  2480.     <div class="note"><h3>Removing controls in subdirectories</h3>
  2481.     <p>The following example shows how to use the <code class="directive"><a href="#satisfy">Satisfy</a></code> directive to disable access
  2482.     controls in a subdirectory of a protected directory.  This
  2483.     technique should be used with caution, because it will also
  2484.     disable any access controls imposed by
  2485.     <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code>.</p>
  2486.     <div class="example"><p><code>
  2487.       <Directory /path/to/protected/><br />
  2488.         <span class="indent">
  2489.         Require user david<br />
  2490.         </span>
  2491.       </Directory><br />
  2492.       <Directory /path/to/protected/unprotected><br />
  2493.         <span class="indent">
  2494.         # All access controls and authentication are disabled<br />
  2495.         # in this directory<br />
  2496.         Satisfy Any<br />
  2497.         Allow from all<br />
  2498.         </span>
  2499.       </Directory><br />
  2500.     </code></p></div>
  2501.     </div>
  2502.       
  2503.  
  2504. <h3>See also</h3>
  2505. <ul>
  2506. <li><a href="../howto/auth.html">Authentication, Authorization,
  2507.     and Access Control</a></li>
  2508. <li><code class="directive"><a href="#satisfy">Satisfy</a></code></li>
  2509. <li><code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code></li>
  2510. </ul>
  2511. </div>
  2512. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2513. <div class="directive-section"><h2><a name="RLimitCPU" id="RLimitCPU">RLimitCPU</a> <a name="rlimitcpu" id="rlimitcpu">Directive</a></h2>
  2514. <table class="directive">
  2515. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the CPU consumption of processes launched
  2516. by Apache children</td></tr>
  2517. <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>
  2518. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
  2519. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  2520. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  2521. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2522. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2523. </table>
  2524.     <p>Takes 1 or 2 parameters. The first parameter sets the soft
  2525.     resource limit for all processes and the second parameter sets
  2526.     the maximum resource limit. Either parameter can be a number,
  2527.     or <code>max</code> to indicate to the server that the limit should
  2528.     be set to the maximum allowed by the operating system
  2529.     configuration. Raising the maximum resource limit requires that
  2530.     the server is running as <code>root</code>, or in the initial startup
  2531.     phase.</p>
  2532.  
  2533.     <p>This applies to processes forked off from Apache children
  2534.     servicing requests, not the Apache children themselves. This
  2535.     includes CGI scripts and SSI exec commands, but not any
  2536.     processes forked off from the Apache parent such as piped
  2537.     logs.</p>
  2538.  
  2539.     <p>CPU resource limits are expressed in seconds per
  2540.     process.</p>
  2541.  
  2542. <h3>See also</h3>
  2543. <ul>
  2544. <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
  2545. <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
  2546. </ul>
  2547. </div>
  2548. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2549. <div class="directive-section"><h2><a name="RLimitMEM" id="RLimitMEM">RLimitMEM</a> <a name="rlimitmem" id="rlimitmem">Directive</a></h2>
  2550. <table class="directive">
  2551. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the memory consumption of processes launched
  2552. by Apache children</td></tr>
  2553. <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>
  2554. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
  2555. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  2556. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  2557. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2558. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2559. </table>
  2560.     <p>Takes 1 or 2 parameters. The first parameter sets the soft
  2561.     resource limit for all processes and the second parameter sets
  2562.     the maximum resource limit. Either parameter can be a number,
  2563.     or <code>max</code> to indicate to the server that the limit should
  2564.     be set to the maximum allowed by the operating system
  2565.     configuration. Raising the maximum resource limit requires that
  2566.     the server is running as <code>root</code>, or in the initial startup
  2567.     phase.</p>
  2568.  
  2569.     <p>This applies to processes forked off from Apache children
  2570.     servicing requests, not the Apache children themselves. This
  2571.     includes CGI scripts and SSI exec commands, but not any
  2572.     processes forked off from the Apache parent such as piped
  2573.     logs.</p>
  2574.  
  2575.     <p>Memory resource limits are expressed in bytes per
  2576.     process.</p>
  2577.  
  2578. <h3>See also</h3>
  2579. <ul>
  2580. <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
  2581. <li><code class="directive"><a href="#rlimitnproc">RLimitNPROC</a></code></li>
  2582. </ul>
  2583. </div>
  2584. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2585. <div class="directive-section"><h2><a name="RLimitNPROC" id="RLimitNPROC">RLimitNPROC</a> <a name="rlimitnproc" id="rlimitnproc">Directive</a></h2>
  2586. <table class="directive">
  2587. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Limits the number of processes that can be launched by
  2588. processes launched by Apache children</td></tr>
  2589. <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>
  2590. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Unset; uses operating system defaults</code></td></tr>
  2591. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  2592. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  2593. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2594. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2595. </table>
  2596.     <p>Takes 1 or 2 parameters. The first parameter sets the soft
  2597.     resource limit for all processes and the second parameter sets
  2598.     the maximum resource limit. Either parameter can be a number,
  2599.     or <code>max</code> to indicate to the server that the limit
  2600.     should be set to the maximum allowed by the operating system
  2601.     configuration. Raising the maximum resource limit requires that
  2602.     the server is running as <code>root</code>, or in the initial startup
  2603.     phase.</p>
  2604.  
  2605.     <p>This applies to processes forked off from Apache children
  2606.     servicing requests, not the Apache children themselves. This
  2607.     includes CGI scripts and SSI exec commands, but not any
  2608.     processes forked off from the Apache parent such as piped
  2609.     logs.</p>
  2610.  
  2611.     <p>Process limits control the number of processes per user.</p>
  2612.  
  2613.     <div class="note"><h3>Note</h3>
  2614.       <p>If CGI processes are <strong>not</strong> running
  2615.       under user ids other than the web server user id, this directive
  2616.       will limit the number of processes that the server itself can
  2617.       create. Evidence of this situation will be indicated by
  2618.       <strong><code>cannot fork</code></strong> messages in the
  2619.       <code>error_log</code>.</p>
  2620.     </div>
  2621.  
  2622. <h3>See also</h3>
  2623. <ul>
  2624. <li><code class="directive"><a href="#rlimitmem">RLimitMEM</a></code></li>
  2625. <li><code class="directive"><a href="#rlimitcpu">RLimitCPU</a></code></li>
  2626. </ul>
  2627. </div>
  2628. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2629. <div class="directive-section"><h2><a name="Satisfy" id="Satisfy">Satisfy</a> <a name="satisfy" id="satisfy">Directive</a></h2>
  2630. <table class="directive">
  2631. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Interaction between host-level access control and
  2632. user authentication</td></tr>
  2633. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Satisfy Any|All</code></td></tr>
  2634. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Satisfy All</code></td></tr>
  2635. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
  2636. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
  2637. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2638. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2639. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Influenced by <code class="directive"><a href="#limit"><Limit></a></code> and <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> in version 2.0.51 and
  2640. later</td></tr>
  2641. </table>
  2642.     <p>Access policy if both <code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code> and <code class="directive"><a href="#require">Require</a></code> used. The parameter can be
  2643.     either <code>All</code> or <code>Any</code>. This directive is only
  2644.     useful if access to a particular area is being restricted by both
  2645.     username/password <em>and</em> client host address. In this case
  2646.     the default behavior (<code>All</code>) is to require that the client
  2647.     passes the address access restriction <em>and</em> enters a valid
  2648.     username and password. With the <code>Any</code> option the client will be
  2649.     granted access if they either pass the host restriction or enter a
  2650.     valid username and password. This can be used to password restrict
  2651.     an area, but to let clients from particular addresses in without
  2652.     prompting for a password.</p>
  2653.  
  2654.     <p>For example, if you wanted to let people on your network have
  2655.     unrestricted access to a portion of your website, but require that
  2656.     people outside of your network provide a password, you could use a
  2657.     configuration similar to the following:</p>
  2658.  
  2659.     <div class="example"><p><code>
  2660.       Require valid-user<br />
  2661.       Order allow,deny<br />
  2662.       Allow from 192.168.1<br />
  2663.       Satisfy Any
  2664.     </code></p></div>
  2665.  
  2666.     <p>Since version 2.0.51 <code class="directive">Satisfy</code> directives can
  2667.     be restricted to particular methods by <code class="directive"><a href="#limit"><Limit></a></code> and <code class="directive"><a href="#limitexcept"><LimitExcept></a></code> sections.</p>
  2668.  
  2669. <h3>See also</h3>
  2670. <ul>
  2671. <li><code class="directive"><a href="../mod/mod_authz_host.html#allow">Allow</a></code></li>
  2672. <li><code class="directive"><a href="#require">Require</a></code></li>
  2673. </ul>
  2674. </div>
  2675. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2676. <div class="directive-section"><h2><a name="ScriptInterpreterSource" id="ScriptInterpreterSource">ScriptInterpreterSource</a> <a name="scriptinterpretersource" id="scriptinterpretersource">Directive</a></h2>
  2677. <table class="directive">
  2678. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Technique for locating the interpreter for CGI
  2679. scripts</td></tr>
  2680. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ScriptInterpreterSource Registry|Registry-Strict|Script</code></td></tr>
  2681. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ScriptInterpreterSource Script</code></td></tr>
  2682. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  2683. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  2684. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2685. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2686. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Win32 only;
  2687. option <code>Registry-Strict</code> is available in Apache 2.0 and
  2688. later</td></tr>
  2689. </table>
  2690.     <p>This directive is used to control how Apache finds the
  2691.     interpreter used to run CGI scripts. The default setting is
  2692.     <code>Script</code>. This causes Apache to use the interpreter pointed to
  2693.     by the shebang line (first line, starting with <code>#!</code>) in the
  2694.     script. On Win32 systems this line usually looks like:</p>
  2695.  
  2696.     <div class="example"><p><code>
  2697.       #!C:/Perl/bin/perl.exe
  2698.     </code></p></div>
  2699.  
  2700.     <p>or, if <code>perl</code> is in the <code>PATH</code>, simply:</p>
  2701.  
  2702.     <div class="example"><p><code>
  2703.       #!perl
  2704.     </code></p></div>
  2705.  
  2706.     <p>Setting <code>ScriptInterpreterSource Registry</code> will
  2707.     cause the Windows Registry tree <code>HKEY_CLASSES_ROOT</code> to be
  2708.     searched using the script file extension (e.g., <code>.pl</code>) as a
  2709.     search key. The command defined by the registry subkey
  2710.     <code>Shell\ExecCGI\Command</code> or, if it does not exist, by the subkey
  2711.     <code>Shell\Open\Command</code> is used to open the script file. If the
  2712.     registry keys cannot be found, Apache falls back to the behavior of the
  2713.     <code>Script</code> option.</p>
  2714.  
  2715.     <p>For example, the registry setting to have a script with the .pl extension
  2716.     processed via perl would be:</p>
  2717.  
  2718.     <div class="example"><p><code><code>HKEY_CLASSES_ROOT\.pl\Shell\ExecCGI\Command\(Default) => C:\Perl\bin\perl.exe -wT</code></code></p></div>
  2719.  
  2720.  
  2721.     <div class="warning"><h3>Security</h3>
  2722.     <p>Be careful when using <code>ScriptInterpreterSource
  2723.     Registry</code> with <code class="directive"><a href="../mod/mod_alias.html#scriptalias">ScriptAlias</a></code>'ed directories, because
  2724.     Apache will try to execute <strong>every</strong> file within this
  2725.     directory. The <code>Registry</code> setting may cause undesired
  2726.     program calls on files which are typically not executed. For
  2727.     example, the default open command on <code>.htm</code> files on
  2728.     most Windows systems will execute Microsoft Internet Explorer, so
  2729.     any HTTP request for an <code>.htm</code> file existing within the
  2730.     script directory would start the browser in the background on the
  2731.     server. This is a good way to crash your system within a minute or
  2732.     so.</p>
  2733.     </div>
  2734.  
  2735.     <p>The option <code>Registry-Strict</code> which is new in Apache
  2736.     2.0 does the same thing as <code>Registry</code> but uses only the
  2737.     subkey <code>Shell\ExecCGI\Command</code>. The
  2738.     <code>ExecCGI</code> key is not a common one. It must be
  2739.     configured manually in the windows registry and hence prevents
  2740.     accidental program calls on your system.</p>
  2741.  
  2742. </div>
  2743. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2744. <div class="directive-section"><h2><a name="ServerAdmin" id="ServerAdmin">ServerAdmin</a> <a name="serveradmin" id="serveradmin">Directive</a></h2>
  2745. <table class="directive">
  2746. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Email address that the server includes in error
  2747. messages sent to the client</td></tr>
  2748. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAdmin <var>email-address</var>|<var>URL</var></code></td></tr>
  2749. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  2750. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2751. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2752. </table>
  2753.     <p>The <code class="directive">ServerAdmin</code> sets the contact address
  2754.     that the server includes in any error messages it returns to the
  2755.     client. If the <code>httpd</code> doesn't recognize the supplied argument
  2756.     as an URL, it
  2757.     assumes, that it's an <var>email-address</var> and prepends it with
  2758.     <code>mailto:</code> in hyperlink targets. However, it's recommended to
  2759.     actually use an email address, since there are a lot of CGI scripts that
  2760.     make that assumption. If you want to use an URL, it should point to another
  2761.     server under your control. Otherwise users may not be able to contact you in
  2762.     case of errors.</p>
  2763.  
  2764.     <p>It may be worth setting up a dedicated address for this, e.g.</p>
  2765.  
  2766.     <div class="example"><p><code>
  2767.       ServerAdmin www-admin@foo.example.com
  2768.     </code></p></div>
  2769.     <p>as users do not always mention that they are talking about the
  2770.     server!</p>
  2771.  
  2772. </div>
  2773. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2774. <div class="directive-section"><h2><a name="ServerAlias" id="ServerAlias">ServerAlias</a> <a name="serveralias" id="serveralias">Directive</a></h2>
  2775. <table class="directive">
  2776. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Alternate names for a host used when matching requests
  2777. to name-virtual hosts</td></tr>
  2778. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerAlias <var>hostname</var> [<var>hostname</var>] ...</code></td></tr>
  2779. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
  2780. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2781. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2782. </table>
  2783.     <p>The <code class="directive">ServerAlias</code> directive sets the
  2784.     alternate names for a host, for use with <a href="../vhosts/name-based.html">name-based virtual hosts</a>. The
  2785.     <code class="directive">ServerAlias</code> may include wildcards, if appropriate.</p>
  2786.  
  2787.     <div class="example"><p><code>
  2788.       <VirtualHost *><br />
  2789.       ServerName server.domain.com<br />
  2790.       ServerAlias server server2.domain.com server2<br />
  2791.       # ...<br />
  2792.       </VirtualHost>
  2793.     </code></p></div>
  2794.  
  2795. <h3>See also</h3>
  2796. <ul>
  2797. <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
  2798. </ul>
  2799. </div>
  2800. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2801. <div class="directive-section"><h2><a name="ServerName" id="ServerName">ServerName</a> <a name="servername" id="servername">Directive</a></h2>
  2802. <table class="directive">
  2803. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Hostname and port that the server uses to identify
  2804. itself</td></tr>
  2805. <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>
  2806. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  2807. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2808. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2809. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>In version 2.0, this
  2810.      directive supersedes the functionality of the <code class="directive">Port</code>
  2811.      directive from version 1.3.</td></tr>
  2812. </table>
  2813.     <p>The <code class="directive">ServerName</code> directive sets the
  2814.     request scheme, hostname and
  2815.     port that the server uses to identify itself.  This is used when
  2816.     creating redirection URLs. For example, if the name of the
  2817.     machine hosting the web server is <code>simple.example.com</code>,
  2818.     but the machine also has the DNS alias <code>www.example.com</code>
  2819.     and you wish the web server to be so identified, the following
  2820.     directive should be used:</p>
  2821.  
  2822.     <div class="example"><p><code>
  2823.       ServerName www.example.com:80
  2824.     </code></p></div>
  2825.  
  2826.     <p>If no <code class="directive">ServerName</code> is specified, then the
  2827.     server attempts to deduce the hostname by performing a reverse
  2828.     lookup on the IP address. If no port is specified in the
  2829.     <code class="directive">ServerName</code>, then the server will use the
  2830.     port from the incoming request. For optimal reliability and
  2831.     predictability, you should specify an explicit hostname and port
  2832.     using the <code class="directive">ServerName</code> directive.</p>
  2833.  
  2834.     <p>If you are using <a href="../vhosts/name-based.html">name-based virtual hosts</a>,
  2835.     the <code class="directive">ServerName</code> inside a
  2836.     <code class="directive"><a href="#virtualhost"><VirtualHost></a></code>
  2837.     section specifies what hostname must appear in the request's
  2838.     <code>Host:</code> header to match this virtual host.</p>
  2839.  
  2840.  
  2841.     <p>Sometimes, the server runs behind a device that processes SSL,
  2842.     such as a reverse proxy, load balancer or SSL offload
  2843.     appliance. When this is the case, specify the
  2844.     <code>https://</code> scheme and the port number to which the
  2845.     clients connect in the <code class="directive">ServerName</code> directive
  2846.     to make sure that the server generates the correct
  2847.     self-referential URLs. 
  2848.     </p>
  2849.  
  2850.     <p>See the description of the
  2851.     <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> and
  2852.     <code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code>directives for
  2853.     settings which determine whether self-referential URLs (e.g., by the
  2854.     <code class="module"><a href="../mod/mod_dir.html">mod_dir</a></code> module) will refer to the
  2855.     specified port, or to the port number given in the client's request.
  2856.     </p>
  2857.  
  2858.  
  2859. <h3>See also</h3>
  2860. <ul>
  2861. <li><a href="../dns-caveats.html">Issues Regarding DNS and
  2862.     Apache</a></li>
  2863. <li><a href="../vhosts/">Apache virtual host
  2864.     documentation</a></li>
  2865. <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
  2866. <li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
  2867. <li><code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code></li>
  2868. <li><code class="directive"><a href="#serveralias">ServerAlias</a></code></li>
  2869. </ul>
  2870. </div>
  2871. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2872. <div class="directive-section"><h2><a name="ServerPath" id="ServerPath">ServerPath</a> <a name="serverpath" id="serverpath">Directive</a></h2>
  2873. <table class="directive">
  2874. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Legacy URL pathname for a name-based virtual host that
  2875. is accessed by an incompatible browser</td></tr>
  2876. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerPath <var>URL-path</var></code></td></tr>
  2877. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>virtual host</td></tr>
  2878. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2879. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2880. </table>
  2881.     <p>The <code class="directive">ServerPath</code> directive sets the legacy
  2882.     URL pathname for a host, for use with <a href="../vhosts/">name-based virtual hosts</a>.</p>
  2883.  
  2884. <h3>See also</h3>
  2885. <ul>
  2886. <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
  2887. </ul>
  2888. </div>
  2889. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2890. <div class="directive-section"><h2><a name="ServerRoot" id="ServerRoot">ServerRoot</a> <a name="serverroot" id="serverroot">Directive</a></h2>
  2891. <table class="directive">
  2892. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Base directory for the server installation</td></tr>
  2893. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerRoot <var>directory-path</var></code></td></tr>
  2894. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerRoot /usr/local/apache</code></td></tr>
  2895. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  2896. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2897. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2898. </table>
  2899.     <p>The <code class="directive">ServerRoot</code> directive sets the
  2900.     directory in which the server lives. Typically it will contain the
  2901.     subdirectories <code>conf/</code> and <code>logs/</code>. Relative
  2902.     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 
  2903.     relative to this directory.</p>
  2904.  
  2905.     <div class="example"><h3>Example</h3><p><code>
  2906.       ServerRoot /home/httpd
  2907.     </code></p></div>
  2908.  
  2909.  
  2910. <h3>See also</h3>
  2911. <ul>
  2912. <li><a href="../invoking.html">the <code>-d</code>
  2913.     option to <code>httpd</code></a></li>
  2914. <li><a href="../misc/security_tips.html#serverroot">the
  2915.     security tips</a> for information on how to properly set
  2916.     permissions on the <code class="directive">ServerRoot</code></li>
  2917. </ul>
  2918. </div>
  2919. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2920. <div class="directive-section"><h2><a name="ServerSignature" id="ServerSignature">ServerSignature</a> <a name="serversignature" id="serversignature">Directive</a></h2>
  2921. <table class="directive">
  2922. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the footer on server-generated documents</td></tr>
  2923. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>ServerSignature On|Off|EMail</code></td></tr>
  2924. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerSignature Off</code></td></tr>
  2925. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  2926. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>All</td></tr>
  2927. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2928. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2929. </table>
  2930.     <p>The <code class="directive">ServerSignature</code> directive allows the
  2931.     configuration of a trailing footer line under server-generated
  2932.     documents (error messages, <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> ftp directory
  2933.     listings, <code class="module"><a href="../mod/mod_info.html">mod_info</a></code> output, ...). The reason why you
  2934.     would want to enable such a footer line is that in a chain of proxies,
  2935.     the user often has no possibility to tell which of the chained servers
  2936.     actually produced a returned error message.</p>
  2937.  
  2938.     <p>The <code>Off</code>
  2939.     setting, which is the default, suppresses the footer line (and is
  2940.     therefore compatible with the behavior of Apache-1.2 and
  2941.     below). The <code>On</code> setting simply adds a line with the
  2942.     server version number and <code class="directive"><a href="#servername">ServerName</a></code> of the serving virtual host,
  2943.     and the <code>EMail</code> setting additionally creates a
  2944.     "mailto:" reference to the <code class="directive"><a href="#serveradmin">ServerAdmin</a></code> of the referenced
  2945.     document.</p>
  2946.  
  2947.     <p>After version 2.0.44, the details of the server version number
  2948.     presented are controlled by the <code class="directive"><a href="#servertokens">ServerTokens</a></code> directive.</p>
  2949.  
  2950. <h3>See also</h3>
  2951. <ul>
  2952. <li><code class="directive"><a href="#servertokens">ServerTokens</a></code></li>
  2953. </ul>
  2954. </div>
  2955. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  2956. <div class="directive-section"><h2><a name="ServerTokens" id="ServerTokens">ServerTokens</a> <a name="servertokens" id="servertokens">Directive</a></h2>
  2957. <table class="directive">
  2958. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures the <code>Server</code> HTTP response
  2959. header</td></tr>
  2960. <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>
  2961. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>ServerTokens Full</code></td></tr>
  2962. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  2963. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  2964. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  2965. </table>
  2966.     <p>This directive controls whether <code>Server</code> response
  2967.     header field which is sent back to clients includes a
  2968.     description of the generic OS-type of the server as well as
  2969.     information about compiled-in modules.</p>
  2970.  
  2971.     <dl>
  2972.       <dt><code>ServerTokens Prod[uctOnly]</code></dt>
  2973.  
  2974.       <dd>Server sends (<em>e.g.</em>): <code>Server:
  2975.       Apache</code></dd>
  2976.  
  2977.       <dt><code>ServerTokens Major</code></dt>
  2978.  
  2979.       <dd>Server sends (<em>e.g.</em>): <code>Server:
  2980.       Apache/2</code></dd>
  2981.  
  2982.       <dt><code>ServerTokens Minor</code></dt>
  2983.  
  2984.       <dd>Server sends (<em>e.g.</em>): <code>Server:
  2985.       Apache/2.0</code></dd>
  2986.  
  2987.       <dt><code>ServerTokens Min[imal]</code></dt>
  2988.  
  2989.       <dd>Server sends (<em>e.g.</em>): <code>Server:
  2990.       Apache/2.0.41</code></dd>
  2991.  
  2992.       <dt><code>ServerTokens OS</code></dt>
  2993.  
  2994.       <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
  2995.       (Unix)</code></dd>
  2996.  
  2997.       <dt><code>ServerTokens Full</code> (or not specified)</dt>
  2998.  
  2999.       <dd>Server sends (<em>e.g.</em>): <code>Server: Apache/2.0.41
  3000.       (Unix) PHP/4.2.2 MyMod/1.2</code></dd>
  3001.     </dl>
  3002.  
  3003.     <p>This setting applies to the entire server, and cannot be
  3004.     enabled or disabled on a virtualhost-by-virtualhost basis.</p>
  3005.  
  3006.     <p>After version 2.0.44, this directive also controls the
  3007.     information presented by the <code class="directive"><a href="#serversignature">ServerSignature</a></code> directive.</p>
  3008.  
  3009. <h3>See also</h3>
  3010. <ul>
  3011. <li><code class="directive"><a href="#serversignature">ServerSignature</a></code></li>
  3012. </ul>
  3013. </div>
  3014. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  3015. <div class="directive-section"><h2><a name="SetHandler" id="SetHandler">SetHandler</a> <a name="sethandler" id="sethandler">Directive</a></h2>
  3016. <table class="directive">
  3017. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Forces all matching files to be processed by a
  3018. handler</td></tr>
  3019. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetHandler <var>handler-name</var>|None</code></td></tr>
  3020. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  3021. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  3022. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  3023. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  3024. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Moved into the core in Apache 2.0</td></tr>
  3025. </table>
  3026.     <p>When placed into an <code>.htaccess</code> file or a
  3027.     <code class="directive"><a href="#directory"><Directory></a></code> or
  3028.     <code class="directive"><a href="#location"><Location></a></code>
  3029.     section, this directive forces all matching files to be parsed
  3030.     through the <a href="../handler.html">handler</a> given by
  3031.     <var>handler-name</var>. For example, if you had a directory you
  3032.     wanted to be parsed entirely as imagemap rule files, regardless
  3033.     of extension, you might put the following into an
  3034.     <code>.htaccess</code> file in that directory:</p>
  3035.  
  3036.     <div class="example"><p><code>
  3037.       SetHandler imap-file
  3038.     </code></p></div>
  3039.  
  3040.     <p>Another example: if you wanted to have the server display a
  3041.     status report whenever a URL of
  3042.     <code>http://servername/status</code> was called, you might put
  3043.     the following into <code>httpd.conf</code>:</p>
  3044.  
  3045.     <div class="example"><p><code>
  3046.       <Location /status><br />
  3047.       <span class="indent">
  3048.         SetHandler server-status<br />
  3049.       </span>
  3050.       </Location>
  3051.     </code></p></div>
  3052.  
  3053.     <p>You can override an earlier defined <code class="directive">SetHandler</code>
  3054.     directive by using the value <code>None</code>.</p>
  3055.  
  3056. <h3>See also</h3>
  3057. <ul>
  3058. <li><code class="directive"><a href="../mod/mod_mime.html#addhandler">AddHandler</a></code></li>
  3059. </ul>
  3060. </div>
  3061. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  3062. <div class="directive-section"><h2><a name="SetInputFilter" id="SetInputFilter">SetInputFilter</a> <a name="setinputfilter" id="setinputfilter">Directive</a></h2>
  3063. <table class="directive">
  3064. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process client requests and POST
  3065. input</td></tr>
  3066. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetInputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
  3067. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  3068. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  3069. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  3070. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  3071. </table>
  3072.     <p>The <code class="directive">SetInputFilter</code> directive sets the
  3073.     filter or filters which will process client requests and POST
  3074.     input when they are received by the server. This is in addition to
  3075.     any filters defined elsewhere, including the
  3076.     <code class="directive"><a href="../mod/mod_mime.html#addinputfilter">AddInputFilter</a></code>
  3077.     directive.</p>
  3078.  
  3079.     <p>If more than one filter is specified, they must be separated
  3080.     by semicolons in the order in which they should process the
  3081.     content.</p>
  3082.  
  3083. <h3>See also</h3>
  3084. <ul>
  3085. <li><a href="../filter.html">Filters</a> documentation</li>
  3086. </ul>
  3087. </div>
  3088. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  3089. <div class="directive-section"><h2><a name="SetOutputFilter" id="SetOutputFilter">SetOutputFilter</a> <a name="setoutputfilter" id="setoutputfilter">Directive</a></h2>
  3090. <table class="directive">
  3091. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Sets the filters that will process responses from the
  3092. server</td></tr>
  3093. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>SetOutputFilter <var>filter</var>[;<var>filter</var>...]</code></td></tr>
  3094. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory, .htaccess</td></tr>
  3095. <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>FileInfo</td></tr>
  3096. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  3097. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  3098. </table>
  3099.     <p>The <code class="directive">SetOutputFilter</code> directive sets the filters
  3100.     which will process responses from the server before they are
  3101.     sent to the client. This is in addition to any filters defined
  3102.     elsewhere, including the
  3103.     <code class="directive"><a href="../mod/mod_mime.html#addoutputfilter">AddOutputFilter</a></code>
  3104.     directive.</p>
  3105.  
  3106.     <p>For example, the following configuration will process all files
  3107.     in the <code>/www/data/</code> directory for server-side
  3108.     includes.</p>
  3109.  
  3110.     <div class="example"><p><code>
  3111.       <Directory /www/data/><br />
  3112.       <span class="indent">
  3113.         SetOutputFilter INCLUDES<br />
  3114.       </span>
  3115.       </Directory>
  3116.     </code></p></div>
  3117.  
  3118.     <p>If more than one filter is specified, they must be separated
  3119.     by semicolons in the order in which they should process the
  3120.     content.</p>
  3121.  
  3122. <h3>See also</h3>
  3123. <ul>
  3124. <li><a href="../filter.html">Filters</a> documentation</li>
  3125. </ul>
  3126. </div>
  3127. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  3128. <div class="directive-section"><h2><a name="TimeOut" id="TimeOut">TimeOut</a> <a name="timeout" id="timeout">Directive</a></h2>
  3129. <table class="directive">
  3130. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Amount of time the server will wait for
  3131. certain events before failing a request</td></tr>
  3132. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TimeOut <var>seconds</var></code></td></tr>
  3133. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TimeOut 300</code></td></tr>
  3134. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host</td></tr>
  3135. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  3136. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  3137. </table>
  3138.     <p>The <code class="directive">TimeOut</code> directive currently defines
  3139.     the amount of time Apache will wait for three things:</p>
  3140.  
  3141.     <ol>
  3142.       <li>The total amount of time it takes to receive a GET
  3143.       request.</li>
  3144.  
  3145.       <li>The amount of time between receipt of TCP packets on a
  3146.       POST or PUT request.</li>
  3147.  
  3148.       <li>The amount of time between ACKs on transmissions of TCP
  3149.       packets in responses.</li>
  3150.     </ol>
  3151.  
  3152.     <p>We plan on making these separately configurable at some point
  3153.     down the road. The timer used to default to 1200 before 1.2,
  3154.     but has been lowered to 300 which is still far more than
  3155.     necessary in most situations. It is not set any lower by
  3156.     default because there may still be odd places in the code where
  3157.     the timer is not reset when a packet is sent. </p>
  3158.  
  3159. </div>
  3160. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  3161. <div class="directive-section"><h2><a name="TraceEnable" id="TraceEnable">TraceEnable</a> <a name="traceenable" id="traceenable">Directive</a></h2>
  3162. <table class="directive">
  3163. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Determines the behaviour on <code>TRACE</code>
  3164. requests</td></tr>
  3165. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>TraceEnable <var>[on|off|extended]</var></code></td></tr>
  3166. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>TraceEnable on</code></td></tr>
  3167. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  3168. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  3169. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  3170. <tr><th><a href="directive-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 1.3.34, 2.0.55 and later</td></tr>
  3171. </table>
  3172.     <p>This directive overrides the behavior of <code>TRACE</code> for both
  3173.     the core server and <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code>.  The default
  3174.     <code>TraceEnable on</code> permits <code>TRACE</code> requests per
  3175.     RFC 2616, which disallows any request body to accompany the request.
  3176.     <code>TraceEnable off</code> causes the core server and
  3177.     <code class="module"><a href="../mod/mod_proxy.html">mod_proxy</a></code> to return a <code>405</code> (Method not
  3178.     allowed) error to the client.</p>
  3179.  
  3180.     <p>Finally, for testing and diagnostic purposes only, request
  3181.     bodies may be allowed using the non-compliant <code>TraceEnable 
  3182.     extended</code> directive.  The core (as an origin server) will
  3183.     restrict the request body to 64k (plus 8k for chunk headers if
  3184.     <code>Transfer-Encoding: chunked</code> is used).  The core will
  3185.     reflect the full headers and all chunk headers with the response
  3186.     body.  As a proxy server, the request body is not restricted to 64k.</p>
  3187.  
  3188. </div>
  3189. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  3190. <div class="directive-section"><h2><a name="UseCanonicalName" id="UseCanonicalName">UseCanonicalName</a> <a name="usecanonicalname" id="usecanonicalname">Directive</a></h2>
  3191. <table class="directive">
  3192. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
  3193. port</td></tr>
  3194. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalName On|Off|DNS</code></td></tr>
  3195. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalName Off</code></td></tr>
  3196. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
  3197. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  3198. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  3199. </table>
  3200.     <p>In many situations Apache must construct a <em>self-referential</em>
  3201.     URL -- that is, a URL that refers back to the same server. With
  3202.     <code>UseCanonicalName On</code> Apache will use the hostname and port
  3203.     specified in the <code class="directive"><a href="#servername">ServerName</a></code>
  3204.     directive to construct the canonical name for the server. This name
  3205.     is used in all self-referential URLs, and for the values of
  3206.     <code>SERVER_NAME</code> and <code>SERVER_PORT</code> in CGIs.</p>
  3207.  
  3208.     <p>With <code>UseCanonicalName Off</code> Apache will form
  3209.     self-referential URLs using the hostname and port supplied by
  3210.     the client if any are supplied (otherwise it will use the
  3211.     canonical name, as defined above). These values are the same
  3212.     that are used to implement <a href="../vhosts/name-based.html">name based virtual hosts</a>,
  3213.     and are available with the same clients. The CGI variables
  3214.     <code>SERVER_NAME</code> and <code>SERVER_PORT</code> will be
  3215.     constructed from the client supplied values as well.</p>
  3216.  
  3217.     <p>An example where this may be useful is on an intranet server
  3218.     where you have users connecting to the machine using short
  3219.     names such as <code>www</code>. You'll notice that if the users
  3220.     type a shortname, and a URL which is a directory, such as
  3221.     <code>http://www/splat</code>, <em>without the trailing
  3222.     slash</em> then Apache will redirect them to
  3223.     <code>http://www.domain.com/splat/</code>. If you have
  3224.     authentication enabled, this will cause the user to have to
  3225.     authenticate twice (once for <code>www</code> and once again
  3226.     for <code>www.domain.com</code> -- see <a href="http://httpd.apache.org/docs/misc/FAQ.html#prompted-twice">the
  3227.     FAQ on this subject for more information</a>). But if
  3228.     <code class="directive">UseCanonicalName</code> is set <code>Off</code>, then
  3229.     Apache will redirect to <code>http://www/splat/</code>.</p>
  3230.  
  3231.     <p>There is a third option, <code>UseCanonicalName DNS</code>,
  3232.     which is intended for use with mass IP-based virtual hosting to
  3233.     support ancient clients that do not provide a
  3234.     <code>Host:</code> header. With this option Apache does a
  3235.     reverse DNS lookup on the server IP address that the client
  3236.     connected to in order to work out self-referential URLs.</p>
  3237.  
  3238.     <div class="warning"><h3>Warning</h3>
  3239.     <p>If CGIs make assumptions about the values of <code>SERVER_NAME</code>
  3240.     they may be broken by this option. The client is essentially free
  3241.     to give whatever value they want as a hostname. But if the CGI is
  3242.     only using <code>SERVER_NAME</code> to construct self-referential URLs
  3243.     then it should be just fine.</p>
  3244.     </div>
  3245.  
  3246. <h3>See also</h3>
  3247. <ul>
  3248. <li><code class="directive"><a href="#usecanonicalphysicalport">UseCanonicalPhysicalPort</a></code></li>
  3249. <li><code class="directive"><a href="#servername">ServerName</a></code></li>
  3250. <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
  3251. </ul>
  3252. </div>
  3253. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  3254. <div class="directive-section"><h2><a name="UseCanonicalPhysicalPort" id="UseCanonicalPhysicalPort">UseCanonicalPhysicalPort</a> <a name="usecanonicalphysicalport" id="usecanonicalphysicalport">Directive</a></h2>
  3255. <table class="directive">
  3256. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Configures how the server determines its own name and
  3257. port</td></tr>
  3258. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>UseCanonicalPhysicalPort On|Off</code></td></tr>
  3259. <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>UseCanonicalPhysicalPort Off</code></td></tr>
  3260. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config, virtual host, directory</td></tr>
  3261. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  3262. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  3263. </table>
  3264.     <p>In many situations Apache must construct a <em>self-referential</em>
  3265.     URL -- that is, a URL that refers back to the same server. With
  3266.     <code>UseCanonicalPhysicalPort On</code> Apache will, when
  3267.     constructing the canonical port for the server to honor
  3268.     the <code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code> directive,
  3269.     provide the actual physical port number being used by this request
  3270.     as a potential port. With <code>UseCanonicalPhysicalPort Off</code>
  3271.     Apache will not ever use the actual physical port number, instead
  3272.     relying on all configured information to construct a valid port number.</p>
  3273.  
  3274.     <div class="note"><h3>Note</h3>
  3275.     <p>The ordering of when the physical port is used is as follows:<br /><br />
  3276.      <code>UseCanonicalName On</code></p>
  3277.      <ul>
  3278.       <li>Port provided in <code>Servername</code></li>
  3279.       <li>Physical port</li>
  3280.       <li>Default port</li>
  3281.      </ul>
  3282.      <code>UseCanonicalName Off | DNS</code>
  3283.      <ul>
  3284.       <li>Parsed port from <code>Host:</code> header</li>
  3285.       <li>Physical port</li>
  3286.       <li>Port provided in <code>Servername</code></li>
  3287.       <li>Default port</li>
  3288.      </ul>
  3289.     
  3290.     <p>With <code>UseCanonicalPhysicalPort Off</code>, the
  3291.     physical ports are removed from the ordering.</p>
  3292.     </div>
  3293.  
  3294.  
  3295. <h3>See also</h3>
  3296. <ul>
  3297. <li><code class="directive"><a href="#usecanonicalname">UseCanonicalName</a></code></li>
  3298. <li><code class="directive"><a href="#servername">ServerName</a></code></li>
  3299. <li><code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code></li>
  3300. </ul>
  3301. </div>
  3302. <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
  3303. <div class="directive-section"><h2><a name="VirtualHost" id="VirtualHost"><VirtualHost></a> <a name="virtualhost" id="virtualhost">Directive</a></h2>
  3304. <table class="directive">
  3305. <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Contains directives that apply only to a specific
  3306. hostname or IP address</td></tr>
  3307. <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code><VirtualHost
  3308.     <var>addr</var>[:<var>port</var>] [<var>addr</var>[:<var>port</var>]]
  3309.     ...> ... </VirtualHost></code></td></tr>
  3310. <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>server config</td></tr>
  3311. <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Core</td></tr>
  3312. <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>core</td></tr>
  3313. </table>
  3314.     <p><code class="directive"><VirtualHost></code> and
  3315.     <code></VirtualHost></code> are used to enclose a group of
  3316.     directives that will apply only to a particular virtual host. Any
  3317.     directive that is allowed in a virtual host context may be
  3318.     used. When the server receives a request for a document on a
  3319.     particular virtual host, it uses the configuration directives
  3320.     enclosed in the <code class="directive"><VirtualHost></code>
  3321.     section. <var>Addr</var> can be:</p>
  3322.  
  3323.     <ul>
  3324.       <li>The IP address of the virtual host;</li>
  3325.  
  3326.       <li>A fully qualified domain name for the IP address of the
  3327.       virtual host (not recommended);</li>
  3328.  
  3329.       <li>The character <code>*</code>, which is used only in combination with
  3330.       <code>NameVirtualHost *</code> to match all IP addresses; or</li>
  3331.  
  3332.       <li>The string <code>_default_</code>, which is used only
  3333.       with IP virtual hosting to catch unmatched IP addresses.</li>
  3334.     </ul>
  3335.  
  3336.     <div class="example"><h3>Example</h3><p><code>
  3337.       <VirtualHost 10.1.2.3><br />
  3338.       <span class="indent">
  3339.         ServerAdmin webmaster@host.foo.com<br />
  3340.         DocumentRoot /www/docs/host.foo.com<br />
  3341.         ServerName host.foo.com<br />
  3342.         ErrorLog logs/host.foo.com-error_log<br />
  3343.         TransferLog logs/host.foo.com-access_log<br />
  3344.       </span>
  3345.       </VirtualHost>
  3346.     </code></p></div>
  3347.  
  3348.  
  3349.     <p>IPv6 addresses must be specified in square brackets because
  3350.     the optional port number could not be determined otherwise.  An
  3351.     IPv6 example is shown below:</p>
  3352.  
  3353.     <div class="example"><p><code>
  3354.       <VirtualHost [2001:db8::a00:20ff:fea7:ccea]><br />
  3355.       <span class="indent">
  3356.         ServerAdmin webmaster@host.example.com<br />
  3357.         DocumentRoot /www/docs/host.example.com<br />
  3358.         ServerName host.example.com<br />
  3359.         ErrorLog logs/host.example.com-error_log<br />
  3360.         TransferLog logs/host.example.com-access_log<br />
  3361.       </span>
  3362.       </VirtualHost>
  3363.     </code></p></div>
  3364.  
  3365.     <p>Each Virtual Host must correspond to a different IP address,
  3366.     different port number or a different host name for the server,
  3367.     in the former case the server machine must be configured to
  3368.     accept IP packets for multiple addresses. (If the machine does
  3369.     not have multiple network interfaces, then this can be
  3370.     accomplished with the <code>ifconfig alias</code> command -- if
  3371.     your OS supports it).</p>
  3372.  
  3373.     <div class="note"><h3>Note</h3>
  3374.     <p>The use of <code class="directive"><VirtualHost></code> does
  3375.     <strong>not</strong> affect what addresses Apache listens on. You
  3376.     may need to ensure that Apache is listening on the correct addresses
  3377.     using <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>.</p>
  3378.     </div>
  3379.  
  3380.     <p>When using IP-based virtual hosting, the special name
  3381.     <code>_default_</code> can be specified in
  3382.     which case this virtual host will match any IP address that is
  3383.     not explicitly listed in another virtual host. In the absence
  3384.     of any <code>_default_</code> virtual host the "main" server config,
  3385.     consisting of all those definitions outside any VirtualHost
  3386.     section, is used when no IP-match occurs.  (But note that any IP
  3387.     address that matches a <code class="directive"><a href="#namevirtualhost">NameVirtualHost</a></code> directive will use neither
  3388.     the "main" server config nor the <code>_default_</code> virtual host.
  3389.     See the <a href="../vhosts/name-based.html">name-based virtual hosting</a>
  3390.     documentation for further details.)</p>
  3391.  
  3392.     <p>You can specify a <code>:port</code> to change the port that is
  3393.     matched. If unspecified then it defaults to the same port as the
  3394.     most recent <code class="directive"><a href="../mod/mpm_common.html#listen">Listen</a></code>
  3395.     statement of the main server. You may also specify <code>:*</code>
  3396.     to match all ports on that address. (This is recommended when used
  3397.     with <code>_default_</code>.)</p>
  3398.  
  3399.     <p>A <code class="directive"><a href="#servername">ServerName</a></code> should be
  3400.     specified inside each <code class="directive"><VirtualHost></code> block. If it is absent, the
  3401.     <code class="directive"><a href="#servername">ServerName</a></code> from the "main"
  3402.     server configuration will be inherited.</p>
  3403.  
  3404.     <div class="warning"><h3>Security</h3>
  3405.     <p>See the <a href="../misc/security_tips.html">security tips</a>
  3406.     document for details on why your security could be compromised if the
  3407.     directory where log files are stored is writable by anyone other
  3408.     than the user that starts the server.</p>
  3409.     </div>
  3410.  
  3411. <h3>See also</h3>
  3412. <ul>
  3413. <li><a href="../vhosts/">Apache Virtual Host documentation</a></li>
  3414. <li><a href="../dns-caveats.html">Issues Regarding DNS and
  3415.     Apache</a></li>
  3416. <li><a href="../bind.html">Setting
  3417.     which addresses and ports Apache uses</a></li>
  3418. <li><a href="../sections.html">How <Directory>, <Location>
  3419.     and <Files> sections work</a> for an explanation of how these
  3420.     different sections are combined when a request is received</li>
  3421. </ul>
  3422. </div>
  3423. </div>
  3424. <div class="bottomlang">
  3425. <p><span>Available Languages: </span><a href="../de/mod/core.html" hreflang="de" rel="alternate" title="Deutsch"> de </a> |
  3426. <a href="../en/mod/core.html" title="English"> en </a> |
  3427. <a href="../ja/mod/core.html" hreflang="ja" rel="alternate" title="Japanese"> ja </a></p>
  3428. </div><div id="footer">
  3429. <p class="apache">Copyright 2007 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>
  3430. <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>
  3431. </body></html>