upload apache
[bottlenecks.git] / rubbos / app / apache2 / manual / sections.html.en
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>Configuration Sections - 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 id="manual-page"><div id="page-header">
14 <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>
15 <p class="apache">Apache HTTP Server Version 2.0</p>
16 <img alt="" src="./images/feather.gif" /></div>
17 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="./images/left.gif" /></a></div>
18 <div id="path">
19 <a href="http://www.apache.org/">Apache</a> &gt; <a href="http://httpd.apache.org/">HTTP Server</a> &gt; <a href="http://httpd.apache.org/docs/">Documentation</a> &gt; <a href="./">Version 2.0</a></div><div id="page-content"><div id="preamble"><h1>Configuration Sections</h1>
20 <div class="toplang">
21 <p><span>Available Languages: </span><a href="./en/sections.html" title="English">&nbsp;en&nbsp;</a> |
22 <a href="./es/sections.html" hreflang="es" rel="alternate" title="Español">&nbsp;es&nbsp;</a> |
23 <a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
24 <a href="./ko/sections.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
25 <a href="./tr/sections.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
26 </div>
27  <p>Directives in the <a href="configuring.html">configuration files</a> may apply to the
28 entire server, or they may be restricted to apply only to particular
29 directories, files, hosts, or URLs.  This document describes how to
30 use configuration section containers or <code>.htaccess</code> files
31 to change the scope of other configuration directives.</p>
32 </div>
33 <div id="quickview"><ul id="toc"><li><img alt="" src="./images/down.gif" /> <a href="#types">Types of Configuration Section Containers</a></li>
34 <li><img alt="" src="./images/down.gif" /> <a href="#file-and-web">Filesystem and Webspace</a></li>
35 <li><img alt="" src="./images/down.gif" /> <a href="#virtualhost">Virtual Hosts</a></li>
36 <li><img alt="" src="./images/down.gif" /> <a href="#proxy">Proxy</a></li>
37 <li><img alt="" src="./images/down.gif" /> <a href="#whatwhere">What Directives are Allowed?</a></li>
38 <li><img alt="" src="./images/down.gif" /> <a href="#mergin">How the sections are merged</a></li>
39 </ul></div>
40 <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
41 <div class="section">
42 <h2><a name="types" id="types">Types of Configuration Section Containers</a></h2>
43
44 <table class="related"><tr><th>Related Modules</th><th>Related Directives</th></tr><tr><td><ul><li><code class="module"><a href="./mod/core.html">core</a></code></li><li><code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code></li></ul></td><td><ul><li><code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#directorymatch">&lt;DirectoryMatch&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#filesmatch">&lt;FilesMatch&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#ifdefine">&lt;IfDefine&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#ifmodule">&lt;IfModule&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#locationmatch">&lt;LocationMatch&gt;</a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxy">&lt;Proxy&gt;</a></code></li><li><code class="directive"><a href="./mod/mod_proxy.html#proxymatch">&lt;ProxyMatch&gt;</a></code></li><li><code class="directive"><a href="./mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code></li></ul></td></tr></table>
45
46 <p>There are two basic types of containers.  Most containers are
47 evaluated for each request.  The enclosed directives are applied only
48 for those requests that match the containers.  The <code class="directive"><a href="./mod/core.html#ifdefine">&lt;IfDefine&gt;</a></code> and <code class="directive"><a href="./mod/core.html#ifmodule">&lt;IfModule&gt;</a></code> containers, on the
49 other hand, are evaluated only at server startup and restart.  If
50 their conditions are true at startup, then the enclosed directives
51 will apply to all requests.  If the conditions are not true, the
52 enclosed directives will be ignored.</p>
53
54 <p>The <code class="directive"><a href="./mod/core.html#ifdefine">&lt;IfDefine&gt;</a></code> directive
55 encloses directives that will only be applied if an appropriate
56 parameter is defined on the <code class="program"><a href="./programs/httpd.html">httpd</a></code> command line.  For example,
57 with the following configuration, all requests will be redirected
58 to another site only if the server is started using
59 <code>httpd -DClosedForNow</code>:</p>
60
61 <div class="example"><p><code>
62 &lt;IfDefine ClosedForNow&gt;<br />
63 Redirect / http://otherserver.example.com/<br />
64 &lt;/IfDefine&gt;
65 </code></p></div>
66
67 <p>The <code class="directive"><a href="./mod/core.html#ifmodule">&lt;IfModule&gt;</a></code>
68 directive is very similar, except it encloses directives that will
69 only be applied if a particular module is available in the server.
70 The module must either be statically compiled in the server, or it
71 must be dynamically compiled and its <code class="directive"><a href="./mod/mod_so.html#loadmodule">LoadModule</a></code> line must be earlier in the
72 configuration file.  This directive should only be used if you need
73 your configuration file to work whether or not certain modules are
74 installed.  It should not be used to enclose directives that you want
75 to work all the time, because it can suppress useful error messages
76 about missing modules.</p>
77
78 <p>In the following example, the <code class="directive"><a href="./mod/mod_mime_magic.html#mimemagicfiles">MimeMagicFiles</a></code> directive will be
79 applied only if <code class="module"><a href="./mod/mod_mime_magic.html">mod_mime_magic</a></code> is available.</p>
80
81 <div class="example"><p><code>
82 &lt;IfModule mod_mime_magic.c&gt;<br />
83 MimeMagicFile conf/magic<br />
84 &lt;/IfModule&gt;
85 </code></p></div>
86
87 <p>Both <code class="directive"><a href="./mod/core.html#ifdefine">&lt;IfDefine&gt;</a></code>
88 and <code class="directive"><a href="./mod/core.html#ifmodule">&lt;IfModule&gt;</a></code>
89 can apply negative conditions by preceding their test with "!".
90 Also, these sections can be nested to achieve more complex
91 restrictions.</p>
92 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
93 <div class="section">
94 <h2><a name="file-and-web" id="file-and-web">Filesystem and Webspace</a></h2>
95
96 <p>The most commonly used configuration section containers are the
97 ones that change the configuration of particular places in the
98 filesystem or webspace.  First, it is important to understand the
99 difference between the two.  The filesystem is the view of your disks
100 as seen by your operating system.  For example, in a default install,
101 Apache resides at <code>/usr/local/apache2</code> in the Unix
102 filesystem or <code>"c:/Program Files/Apache Group/Apache2"</code> in
103 the Windows filesystem.  (Note that forward slashes should always be
104 used as the path separator in Apache, even for Windows.)  In contrast,
105 the webspace is the view of your site as delivered by the web server
106 and seen by the client.  So the path <code>/dir/</code> in the
107 webspace corresponds to the path
108 <code>/usr/local/apache2/htdocs/dir/</code> in the filesystem of a
109 default Apache install on Unix.  The webspace need not map directly to
110 the filesystem, since webpages may be generated dynamically
111 from databases or other locations.</p>
112
113 <h3><a name="filesystem" id="filesystem">Filesystem Containers</a></h3>
114
115 <p>The <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>
116 and <code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code>
117 directives, along with their regex counterparts, apply directives to
118 parts of the filesystem.  Directives enclosed in a <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> section apply to
119 the named filesystem directory and all subdirectories of that
120 directory.  The same effect can be obtained using <a href="howto/htaccess.html">.htaccess files</a>.  For example, in the
121 following configuration, directory indexes will be enabled for the
122 <code>/var/web/dir1</code> directory and all subdirectories.</p>
123
124 <div class="example"><p><code>
125 &lt;Directory /var/web/dir1&gt;<br />
126 Options +Indexes<br />
127 &lt;/Directory&gt;
128 </code></p></div>
129
130 <p>Directives enclosed in a <code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code> section apply to any file with
131 the specified name, regardless of what directory it lies in.
132 So for example, the following configuration directives will,
133 when placed in the main section of the configuration file,
134 deny access to any file named <code>private.html</code> regardless
135 of where it is found.</p>
136
137 <div class="example"><p><code>
138 &lt;Files private.html&gt;<br />
139 Order allow,deny<br />
140 Deny from all<br />
141 &lt;/Files&gt;
142 </code></p></div>
143
144 <p>To address files found in a particular part of the filesystem, the
145 <code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code> and
146 <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> sections
147 can be combined.  For example, the following configuration will deny
148 access to <code>/var/web/dir1/private.html</code>,
149 <code>/var/web/dir1/subdir2/private.html</code>,
150 <code>/var/web/dir1/subdir3/private.html</code>, and any other instance
151 of <code>private.html</code> found under the <code>/var/web/dir1/</code>
152 directory.</p>
153
154 <div class="example"><p><code>
155 &lt;Directory /var/web/dir1&gt;<br />
156 &lt;Files private.html&gt;<br />
157 Order allow,deny<br />
158 Deny from all<br />
159 &lt;/Files&gt;<br />
160 &lt;/Directory&gt;
161 </code></p></div>
162
163
164 <h3><a name="webspace" id="webspace">Webspace Containers</a></h3>
165
166 <p>The <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>
167 directive and its regex counterpart, on the other hand, change the
168 configuration for content in the webspace.  For example, the following
169 configuration prevents access to any URL-path that begins in /private.
170 In particular, it will apply to requests for
171 <code>http://yoursite.example.com/private</code>,
172 <code>http://yoursite.example.com/private123</code>, and
173 <code>http://yoursite.example.com/private/dir/file.html</code> as well
174 as any other requests starting with the <code>/private</code> string.</p>
175
176 <div class="example"><p><code>
177 &lt;Location /private&gt;<br />
178 Order Allow,Deny<br />
179 Deny from all<br />
180 &lt;/Location&gt;
181 </code></p></div>
182
183 <p>The <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>
184 directive need not have anything to do with the filesystem.
185 For example, the following example shows how to map a particular
186 URL to an internal Apache handler provided by <code class="module"><a href="./mod/mod_status.html">mod_status</a></code>.
187 No file called <code>server-status</code> needs to exist in the
188 filesystem.</p>
189
190 <div class="example"><p><code>
191 &lt;Location /server-status&gt;<br />
192 SetHandler server-status<br />
193 &lt;/Location&gt;
194 </code></p></div>
195
196
197 <h3><a name="wildcards" id="wildcards">Wildcards and Regular Expressions</a></h3>
198
199 <p>The <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>,
200 <code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code>, and
201 <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>
202 directives can each use shell-style wildcard characters as in
203 <code>fnmatch</code> from the C standard library.  The character "*"
204 matches any sequence of characters, "?" matches any single character,
205 and "[<em>seq</em>]" matches any character in <em>seq</em>.  The "/"
206 character will not be matched by any wildcard; it must be specified
207 explicitly.</p>
208
209 <p>If even more flexible matching is required, each
210 container has a regular-expression (regex) counterpart <code class="directive"><a href="./mod/core.html#directorymatch">&lt;DirectoryMatch&gt;</a></code>, <code class="directive"><a href="./mod/core.html#filesmatch">&lt;FilesMatch&gt;</a></code>, and <code class="directive"><a href="./mod/core.html#locationmatch">&lt;LocationMatch&gt;</a></code> that allow
211 perl-compatible
212 <a href="glossary.html#regex">regular expressions</a>
213 to be used in choosing the matches.  But see the section below on
214 configuration merging to find out how using regex sections will change
215 how directives are applied.</p>
216
217 <p>A non-regex wildcard section that changes the configuration of
218 all user directories could look as follows:</p>
219
220 <div class="example"><p><code>
221 &lt;Directory /home/*/public_html&gt;<br />
222 Options Indexes<br />
223 &lt;/Directory&gt;
224 </code></p></div>
225
226 <p>Using regex sections, we can deny access to many types of image files
227 at once:</p>
228 <div class="example"><p><code>
229 &lt;FilesMatch \.(?i:gif|jpe?g|png)$&gt;<br />
230 Order allow,deny<br />
231 Deny from all<br />
232 &lt;/FilesMatch&gt;
233 </code></p></div>
234
235
236
237 <h3><a name="whichwhen" id="whichwhen">What to use When</a></h3>
238
239 <p>Choosing between filesystem containers and webspace containers is
240 actually quite easy.  When applying directives to objects that reside
241 in the filesystem always use <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> or <code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code>.  When applying directives to objects
242 that do not reside in the filesystem (such as a webpage generated from
243 a database), use <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>.</p>
244
245 <p>It is important to never use <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code> when trying to restrict
246 access to objects in the filesystem.  This is because many
247 different webspace locations (URLs) could map to the same filesystem
248 location, allowing your restrictions to be circumvented.
249 For example, consider the following configuration:</p>
250
251 <div class="example"><p><code>
252 &lt;Location /dir/&gt;<br />
253 Order allow,deny<br />
254 Deny from all<br />
255 &lt;/Location&gt;
256 </code></p></div>
257
258 <p>This works fine if the request is for
259 <code>http://yoursite.example.com/dir/</code>.  But what if you are on
260 a case-insensitive filesystem?  Then your restriction could be easily
261 circumvented by requesting
262 <code>http://yoursite.example.com/DIR/</code>.  The <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> directive, in
263 contrast, will apply to any content served from that location,
264 regardless of how it is called.  (An exception is filesystem links.
265 The same directory can be placed in more than one part of the
266 filesystem using symbolic links.  The <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> directive will follow the symbolic
267 link without resetting the pathname.  Therefore, for the highest level
268 of security, symbolic links should be disabled with the appropriate
269 <code class="directive"><a href="./mod/core.html#options">Options</a></code> directive.)</p>
270
271 <p>If you are, perhaps, thinking that none of this applies to you
272 because you use a case-sensitive filesystem, remember that there are
273 many other ways to map multiple webspace locations to the same
274 filesystem location.  Therefore you should always use the filesystem
275 containers when you can.  There is, however, one exception to this
276 rule.  Putting configuration restrictions in a <code>&lt;Location
277 /&gt;</code> section is perfectly safe because this section will apply
278 to all requests regardless of the specific URL.</p>
279
280
281 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
282 <div class="section">
283 <h2><a name="virtualhost" id="virtualhost">Virtual Hosts</a></h2>
284
285 <p>The <code class="directive"><a href="./mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code>
286 container encloses directives that apply to specific hosts.
287 This is useful when serving multiple hosts from the same machine
288 with a different configuration for each.  For more information,
289 see the <a href="vhosts/">Virtual Host Documentation</a>.</p>
290 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
291 <div class="section">
292 <h2><a name="proxy" id="proxy">Proxy</a></h2>
293
294 <p>The <code class="directive"><a href="./mod/mod_proxy.html#proxy">&lt;Proxy&gt;</a></code>
295 and <code class="directive"><a href="./mod/mod_proxy.html#proxymatch">&lt;ProxyMatch&gt;</a></code>
296 containers apply enclosed configuration directives only
297 to sites accessed through <code class="module"><a href="./mod/mod_proxy.html">mod_proxy</a></code>'s proxy server
298 that match the specified URL.  For example, the following configuration
299 will prevent the proxy server from being used to access the
300 <code>cnn.com</code> website.</p>
301
302 <div class="example"><p><code>
303 &lt;Proxy http://cnn.com/*&gt;<br />
304 Order allow,deny<br />
305 Deny from all<br />
306 &lt;/Proxy&gt;
307 </code></p></div>
308 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
309 <div class="section">
310 <h2><a name="whatwhere" id="whatwhere">What Directives are Allowed?</a></h2>
311
312 <p>To find out what directives are allowed in what types of
313 configuration sections, check the <a href="mod/directive-dict.html#Context">Context</a> of the directive.
314 Everything that is allowed in 
315 <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>
316 sections is also syntactically allowed in
317 <code class="directive"><a href="./mod/core.html#directorymatch">&lt;DirectoryMatch&gt;</a></code>,
318 <code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code>,
319 <code class="directive"><a href="./mod/core.html#filesmatch">&lt;FilesMatch&gt;</a></code>,
320 <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>,
321 <code class="directive"><a href="./mod/core.html#locationmatch">&lt;LocationMatch&gt;</a></code>,
322 <code class="directive"><a href="./mod/mod_proxy.html#proxy">&lt;Proxy&gt;</a></code>,
323 and <code class="directive"><a href="./mod/mod_proxy.html#proxymatch">&lt;ProxyMatch&gt;</a></code>
324 sections.  There are some exceptions, however:</p>
325
326 <ul>
327 <li>The <code class="directive"><a href="./mod/core.html#allowoverride">AllowOverride</a></code> directive
328 works only in <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>
329 sections.</li>
330
331 <li>The <code>FollowSymLinks</code> and
332 <code>SymLinksIfOwnerMatch</code> <code class="directive"><a href="./mod/core.html#options">Options</a></code> work only in <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> sections or
333 <code>.htaccess</code> files.</li>
334
335 <li>The <code class="directive"><a href="./mod/core.html#options">Options</a></code> directive cannot
336 be used in <code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code>
337 and <code class="directive"><a href="./mod/core.html#filesmatch">&lt;FilesMatch&gt;</a></code>
338 sections.</li>
339 </ul>
340 </div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
341 <div class="section">
342 <h2><a name="mergin" id="mergin">How the sections are merged</a></h2>
343
344 <p>The configuration sections are applied in a very particular order.
345 Since this can have important effects on how configuration directives
346 are interpreted, it is important to understand how this works.</p>
347
348     <p>The order of merging is:</p>
349
350     <ol>
351       <li> <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> (except regular expressions)
352       and <code>.htaccess</code> done simultaneously (with
353       <code>.htaccess</code>, if allowed, overriding
354       <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>)</li>
355
356       <li><code class="directive"><a href="./mod/core.html#directorymatch">&lt;DirectoryMatch&gt;</a></code>
357       (and <code>&lt;Directory ~&gt;</code>)</li>
358
359       <li><code class="directive"><a href="./mod/core.html#files">&lt;Files&gt;</a></code> and <code class="directive"><a href="./mod/core.html#filesmatch">&lt;FilesMatch&gt;</a></code> done
360       simultaneously</li>
361
362       <li><code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code>
363       and <code class="directive"><a href="./mod/core.html#locationmatch">&lt;LocationMatch&gt;</a></code> done simultaneously</li>
364     </ol>
365
366     <p>Apart from <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code>, each group is processed in
367     the order that they appear in the configuration files.  <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> (group 1 above)
368     is processed in the order shortest directory component to longest.
369     So for example, <code>&lt;Directory /var/web/dir&gt;</code> will
370     be processed before <code>&lt;Directory
371     /var/web/dir/subdir&gt;</code>.  If multiple <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> sections apply
372     to the same directory they are processed in the configuration file
373     order. Configurations included via the <code class="directive"><a href="./mod/core.html#include">Include</a></code> directive will be treated as if
374     they were inside the including file at the location of the
375     <code class="directive"><a href="./mod/core.html#include">Include</a></code> directive.</p>
376
377     <p>Sections inside <code class="directive"><a href="./mod/core.html#virtualhost">&lt;VirtualHost&gt;</a></code> sections
378     are applied <em>after</em> the corresponding sections outside
379     the virtual host definition. This allows virtual hosts to
380     override the main server configuration.</p>
381
382     <p>Later sections override earlier ones.</p>
383
384 <div class="note"><h3>Technical Note</h3>
385       There is actually a
386       <code>&lt;Location&gt;</code>/<code>&lt;LocationMatch&gt;</code>
387       sequence performed just before the name translation phase
388       (where <code>Aliases</code> and <code>DocumentRoots</code>
389       are used to map URLs to filenames). The results of this
390       sequence are completely thrown away after the translation has
391       completed.
392 </div>
393
394 <h3><a name="merge-examples" id="merge-examples">Some Examples</a></h3>
395
396 <p>Below is an artificial example to show the order of
397 merging. Assuming they all apply to the request, the directives in
398 this example will be applied in the order A &gt; B &gt; C &gt; D &gt;
399 E.</p>
400
401 <div class="example"><p><code>
402 &lt;Location /&gt;<br />
403 E<br />
404 &lt;/Location&gt;<br />
405 <br />
406 &lt;Files f.html&gt;<br />
407 D<br />
408 &lt;/Files&gt;<br />
409 <br />
410 &lt;VirtualHost *&gt;<br />
411 &lt;Directory /a/b&gt;<br />
412 B<br />
413 &lt;/Directory&gt;<br />
414 &lt;/VirtualHost&gt;<br />
415 <br />
416 &lt;DirectoryMatch "^.*b$"&gt;<br />
417 C<br />
418 &lt;/DirectoryMatch&gt;<br />
419 <br />
420 &lt;Directory /a/b&gt;<br />
421 A<br />
422 &lt;/Directory&gt;<br />
423 <br />
424 </code></p></div>
425
426 <p>For a more concrete example, consider the following.  Regardless of
427 any access restrictions placed in <code class="directive"><a href="./mod/core.html#directory">&lt;Directory&gt;</a></code> sections, the <code class="directive"><a href="./mod/core.html#location">&lt;Location&gt;</a></code> section will be
428 evaluated last and will allow unrestricted access to the server.  In
429 other words, order of merging is important, so be careful!</p>
430
431 <div class="example"><p><code>
432 &lt;Location /&gt;<br />
433 Order deny,allow<br />
434 Allow from all<br />
435 &lt;/Location&gt;<br />
436 <br />
437 # Woops!  This &lt;Directory&gt; section will have no effect<br />
438 &lt;Directory /&gt;<br />
439 Order allow,deny<br />
440 Allow from all<br />
441 Deny from badguy.example.com<br />
442 &lt;/Directory&gt;
443 </code></p></div>
444
445
446
447 </div></div>
448 <div class="bottomlang">
449 <p><span>Available Languages: </span><a href="./en/sections.html" title="English">&nbsp;en&nbsp;</a> |
450 <a href="./es/sections.html" hreflang="es" rel="alternate" title="Español">&nbsp;es&nbsp;</a> |
451 <a href="./ja/sections.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a> |
452 <a href="./ko/sections.html" hreflang="ko" rel="alternate" title="Korean">&nbsp;ko&nbsp;</a> |
453 <a href="./tr/sections.html" hreflang="tr" rel="alternate" title="Türkçe">&nbsp;tr&nbsp;</a></p>
454 </div><div id="footer">
455 <p class="apache">Copyright 2009 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>
456 <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>
457 </body></html>