]> granicus.if.org Git - apache/blob - docs/manual/mod/mod_access_compat.html.en
Documentation rebuild
[apache] / docs / manual / mod / mod_access_compat.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 <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type" />
5 <!--
6         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
7               This file is generated from xml source: DO NOT EDIT
8         XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9       -->
10 <title>mod_access_compat - Apache HTTP Server Version 2.5</title>
11 <link href="../style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
12 <link href="../style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
13 <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" />
14 <script src="../style/scripts/prettify.min.js" type="text/javascript">
15 </script>
16
17 <link href="../images/favicon.ico" rel="shortcut icon" /></head>
18 <body>
19 <div id="page-header">
20 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.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>
21 <p class="apache">Apache HTTP Server Version 2.5</p>
22 <img alt="" src="../images/feather.png" /></div>
23 <div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="../images/left.gif" /></a></div>
24 <div id="path">
25 <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.5</a> &gt; <a href="./">Modules</a></div>
26 <div id="page-content">
27 <div id="preamble"><h1>Apache Module mod_access_compat</h1>
28 <div class="toplang">
29 <p><span>Available Languages: </span><a href="../en/mod/mod_access_compat.html" title="English">&nbsp;en&nbsp;</a> |
30 <a href="../fr/mod/mod_access_compat.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
31 <a href="../ja/mod/mod_access_compat.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
32 </div>
33 <table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Group authorizations based on host (name or IP
34 address)</td></tr>
35 <tr><th><a href="module-dict.html#Status">Status:</a></th><td>Extension</td></tr>
36 <tr><th><a href="module-dict.html#ModuleIdentifier">Module Identifier:</a></th><td>access_compat_module</td></tr>
37 <tr><th><a href="module-dict.html#SourceFile">Source File:</a></th><td>mod_access_compat.c</td></tr>
38 <tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache HTTP Server 2.3 as a compatibility module with
39 previous versions of Apache httpd 2.x.  The directives provided by this module
40 have been deprecated by the new authz refactoring.  Please see
41 <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code></td></tr></table>
42 <h3>Summary</h3>
43
44     <p>The directives provided by <code class="module"><a href="../mod/mod_access_compat.html">mod_access_compat</a></code> are
45     used in <code class="directive"><a href="../mod/core.html#directory">&lt;Directory&gt;</a></code>,
46     <code class="directive"><a href="../mod/core.html#files">&lt;Files&gt;</a></code>, and
47     <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code> sections
48     as well as <code><a href="core.html#accessfilename">.htaccess</a>
49     </code> files to control access to particular parts of the server.
50     Access can be controlled based on the client hostname, IP address, or
51     other characteristics of the client request, as captured in <a href="../env.html">environment variables</a>. The <code class="directive"><a href="#allow">Allow</a></code> and <code class="directive"><a href="#deny">Deny</a></code> directives are used to
52     specify which clients are or are not allowed access to the server,
53     while the <code class="directive"><a href="#order">Order</a></code>
54     directive sets the default access state, and configures how the
55     <code class="directive"><a href="#allow">Allow</a></code> and <code class="directive"><a href="#deny">Deny</a></code> directives interact with each
56     other.</p>
57
58     <p>Both host-based access restrictions and password-based
59     authentication may be implemented simultaneously. In that case,
60     the <code class="directive"><a href="#satisfy">Satisfy</a></code> directive is used
61     to determine how the two sets of restrictions interact.</p>
62
63     <div class="warning"><h3>Note</h3>
64       <p>The directives provided by <code class="module"><a href="../mod/mod_access_compat.html">mod_access_compat</a></code> have
65       been deprecated by <code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code>. 
66       Mixing old directives like <code class="directive"><a href="#order">Order</a></code>, <code class="directive"><a href="#allow">Allow</a></code> or <code class="directive"><a href="#deny">Deny</a></code> with new ones like
67       <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> is technically possible 
68       but discouraged. This module was created to support 
69       configurations containing only old directives to facilitate the 2.4 upgrade. 
70       Please check the <a href="../upgrading.html">upgrading</a> guide for more
71       information.
72       </p>
73       </div>
74
75     <p>In general, access restriction directives apply to all
76     access methods (<code>GET</code>, <code>PUT</code>,
77     <code>POST</code>, etc). This is the desired behavior in most
78     cases. However, it is possible to restrict some methods, while
79     leaving other methods unrestricted, by enclosing the directives
80     in a <code class="directive"><a href="../mod/core.html#limit">&lt;Limit&gt;</a></code> section.</p>
81
82     <div class="note"> <h3>Merging of configuration sections</h3>
83       <p>When any directive provided by this module is used in a new
84       configuration section, no directives provided by this module are
85       inherited from previous configuration sections.</p>
86     </div>
87
88 </div>
89 <div id="quickview"><h3 class="directives">Directives</h3>
90 <ul id="toc">
91 <li><img alt="" src="../images/down.gif" /> <a href="#allow">Allow</a></li>
92 <li><img alt="" src="../images/down.gif" /> <a href="#deny">Deny</a></li>
93 <li><img alt="" src="../images/down.gif" /> <a href="#order">Order</a></li>
94 <li><img alt="" src="../images/down.gif" /> <a href="#satisfy">Satisfy</a></li>
95 </ul>
96 <h3>Bugfix checklist</h3><ul class="seealso"><li><a href="https://www.apache.org/dist/httpd/CHANGES_2.4">httpd changelog</a></li><li><a href="https://bz.apache.org/bugzilla/buglist.cgi?bug_status=__open__&amp;list_id=144532&amp;product=Apache%20httpd-2&amp;query_format=specific&amp;order=changeddate%20DESC%2Cpriority%2Cbug_severity&amp;component=mod_access_compat">Known issues</a></li><li><a href="https://bz.apache.org/bugzilla/enter_bug.cgi?product=Apache%20httpd-2&amp;component=mod_access_compat">Report a bug</a></li></ul><h3>See also</h3>
97 <ul class="seealso">
98 <li><code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code></li>
99 <li><code class="module"><a href="../mod/mod_authz_host.html">mod_authz_host</a></code></li>
100 <li><code class="module"><a href="../mod/mod_authz_core.html">mod_authz_core</a></code></li>
101 </ul><ul class="seealso"><li><a href="#comments_section">Comments</a></li></ul></div>
102
103 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
104 <div class="directive-section"><h2><a name="Allow" id="Allow">Allow</a> <a name="allow" id="allow">Directive</a></h2>
105 <table class="directive">
106 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls which hosts can access an area of the
107 server</td></tr>
108 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code> Allow from all|<var>host</var>|env=[!]<var>env-variable</var>
109 [<var>host</var>|env=[!]<var>env-variable</var>] ...</code></td></tr>
110 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
111 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Limit</td></tr>
112 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
113 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_access_compat</td></tr>
114 </table>
115     <p>The <code class="directive">Allow</code> directive affects which hosts can
116     access an area of the server. Access can be controlled by
117     hostname, IP address, IP address range, or by other
118     characteristics of the client request captured in environment
119     variables.</p>
120
121     <p>The first argument to this directive is always
122     <code>from</code>. The subsequent arguments can take three
123     different forms. If <code>Allow from all</code> is specified, then
124     all hosts are allowed access, subject to the configuration of the
125     <code class="directive"><a href="#deny">Deny</a></code> and <code class="directive"><a href="#order">Order</a></code> directives as discussed
126     below. To allow only particular hosts or groups of hosts to access
127     the server, the <em>host</em> can be specified in any of the
128     following formats:</p>
129
130     <dl>
131       <dt>A (partial) domain-name</dt>
132
133       <dd>
134       <pre class="prettyprint lang-config">Allow from example.org
135 Allow from .net example.edu</pre>
136
137       <p>Hosts whose names match, or end in, this string are allowed
138       access. Only complete components are matched, so the above
139       example will match <code>foo.example.org</code> but it will not
140       match <code>fooexample.org</code>. This configuration will cause
141       Apache httpd to perform a double DNS lookup on the client IP
142       address, regardless of the setting of the <code class="directive"><a href="../mod/core.html#hostnamelookups">HostnameLookups</a></code> directive.  It will do
143       a reverse DNS lookup on the IP address to find the associated
144       hostname, and then do a forward lookup on the hostname to assure
145       that it matches the original IP address.  Only if the forward
146       and reverse DNS are consistent and the hostname matches will
147       access be allowed.</p></dd>
148
149       <dt>A full IP address</dt>
150
151       <dd>
152       <pre class="prettyprint lang-config">Allow from 10.1.2.3
153 Allow from 192.168.1.104 192.168.1.205</pre>
154
155       <p>An IP address of a host allowed access</p></dd>
156
157       <dt>A partial IP address</dt>
158
159       <dd>
160       <pre class="prettyprint lang-config">Allow from 10.1
161 Allow from 10 172.20 192.168.2</pre>
162
163       <p>The first 1 to 3 bytes of an IP address, for subnet
164       restriction.</p></dd>
165
166       <dt>A network/netmask pair</dt>
167
168       <dd>
169       <pre class="prettyprint lang-config">Allow from 10.1.0.0/255.255.0.0</pre>
170
171       <p>A network a.b.c.d, and a netmask w.x.y.z. For more
172       fine-grained subnet restriction.</p></dd>
173
174       <dt>A network/nnn CIDR specification</dt>
175
176       <dd>
177       <pre class="prettyprint lang-config">Allow from 10.1.0.0/16</pre>
178
179       <p>Similar to the previous case, except the netmask consists of
180       nnn high-order 1 bits.</p></dd>
181     </dl>
182
183     <p>Note that the last three examples above match exactly the
184     same set of hosts.</p>
185
186     <p>IPv6 addresses and IPv6 subnets can be specified as shown
187     below:</p>
188
189     <pre class="prettyprint lang-config">Allow from 2001:db8::a00:20ff:fea7:ccea
190 Allow from 2001:db8::a00:20ff:fea7:ccea/10</pre>
191
192
193     <p>The third format of the arguments to the
194     <code class="directive">Allow</code> directive allows access to the server
195     to be controlled based on the existence of an <a href="../env.html">environment variable</a>. When <code>Allow from
196     env=<var>env-variable</var></code> is specified, then the request is
197     allowed access if the environment variable <var>env-variable</var>
198     exists. When <code>Allow from env=!<var>env-variable</var></code> is
199     specified, then the request is allowed access if the environment
200     variable <var>env-variable</var> doesn't exist.
201     The server provides the ability to set environment
202     variables in a flexible way based on characteristics of the client
203     request using the directives provided by
204     <code class="module"><a href="../mod/mod_setenvif.html">mod_setenvif</a></code>. Therefore, this directive can be
205     used to allow access based on such factors as the clients
206     <code>User-Agent</code> (browser type), <code>Referer</code>, or
207     other HTTP request header fields.</p>
208
209     <pre class="prettyprint lang-config">SetEnvIf User-Agent ^KnockKnock/2\.0 let_me_in
210 &lt;Directory "/docroot"&gt;
211     Order Deny,Allow
212     Deny from all
213     Allow from env=let_me_in
214 &lt;/Directory&gt;</pre>
215
216
217     <p>In this case, browsers with a user-agent string beginning
218     with <code>KnockKnock/2.0</code> will be allowed access, and all
219     others will be denied.</p>
220
221     <div class="note"> <h3>Merging of configuration sections</h3>
222       <p>When any directive provided by this module is used in a new
223       configuration section, no directives provided by this module are
224       inherited from previous configuration sections.</p>
225     </div>
226
227
228 </div>
229 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
230 <div class="directive-section"><h2><a name="Deny" id="Deny">Deny</a> <a name="deny" id="deny">Directive</a></h2>
231 <table class="directive">
232 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls which hosts are denied access to the
233 server</td></tr>
234 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code> Deny from all|<var>host</var>|env=[!]<var>env-variable</var>
235 [<var>host</var>|env=[!]<var>env-variable</var>] ...</code></td></tr>
236 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
237 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Limit</td></tr>
238 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
239 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_access_compat</td></tr>
240 </table>
241     <p>This directive allows access to the server to be restricted
242     based on hostname, IP address, or environment variables. The
243     arguments for the <code class="directive">Deny</code> directive are
244     identical to the arguments for the <code class="directive"><a href="#allow">Allow</a></code> directive.</p>
245
246 </div>
247 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
248 <div class="directive-section"><h2><a name="Order" id="Order">Order</a> <a name="order" id="order">Directive</a></h2>
249 <table class="directive">
250 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Controls the default access state and the order in which
251 <code class="directive">Allow</code> and <code class="directive">Deny</code> are
252 evaluated.</td></tr>
253 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code> Order <var>ordering</var></code></td></tr>
254 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Order Deny,Allow</code></td></tr>
255 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
256 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>Limit</td></tr>
257 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
258 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_access_compat</td></tr>
259 </table>
260
261     <p>The <code class="directive">Order</code> directive, along with the
262     <code class="directive"><a href="#allow">Allow</a></code> and
263     <code class="directive"><a href="#deny">Deny</a></code> directives,
264     controls a three-pass access control system. The first pass
265     processes either all <code class="directive"><a href="#allow">Allow</a></code> or all <code class="directive"><a href="#deny">Deny</a></code> directives, as specified
266     by the <code class="directive"><a href="#order">Order</a></code>
267     directive. The second pass parses the rest of the directives
268     (<code class="directive"><a href="#deny">Deny</a></code> or
269     <code class="directive"><a href="#allow">Allow</a></code>). The third
270     pass applies to all requests which do not match either of the first
271     two.</p>
272
273     <p>Note that all <code class="directive"><a href="#allow">Allow</a></code> and <code class="directive"><a href="#deny">Deny</a></code> directives are
274     processed, unlike a typical firewall, where only the first match is
275     used. The last match is effective (also unlike a typical firewall).
276     Additionally, the order in which lines appear in the configuration
277     files is not significant -- all <code class="directive"><a href="#allow">Allow</a></code> lines are processed as
278     one group, all <code class="directive"><a href="#deny">Deny</a></code> lines are considered as
279     another, and the default state is considered by itself.</p>
280
281     <p><em>Ordering</em> is one of:</p>
282
283     <dl>
284       <dt><code>Allow,Deny</code></dt>
285
286       <dd>First, all <code class="directive"><a href="#allow">Allow</a></code> directives are
287       evaluated; at least one must match, or the request is rejected.
288       Next, all <code class="directive"><a href="#deny">Deny</a></code>
289       directives are evaluated. If any matches, the request is rejected.
290       Last, any requests which do not match an <code class="directive"><a href="#allow">Allow</a></code> or a <code class="directive"><a href="#deny">Deny</a></code> directive are denied
291       by default.</dd>
292
293       <dt><code>Deny,Allow</code></dt>
294
295       <dd>First, all <code class="directive"><a href="#deny">Deny</a></code> directives are
296       evaluated; if any match, the request is denied
297       <strong>unless</strong> it also matches an <code class="directive"><a href="#allow">Allow</a></code> directive. Any
298       requests which do not match any <code class="directive"><a href="#allow">Allow</a></code> or <code class="directive"><a href="#deny">Deny</a></code> directives are
299       permitted.</dd>
300
301       <dt><code>Mutual-failure</code></dt>
302
303       <dd>This order has the same effect as <code>Order
304       Allow,Deny</code> and is deprecated in its favor.</dd>
305     </dl>
306
307     <p>Keywords may only be separated by a comma; <em>no whitespace</em>
308     is allowed between them.</p>
309
310     <table class="bordered">
311       <tr>
312         <th>Match</th>
313         <th>Allow,Deny result</th>
314         <th>Deny,Allow result</th>
315       </tr><tr>
316         <th>Match Allow only</th>
317         <td>Request allowed</td>
318         <td>Request allowed</td>
319       </tr><tr>
320         <th>Match Deny only</th>
321         <td>Request denied</td>
322         <td>Request denied</td>
323       </tr><tr>
324         <th>No match</th>
325         <td>Default to second directive: Denied</td>
326         <td>Default to second directive: Allowed</td>
327       </tr><tr>
328         <th>Match both Allow &amp; Deny</th>
329         <td>Final match controls: Denied</td>
330         <td>Final match controls: Allowed</td>
331       </tr>
332     </table>
333
334     <p>In the following example, all hosts in the example.org domain
335     are allowed access; all other hosts are denied access.</p>
336
337     <pre class="prettyprint lang-config">Order Deny,Allow
338 Deny from all
339 Allow from example.org</pre>
340
341
342     <p>In the next example, all hosts in the example.org domain are
343     allowed access, except for the hosts which are in the
344     foo.example.org subdomain, who are denied access. All hosts not
345     in the example.org domain are denied access because the default
346     state is to <code class="directive"><a href="#deny">Deny</a></code>
347     access to the server.</p>
348
349     <pre class="prettyprint lang-config">Order Allow,Deny
350 Allow from example.org
351 Deny from foo.example.org</pre>
352
353
354     <p>On the other hand, if the <code class="directive">Order</code> in the
355     last example is changed to <code>Deny,Allow</code>, all hosts will
356     be allowed access. This happens because, regardless of the actual
357     ordering of the directives in the configuration file, the
358     <code>Allow from example.org</code> will be evaluated last and will
359     override the <code>Deny from foo.example.org</code>. All hosts not in
360     the <code>example.org</code> domain will also be allowed access
361     because the default state is <code class="directive"><a href="#allow">Allow</a></code>.</p>
362
363     <p>The presence of an <code class="directive">Order</code> directive can
364     affect access to a part of the server even in the absence of
365     accompanying <code class="directive"><a href="#allow">Allow</a></code>
366     and <code class="directive"><a href="#deny">Deny</a></code>
367     directives because of its effect on the default access state. For
368     example,</p>
369
370     <pre class="prettyprint lang-config">&lt;Directory "/www"&gt;
371     Order Allow,Deny
372 &lt;/Directory&gt;</pre>
373
374
375     <p>will Deny all access to the <code>/www</code> directory
376     because the default access state is set to
377     <code class="directive"><a href="#deny">Deny</a></code>.</p>
378
379     <p>The <code class="directive">Order</code> directive controls the order of access
380     directive processing only within each phase of the server's
381     configuration processing. This implies, for example, that an
382     <code class="directive"><a href="#allow">Allow</a></code> or <code class="directive"><a href="#deny">Deny</a></code> directive occurring in a
383     <code class="directive"><a href="../mod/core.html#location">&lt;Location&gt;</a></code> section will
384     always be evaluated after an <code class="directive"><a href="#allow">Allow</a></code> or <code class="directive"><a href="#deny">Deny</a></code> directive occurring in a
385     <code class="directive"><a href="../mod/core.html#directory">&lt;Directory&gt;</a></code> section or
386     <code>.htaccess</code> file, regardless of the setting of the
387     <code class="directive">Order</code> directive. For details on the merging
388     of configuration sections, see the documentation on <a href="../sections.html">How Directory, Location and Files sections
389     work</a>.</p>
390
391     <div class="note"> <h3>Merging of configuration sections</h3>
392       <p>When any directive provided by this module is used in a new
393       configuration section, no directives provided by this module are
394       inherited from previous configuration sections.</p>
395     </div>
396
397
398 </div>
399 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
400 <div class="directive-section"><h2><a name="Satisfy" id="Satisfy">Satisfy</a> <a name="satisfy" id="satisfy">Directive</a></h2>
401 <table class="directive">
402 <tr><th><a href="directive-dict.html#Description">Description:</a></th><td>Interaction between host-level access control and
403 user authentication</td></tr>
404 <tr><th><a href="directive-dict.html#Syntax">Syntax:</a></th><td><code>Satisfy Any|All</code></td></tr>
405 <tr><th><a href="directive-dict.html#Default">Default:</a></th><td><code>Satisfy All</code></td></tr>
406 <tr><th><a href="directive-dict.html#Context">Context:</a></th><td>directory, .htaccess</td></tr>
407 <tr><th><a href="directive-dict.html#Override">Override:</a></th><td>AuthConfig</td></tr>
408 <tr><th><a href="directive-dict.html#Status">Status:</a></th><td>Extension</td></tr>
409 <tr><th><a href="directive-dict.html#Module">Module:</a></th><td>mod_access_compat</td></tr>
410 </table>
411     <p>Access policy if both <code class="directive"><a href="#allow">Allow</a></code> and <code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code> used. The parameter can be
412     either <code>All</code> or <code>Any</code>. This directive is only
413     useful if access to a particular area is being restricted by both
414     username/password <em>and</em> client host address. In this case
415     the default behavior (<code>All</code>) is to require that the client
416     passes the address access restriction <em>and</em> enters a valid
417     username and password. With the <code>Any</code> option the client will be
418     granted access if they either pass the host restriction or enter a
419     valid username and password. This can be used to password restrict
420     an area, but to let clients from particular addresses in without
421     prompting for a password.</p>
422
423     <p>For example, if you wanted to let people on your network have
424     unrestricted access to a portion of your website, but require that
425     people outside of your network provide a password, you could use a
426     configuration similar to the following:</p>
427
428     <pre class="prettyprint lang-config">Require valid-user
429 Allow from 192.168.1
430 Satisfy Any</pre>
431
432
433     <p>
434     Another frequent use of the <code class="directive">Satisfy</code> directive
435     is to relax access restrictions for a subdirectory:
436     </p>
437
438     <pre class="prettyprint lang-config">&lt;Directory "/var/www/private"&gt;
439     Require valid-user
440 &lt;/Directory&gt;
441
442 &lt;Directory "/var/www/private/public"&gt;
443     Allow from all
444     Satisfy Any
445 &lt;/Directory&gt;</pre>
446
447
448     <p>In the above example, authentication will be required for the
449     <code>/var/www/private</code> directory, but will not be required
450     for the <code>/var/www/private/public</code> directory.</p>
451
452     <p>Since version 2.0.51 <code class="directive">Satisfy</code> directives can
453     be restricted to particular methods by <code class="directive"><a href="../mod/core.html#limit">&lt;Limit&gt;</a></code> and <code class="directive"><a href="../mod/core.html#limitexcept">&lt;LimitExcept&gt;</a></code> sections.</p>
454
455     <div class="note"> <h3>Merging of configuration sections</h3>
456       <p>When any directive provided by this module is used in a new
457       configuration section, no directives provided by this module are
458       inherited from previous configuration sections.</p>
459     </div>
460
461
462 <h3>See also</h3>
463 <ul>
464 <li><code class="directive"><a href="#allow">Allow</a></code></li>
465 <li><code class="directive"><a href="../mod/mod_authz_core.html#require">Require</a></code></li>
466 </ul>
467 </div>
468 </div>
469 <div class="bottomlang">
470 <p><span>Available Languages: </span><a href="../en/mod/mod_access_compat.html" title="English">&nbsp;en&nbsp;</a> |
471 <a href="../fr/mod/mod_access_compat.html" hreflang="fr" rel="alternate" title="Français">&nbsp;fr&nbsp;</a> |
472 <a href="../ja/mod/mod_access_compat.html" hreflang="ja" rel="alternate" title="Japanese">&nbsp;ja&nbsp;</a></p>
473 </div><div class="top"><a href="#page-header"><img src="../images/up.gif" alt="top" /></a></div><div class="section"><h2><a id="comments_section" name="comments_section">Comments</a></h2><div class="warning"><strong>Notice:</strong><br />This is not a Q&amp;A section. Comments placed here should be pointed towards suggestions on improving the documentation or server, and may be removed again by our moderators if they are either implemented or considered invalid/off-topic. Questions on how to manage the Apache HTTP Server should be directed at either our IRC channel, #httpd, on Freenode, or sent to our <a href="http://httpd.apache.org/lists.html">mailing lists</a>.</div>
474 <script type="text/javascript"><!--//--><![CDATA[//><!--
475 var comments_shortname = 'httpd';
476 var comments_identifier = 'http://httpd.apache.org/docs/trunk/mod/mod_access_compat.html';
477 (function(w, d) {
478     if (w.location.hostname.toLowerCase() == "httpd.apache.org") {
479         d.write('<div id="comments_thread"><\/div>');
480         var s = d.createElement('script');
481         s.type = 'text/javascript';
482         s.async = true;
483         s.src = 'https://comments.apache.org/show_comments.lua?site=' + comments_shortname + '&page=' + comments_identifier;
484         (d.getElementsByTagName('head')[0] || d.getElementsByTagName('body')[0]).appendChild(s);
485     }
486     else {
487         d.write('<div id="comments_thread">Comments are disabled for this page at the moment.<\/div>');
488     }
489 })(window, document);
490 //--><!]]></script></div><div id="footer">
491 <p class="apache">Copyright 2016 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>
492 <p class="menu"><a href="../mod/">Modules</a> | <a href="../mod/quickreference.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[//><!--
493 if (typeof(prettyPrint) !== 'undefined') {
494     prettyPrint();
495 }
496 //--><!]]></script>
497 </body></html>