diff options
author | Stefan Fritsch <sf@sfritsch.de> | 2014-03-29 21:56:19 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@sfritsch.de> | 2014-03-29 21:56:45 +0100 |
commit | 2a463b3cd73c32ee9dcd508248d0194923f435f4 (patch) | |
tree | 2ff478255a77a55031056790918b6f983bb7b20a /docs/manual/mod/core.html.en | |
parent | 86d5cc79d9d6750da8771fdb0c9ab22c19b8ad45 (diff) | |
download | apache2-upstream/2.4.9.tar.gz |
Imported Upstream version 2.4.9upstream/2.4.9
Diffstat (limited to 'docs/manual/mod/core.html.en')
-rw-r--r-- | docs/manual/mod/core.html.en | 358 |
1 files changed, 145 insertions, 213 deletions
diff --git a/docs/manual/mod/core.html.en b/docs/manual/mod/core.html.en index f3941375..1cdb0a70 100644 --- a/docs/manual/mod/core.html.en +++ b/docs/manual/mod/core.html.en @@ -9,7 +9,7 @@ <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" /> <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" /> <link href="../style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" /><link rel="stylesheet" type="text/css" href="../style/css/prettify.css" /> -<script src="../style/scripts/prettify.js" type="text/javascript"> +<script src="../style/scripts/prettify.min.js" type="text/javascript"> </script> <link href="../images/favicon.ico" rel="shortcut icon" /></head> @@ -140,9 +140,7 @@ On Windows from Apache httpd 2.3.3 and later.</td></tr> <p>Using <code>none</code> for an argument will disable any accept filters for that protocol. This is useful for protocols that require a server send data first, such as <code>ftp:</code> or <code>nntp</code>:</p> - <pre class="prettyprint lang-config"> - AcceptFilter nntp none - </pre> + <pre class="prettyprint lang-config">AcceptFilter nntp none</pre> <p>The default protocol names are <code>https</code> for port 443 @@ -152,10 +150,8 @@ On Windows from Apache httpd 2.3.3 and later.</td></tr> directive.</p> <p>The default values on FreeBSD are:</p> - <pre class="prettyprint lang-config"> -AcceptFilter http httpready -AcceptFilter https dataready - </pre> + <pre class="prettyprint lang-config">AcceptFilter http httpready +AcceptFilter https dataready</pre> <p>The <code>httpready</code> accept filter buffers entire HTTP requests at @@ -167,10 +163,8 @@ AcceptFilter https dataready accf_data(9)</a> filter is used.</p> <p>The default values on Linux are:</p> - <pre class="prettyprint lang-config"> -AcceptFilter http data -AcceptFilter https data - </pre> + <pre class="prettyprint lang-config">AcceptFilter http data +AcceptFilter https data</pre> <p>Linux's <code>TCP_DEFER_ACCEPT</code> does not support buffering http @@ -181,10 +175,8 @@ AcceptFilter https data tcp(7)</a> man page.</p> <p>The default values on Windows are:</p> - <pre class="prettyprint lang-config"> -AcceptFilter http data -AcceptFilter https data - </pre> + <pre class="prettyprint lang-config">AcceptFilter http data +AcceptFilter https data</pre> <p>Window's mpm_winnt interprets the AcceptFilter to toggle the AcceptEx() @@ -266,13 +258,11 @@ AcceptFilter https data the request, so you can use the following configuration to enable such a script:</p> - <pre class="prettyprint lang-config"> -<Files "mypaths.shtml"> + <pre class="prettyprint lang-config"><Files "mypaths.shtml"> Options +Includes SetOutputFilter INCLUDES AcceptPathInfo On -</Files> - </pre> +</Files></pre> @@ -302,11 +292,9 @@ AcceptFilter https data <code>/usr/local/.acl</code> and <code>/usr/local/web/.acl</code> for directives, unless they have been disabled with</p> - <pre class="prettyprint lang-config"> -<Directory /> + <pre class="prettyprint lang-config"><Directory /> AllowOverride None -</Directory> - </pre> +</Directory></pre> <h3>See also</h3> @@ -585,10 +573,8 @@ NoDecode option available in 2.3.12 and later.</td></tr> <p>Example:</p> - <pre class="prettyprint lang-config"> -AllowOverride None -AllowOverrideList Redirect RedirectMatch - </pre> + <pre class="prettyprint lang-config">AllowOverride None +AllowOverrideList Redirect RedirectMatch</pre> <p>In the example above only the <code>Redirect</code> and @@ -597,13 +583,11 @@ AllowOverrideList Redirect RedirectMatch <p>Example:</p> - <pre class="prettyprint lang-config"> -AllowOverride AuthConfig -AllowOverrideList CookieTracking CookieName - </pre> + <pre class="prettyprint lang-config">AllowOverride AuthConfig +AllowOverrideList CookieTracking CookieName</pre> - <p>In the example above <code class="directive"><a href="#allowoverride ">AllowOverride + <p>In the example above <code class="directive"><a href="#allowoverride">AllowOverride </a></code> grants permission to the <code>AuthConfig</code> directive grouping and <code class="directive">AllowOverrideList</code> grants permission to only two directives from the <code>FileInfo</code> directive @@ -692,9 +676,7 @@ headers</td></tr> will be relative to <code class="directive">ServerRoot</code>.</p> <p><strong>Example</strong></p> - <pre class="prettyprint lang-config"> -DefaultRuntimeDir scratch/ - </pre> + <pre class="prettyprint lang-config">DefaultRuntimeDir scratch/</pre> <p>The default location of <code class="directive">DefaultRuntimeDir</code> may be @@ -769,8 +751,7 @@ which no other media type configuration could be found. the <code>${VAR}</code> syntax. The variable is always globally defined and not limited to the scope of the surrounding config section.</p> - <pre class="prettyprint lang-config"> -<IfDefine TEST> + <pre class="prettyprint lang-config"><IfDefine TEST> Define servername test.example.com </IfDefine> <IfDefine !TEST> @@ -778,8 +759,7 @@ which no other media type configuration could be found. Define SSL </IfDefine> -DocumentRoot /var/www/${servername}/htdocs - </pre> +DocumentRoot /var/www/${servername}/htdocs</pre> <p>Variable names may not contain colon ":" characters, to avoid clashes @@ -812,11 +792,9 @@ named file-system directory, sub-directories, and their contents.</td></tr> <code>/home/user/public_html</code>, but <code><Directory /home/*/public_html></code> will match. Example:</p> - <pre class="prettyprint lang-config"> -<Directory "/usr/local/httpd/htdocs"> + <pre class="prettyprint lang-config"><Directory "/usr/local/httpd/htdocs"> Options Indexes FollowSymLinks -</Directory> - </pre> +</Directory></pre> <div class="note"> @@ -832,11 +810,9 @@ named file-system directory, sub-directories, and their contents.</td></tr> expressions</a> can also be used, with the addition of the <code>~</code> character. For example:</p> - <pre class="prettyprint lang-config"> -<Directory ~ "^/www/[0-9]{3}"> + <pre class="prettyprint lang-config"><Directory ~ "^/www/[0-9]{3}"> -</Directory> -</pre> +</Directory></pre> <p>would match directories in <code>/www/</code> that consisted of @@ -848,15 +824,13 @@ named file-system directory, sub-directories, and their contents.</td></tr> first, interspersed with the directives from the <a href="#accessfilename">.htaccess</a> files. For example, with</p> - <pre class="prettyprint lang-config"> -<Directory /> + <pre class="prettyprint lang-config"><Directory /> AllowOverride None </Directory> <Directory "/home"> AllowOverride FileInfo -</Directory> - </pre> +</Directory></pre> <p>for access to the document <code>/home/web/dir/doc.html</code> @@ -879,11 +853,9 @@ named file-system directory, sub-directories, and their contents.</td></tr> expressions are tested in the order they appeared in the configuration file. For example, with</p> - <pre class="prettyprint lang-config"> -<Directory ~ "abc$"> + <pre class="prettyprint lang-config"><Directory ~ "abc$"> # ... directives here ... -</Directory> - </pre> +</Directory></pre> <p>the regular expression section won't be considered until after @@ -899,11 +871,9 @@ named file-system directory, sub-directories, and their contents.</td></tr> recommended that you change this with a block such as</strong></p> - <pre class="prettyprint lang-config"> -<Directory /> + <pre class="prettyprint lang-config"><Directory /> Require all denied -</Directory> - </pre> +</Directory></pre> <p><strong>and then override this for directories you @@ -940,11 +910,9 @@ the contents of file-system directories matching a regular expression.</td></tr> However, it takes as an argument a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>. For example:</p> - <pre class="prettyprint lang-config"> -<DirectoryMatch "^/www/(.+/)?[0-9]{3}"> + <pre class="prettyprint lang-config"><DirectoryMatch "^/www/(.+/)?[0-9]{3}"> # ... -</DirectoryMatch> -</pre> +</DirectoryMatch></pre> <p>would match directories in <code>/www/</code> that consisted of three @@ -964,6 +932,18 @@ the contents of file-system directories matching a regular expression.</td></tr> end of line ($) must be written with care. </div> + <p>From 2.4.8 onwards, named groups and backreferences are captured and + written to the environment with the corresponding name prefixed with + "MATCH_" and in upper case. This allows elements of paths to be referenced + from within <a href="../expr.html">expressions</a> and modules like + <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>. In order to prevent confusion, numbered + (unnamed) backreferences are ignored. Use named groups instead.</p> + +<pre class="prettyprint lang-config"><DirectoryMatch ^/var/www/combined/(?<sitename>[^/]+)> + require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example +</DirectoryMatch></pre> + + <h3>See also</h3> <ul> <li><code class="directive"><a href="#directory"><Directory></a></code> for @@ -1027,14 +1007,12 @@ satisfied by a request at runtime</td></tr> in the same scope has not been applied. For example: In </p> - <pre class="prettyprint lang-config"> -<If "-z req('Host')"> + <pre class="prettyprint lang-config"><If "-z req('Host')"> # ... </If> <Else> # ... -</Else> - </pre> +</Else></pre> <p> The <code class="directive"><If></code> would match HTTP/1.0 @@ -1075,8 +1053,7 @@ satisfied</td></tr> <code class="directive"><ElseIf></code> section in the same scope has not been applied. For example: In </p> - <pre class="prettyprint lang-config"> -<If "-R '10.1.0.0/16'"> + <pre class="prettyprint lang-config"><If "-R '10.1.0.0/16'"> #... </If> <ElseIf "-R '10.0.0.0/8'"> @@ -1084,8 +1061,7 @@ satisfied</td></tr> </ElseIf> <Else> #... -</Else> - </pre> +</Else></pre> <p>The <code class="directive"><ElseIf></code> would match if @@ -1147,11 +1123,9 @@ for a complete reference and more examples.</li> <p>For NFS mounted files, this feature may be disabled explicitly for the offending files by specifying:</p> - <pre class="prettyprint lang-config"> -<Directory "/path-to-nfs-files"> + <pre class="prettyprint lang-config"><Directory "/path-to-nfs-files"> EnableMMAP Off -</Directory> - </pre> +</Directory></pre> </div> @@ -1203,11 +1177,9 @@ version 2.3.9.</td></tr> <p>For network mounted files, this feature may be disabled explicitly for the offending files by specifying:</p> - <pre class="prettyprint lang-config"> -<Directory "/path-to-nfs-files"> + <pre class="prettyprint lang-config"><Directory "/path-to-nfs-files"> EnableSendfile Off -</Directory> - </pre> +</Directory></pre> <p>Please note that the per-directory and .htaccess configuration of <code class="directive">EnableSendfile</code> is not supported by @@ -1232,8 +1204,7 @@ version 2.3.9.</td></tr> configuration parsing. The typical use is for reporting required modules which are missing from the configuration.</p> - <pre class="prettyprint lang-config"> -# Example + <pre class="prettyprint lang-config"># Example # ensure that mod_include is loaded <IfModule !include_module> Error "mod_include is required by mod_foo. Load it with LoadModule." @@ -1249,8 +1220,7 @@ version 2.3.9.</td></tr> <IfDefine !NOSSL> Error "Either SSL or NOSSL must be defined." </IfDefine> -</IfDefine> - </pre> +</IfDefine></pre> @@ -1292,13 +1262,11 @@ in case of an error</td></tr> full URL which the client can resolve. Alternatively, a message can be provided to be displayed by the browser. Examples:</p> - <pre class="prettyprint lang-config"> -ErrorDocument 500 http://foo.example.com/cgi-bin/tester + <pre class="prettyprint lang-config">ErrorDocument 500 http://foo.example.com/cgi-bin/tester ErrorDocument 404 /cgi-bin/bad_urls.pl ErrorDocument 401 /subscription_info.html ErrorDocument 403 "Sorry can't allow you access today" -ErrorDocument 403 Forbidden! - </pre> +ErrorDocument 403 Forbidden!</pre> <p>Additionally, the special value <code>default</code> can be used @@ -1307,13 +1275,11 @@ ErrorDocument 403 Forbidden! Apache httpd's simple hardcoded message for configurations that would otherwise inherit an existing <code class="directive">ErrorDocument</code>.</p> - <pre class="prettyprint lang-config"> -ErrorDocument 404 /cgi-bin/bad_urls.pl + <pre class="prettyprint lang-config">ErrorDocument 404 /cgi-bin/bad_urls.pl <Directory /web/docs> ErrorDocument 404 default -</Directory> - </pre> +</Directory></pre> <p>Note that when you specify an <code class="directive">ErrorDocument</code> @@ -1430,10 +1396,8 @@ ErrorDocument 404 /cgi-bin/bad_urls.pl supplementary information is logged in the error log in addition to the actual log message.</p> - <pre class="prettyprint lang-config"> -#Simple example -ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M" - </pre> + <pre class="prettyprint lang-config">#Simple example +ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M"</pre> <p>Specifying <code>connection</code> or <code>request</code> as first @@ -1562,10 +1526,8 @@ ErrorLogFormat "[%t] [%l] [pid %P] %F: %E: [client %a] %M" with error log lines. If <code class="module"><a href="../mod/mod_unique_id.html">mod_unique_id</a></code> is loaded, its unique id will be used as log ID for requests.</p> - <pre class="prettyprint lang-config"> -#Example (default format for threaded MPMs) -ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i" - </pre> + <pre class="prettyprint lang-config">#Example (default format for threaded MPMs) +ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"</pre> <p>This would result in error messages such as:</p> @@ -1577,20 +1539,16 @@ ErrorLogFormat "[%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %M% <p>Notice that, as discussed above, some fields are omitted entirely because they are not defined.</p> - <pre class="prettyprint lang-config"> -#Example (similar to the 2.2.x format) -ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i" - </pre> + <pre class="prettyprint lang-config">#Example (similar to the 2.2.x format) +ErrorLogFormat "[%t] [%l] %7F: %E: [client\ %a] %M% ,\ referer\ %{Referer}i"</pre> - <pre class="prettyprint lang-config"> -#Advanced example with request/connection log IDs + <pre class="prettyprint lang-config">#Advanced example with request/connection log IDs ErrorLogFormat "[%{uc}t] [%-m:%-l] [R:%L] [C:%{C}L] %7F: %E: %M" ErrorLogFormat request "[%{uc}t] [R:%L] Request %k on C:%{c}L pid:%P tid:%T" ErrorLogFormat request "[%{uc}t] [R:%L] UA:'%+{User-Agent}i'" ErrorLogFormat request "[%{uc}t] [R:%L] Referer:'%+{Referer}i'" -ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A" - </pre> +ErrorLogFormat connection "[%{uc}t] [C:%{c}L] local\ %a remote\ %A"</pre> @@ -1732,25 +1690,21 @@ filenames</td></tr> <p>The <var>filename</var> argument should include a filename, or a wild-card string, where <code>?</code> matches any single character, and <code>*</code> matches any sequences of characters.</p> - <pre class="prettyprint lang-config"> -<Files "cat.html"> + <pre class="prettyprint lang-config"><Files "cat.html"> # Insert stuff that applies to cat.html here </Files> <Files "?at.*"> # This would apply to cat.html, bat.html, hat.php and so on. -</Files> -</pre> +</Files></pre> <p><a class="glossarylink" href="../glossary.html#regex" title="see glossary">Regular expressions</a> can also be used, with the addition of the <code>~</code> character. For example:</p> - <pre class="prettyprint lang-config"> -<Files ~ "\.(gif|jpe?g|png)$"> + <pre class="prettyprint lang-config"><Files ~ "\.(gif|jpe?g|png)$"> #... -</Files> -</pre> +</Files></pre> <p>would match most common Internet graphics formats. <code class="directive"><a href="#filesmatch"><FilesMatch></a></code> is preferred, @@ -1785,15 +1739,25 @@ filenames</td></tr> does. However, it accepts a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a>. For example:</p> -<pre class="prettyprint lang-config"> -<FilesMatch "\.(gif|jpe?g|png)$"> +<pre class="prettyprint lang-config"><FilesMatch "\.(gif|jpe?g|png)$"> # ... -</FilesMatch> -</pre> +</FilesMatch></pre> <p>would match most common Internet graphics formats.</p> + <p>From 2.4.8 onwards, named groups and backreferences are captured and + written to the environment with the corresponding name prefixed with + "MATCH_" and in upper case. This allows elements of files to be referenced + from within <a href="../expr.html">expressions</a> and modules like + <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>. In order to prevent confusion, numbered + (unnamed) backreferences are ignored. Use named groups instead.</p> + +<pre class="prettyprint lang-config"><FileMatch ^(?<sitename>[^/]+)> + require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example +</FileMatch></pre> + + <h3>See also</h3> <ul> <li><a href="../sections.html">How <Directory>, <Location> @@ -1833,8 +1797,7 @@ media type in the HTTP Content-Type header field</td></tr> <code class="directive">ForceType</code> settings by using the value of <code>None</code>:</p> - <pre class="prettyprint lang-config"> -# force all files to be image/gif: + <pre class="prettyprint lang-config"># force all files to be image/gif: <Location /images> ForceType image/gif </Location> @@ -1842,8 +1805,7 @@ media type in the HTTP Content-Type header field</td></tr> # but normal mime-type associations here: <Location /images/mixed> ForceType None -</Location> - </pre> +</Location></pre> <p>This directive primarily overrides the content types generated for @@ -1952,6 +1914,8 @@ satisfied by a request at runtime</td></tr> documentation is available in <a href="../expr.html">Expressions in Apache HTTP Server</a>.</p> + <p>Only directives that support the <a href="directive-dict.html#Context">directory context</a> can be used within this configuration section.</p> + <h3>See also</h3> <ul> @@ -2009,8 +1973,7 @@ if a test is true at startup</td></tr> multiple-parameter tests. Example:</p> <div class="example"><p><code>httpd -DReverseProxy -DUseCache -DMemCache ...</code></p></div> - <pre class="prettyprint lang-config"> -<IfDefine ReverseProxy> + <pre class="prettyprint lang-config"><IfDefine ReverseProxy> LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_http_module modules/mod_proxy_http.so <IfDefine UseCache> @@ -2022,8 +1985,7 @@ if a test is true at startup</td></tr> LoadModule cache_disk_module modules/mod_cache_disk.so </IfDefine> </IfDefine> -</IfDefine> - </pre> +</IfDefine></pre> </div> @@ -2116,18 +2078,14 @@ wildcard matching available in 2.3.6 and later</td></tr> <p>Examples:</p> - <pre class="prettyprint lang-config"> -Include /usr/local/apache2/conf/ssl.conf -Include /usr/local/apache2/conf/vhosts/*.conf - </pre> + <pre class="prettyprint lang-config">Include /usr/local/apache2/conf/ssl.conf +Include /usr/local/apache2/conf/vhosts/*.conf</pre> <p>Or, providing paths relative to your <code class="directive"><a href="#serverroot">ServerRoot</a></code> directory:</p> - <pre class="prettyprint lang-config"> -Include conf/ssl.conf -Include conf/vhosts/*.conf - </pre> + <pre class="prettyprint lang-config">Include conf/ssl.conf +Include conf/vhosts/*.conf</pre> <p>Wildcards may be included in the directory or file portion of the @@ -2267,11 +2225,9 @@ methods</td></tr> only to the methods <code>POST</code>, <code>PUT</code>, and <code>DELETE</code>, leaving all other methods unprotected:</p> - <pre class="prettyprint lang-config"> -<Limit POST PUT DELETE> + <pre class="prettyprint lang-config"><Limit POST PUT DELETE> Require valid-user -</Limit> - </pre> +</Limit></pre> <p>The method names listed can be one or more of: <code>GET</code>, @@ -2308,14 +2264,12 @@ methods</td></tr> <code>Require group editors</code> directive will be ignored in all cases:</p> - <pre class="prettyprint lang-config"> -<LimitExcept GET> + <pre class="prettyprint lang-config"><LimitExcept GET> Require valid-user </LimitExcept> <Limit POST> Require group editors -</Limit> - </pre> +</Limit></pre> </div> @@ -2341,11 +2295,9 @@ except the named ones</td></tr> <p>For example:</p> - <pre class="prettyprint lang-config"> -<LimitExcept POST GET> + <pre class="prettyprint lang-config"><LimitExcept POST GET> Require valid-user -</LimitExcept> - </pre> +</LimitExcept></pre> @@ -2630,22 +2582,18 @@ URLs</td></tr> /private1, /private1/ and /private1/file.txt will have the enclosed directives applied, but /private1other would not. </p> - <pre class="prettyprint lang-config"> -<Location /private1> + <pre class="prettyprint lang-config"><Location /private1> # ... -</Location> - </pre> +</Location></pre> <p> In the example below, where a trailing slash is used, requests to /private2/ and /private2/file.txt will have the enclosed directives applied, but /private2 and /private2other would not. </p> - <pre class="prettyprint lang-config"> -<Location /private2<em>/</em>> + <pre class="prettyprint lang-config"><Location /private2<em>/</em>> # ... -</Location> - </pre> +</Location></pre> <div class="note"><h3>When to use <code class="directive"><Location></code></h3> @@ -2672,11 +2620,9 @@ URLs</td></tr> can also be used, with the addition of the <code>~</code> character. For example:</p> - <pre class="prettyprint lang-config"> -<Location ~ "/(extra|special)/data"> + <pre class="prettyprint lang-config"><Location ~ "/(extra|special)/data"> #... -</Location> -</pre> +</Location></pre> <p>would match URLs that contained the substring <code>/extra/data</code> @@ -2691,12 +2637,10 @@ URLs</td></tr> directive. For example, to enable status requests, but allow them only from browsers at <code>example.com</code>, you might use:</p> - <pre class="prettyprint lang-config"> -<Location /status> + <pre class="prettyprint lang-config"><Location /status> SetHandler server-status Require host example.com -</Location> - </pre> +</Location></pre> <div class="note"><h3>Note about / (slash)</h3> @@ -2743,16 +2687,26 @@ matching URLs</td></tr> it takes a <a class="glossarylink" href="../glossary.html#regex" title="see glossary">regular expression</a> as an argument instead of a simple string. For example:</p> - <pre class="prettyprint lang-config"> -<LocationMatch "/(extra|special)/data"> + <pre class="prettyprint lang-config"><LocationMatch "/(extra|special)/data"> # ... -</LocationMatch> -</pre> +</LocationMatch></pre> <p>would match URLs that contained the substring <code>/extra/data</code> or <code>/special/data</code>.</p> + <p>From 2.4.8 onwards, named groups and backreferences are captured and + written to the environment with the corresponding name prefixed with + "MATCH_" and in upper case. This allows elements of URLs to be referenced + from within <a href="../expr.html">expressions</a> and modules like + <code class="module"><a href="../mod/mod_rewrite.html">mod_rewrite</a></code>. In order to prevent confusion, numbered + (unnamed) backreferences are ignored. Use named groups instead.</p> + +<pre class="prettyprint lang-config"><LocationMatch ^/combined/(?<sitename>[^/]+)> + require ldap-group cn=%{env:MATCH_SITENAME},ou=combined,o=Example +</LocationMatch></pre> + + <h3>See also</h3> <ul> <li><a href="../sections.html">How <Directory>, <Location> @@ -2942,21 +2896,17 @@ matching URLs</td></tr> as module specification. This means the following three specifications are equivalent:</p> - <pre class="prettyprint lang-config"> -LogLevel info ssl:warn + <pre class="prettyprint lang-config">LogLevel info ssl:warn LogLevel info mod_ssl.c:warn -LogLevel info ssl_module:warn - </pre> +LogLevel info ssl_module:warn</pre> <p>It is also possible to change the level per directory:</p> - <pre class="prettyprint lang-config"> -LogLevel info + <pre class="prettyprint lang-config">LogLevel info <Directory "/usr/local/apache/htdocs/app"> LogLevel debug -</Directory> - </pre> +</Directory></pre> <div class="note"> @@ -3314,10 +3264,8 @@ or specified mutexes</td></tr> <code>/var/httpd/locks</code>. The mutex mechanism for all other mutexes will be changed from the compiled-in default to <code>sysvsem</code>.</p> - <pre class="prettyprint lang-config"> -Mutex sysvsem default -Mutex fcntl:/var/httpd/locks mpm-accept - </pre> + <pre class="prettyprint lang-config">Mutex sysvsem default +Mutex fcntl:/var/httpd/locks mpm-accept</pre> </div> @@ -3468,15 +3416,13 @@ directory</td></tr> <p>For example, without any <code>+</code> and <code>-</code> symbols:</p> - <pre class="prettyprint lang-config"> -<Directory "/web/docs"> + <pre class="prettyprint lang-config"><Directory "/web/docs"> Options Indexes FollowSymLinks </Directory> <Directory "/web/docs/spec"> Options Includes -</Directory> - </pre> +</Directory></pre> <p>then only <code>Includes</code> will be set for the @@ -3484,15 +3430,13 @@ directory</td></tr> <code class="directive">Options</code> directive uses the <code>+</code> and <code>-</code> symbols:</p> - <pre class="prettyprint lang-config"> -<Directory "/web/docs"> + <pre class="prettyprint lang-config"><Directory "/web/docs"> Options Indexes FollowSymLinks </Directory> <Directory "/web/docs/spec"> Options +Includes -Indexes -</Directory> - </pre> +</Directory></pre> <p>then the options <code>FollowSymLinks</code> and @@ -3795,15 +3739,13 @@ to name-virtual hosts</td></tr> alternate names for a host, for use with <a href="../vhosts/name-based.html">name-based virtual hosts</a>. The <code class="directive">ServerAlias</code> may include wildcards, if appropriate.</p> - <pre class="prettyprint lang-config"> -<VirtualHost *:80> + <pre class="prettyprint lang-config"><VirtualHost *:80> ServerName server.example.com ServerAlias server server2.example.com server2 ServerAlias *.example.com UseCanonicalName Off # ... -</VirtualHost> - </pre> +</VirtualHost></pre> <p>Name-based virtual hosts for the best-matching set of <code class="directive"><a href="#virtualhost"><virtualhost></a></code>s are processed @@ -4094,21 +4036,17 @@ handler</td></tr> <code>http://servername/status</code> was called, you might put the following into <code>httpd.conf</code>:</p> - <pre class="prettyprint lang-config"> -<Location "/status"> + <pre class="prettyprint lang-config"><Location "/status"> SetHandler server-status -</Location> - </pre> +</Location></pre> <p>You could also use this directive to configure a particular handler for files with a particular file extension. For example:</p> - <pre class="prettyprint lang-config"> -<FilesMatch \.php$> + <pre class="prettyprint lang-config"><FilesMatch \.php$> SetHandler application/x-httpd-php -</FilesMatch> - </pre> +</FilesMatch></pre> <p>You can override an earlier defined <code class="directive">SetHandler</code> @@ -4173,11 +4111,9 @@ server</td></tr> in the <code>/www/data/</code> directory for server-side includes.</p> - <pre class="prettyprint lang-config"> -<Directory "/www/data/"> + <pre class="prettyprint lang-config"><Directory "/www/data/"> SetOutputFilter INCLUDES -</Directory> - </pre> +</Directory></pre> <p>If more than one filter is specified, they must be separated @@ -4428,15 +4364,13 @@ hostname or IP address</td></tr> </ul> - <pre class="prettyprint lang-config"> -<VirtualHost 10.1.2.3:80> + <pre class="prettyprint lang-config"><VirtualHost 10.1.2.3:80> ServerAdmin webmaster@host.example.com DocumentRoot /www/docs/host.example.com ServerName host.example.com ErrorLog logs/host.example.com-error_log TransferLog logs/host.example.com-access_log -</VirtualHost> - </pre> +</VirtualHost></pre> @@ -4444,15 +4378,13 @@ hostname or IP address</td></tr> the optional port number could not be determined otherwise. An IPv6 example is shown below:</p> - <pre class="prettyprint lang-config"> -<VirtualHost [2001:db8::a00:20ff:fea7:ccea]:80> + <pre class="prettyprint lang-config"><VirtualHost [2001:db8::a00:20ff:fea7:ccea]:80> ServerAdmin webmaster@host.example.com DocumentRoot /www/docs/host.example.com ServerName host.example.com ErrorLog logs/host.example.com-error_log TransferLog logs/host.example.com-access_log -</VirtualHost> - </pre> +</VirtualHost></pre> <p>Each Virtual Host must correspond to a different IP address, @@ -4534,7 +4466,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/mod/core.html'; } })(window, document); //--><!]]></script></div><div id="footer"> -<p class="apache">Copyright 2013 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> +<p class="apache">Copyright 2014 The Apache Software Foundation.<br />Licensed under the <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache License, Version 2.0</a>.</p> <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/directives.html">Directives</a> | <a href="http://wiki.apache.org/httpd/FAQ">FAQ</a> | <a href="../glossary.html">Glossary</a> | <a href="../sitemap.html">Sitemap</a></p></div><script type="text/javascript"><!--//--><![CDATA[//><!-- if (typeof(prettyPrint) !== 'undefined') { prettyPrint(); |