mod_access_compat.xml revision ecdc51f25765b81b6d07389c6fa02a9529411f5d
22d5d84393d960a2027f472036f3fee15d7dbce9nd<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
22d5d84393d960a2027f472036f3fee15d7dbce9nd<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<!-- $LastChangedRevision$ -->
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding Licensed to the Apache Software Foundation (ASF) under one or more
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding contributor license agreements. See the NOTICE file distributed with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding this work for additional information regarding copyright ownership.
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding The ASF licenses this file to You under the Apache License, Version 2.0
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding (the "License"); you may not use this file except in compliance with
db479b48bd4d75423ed4a45e15b75089d1a8ad72fielding the License. You may obtain a copy of the License at
22d5d84393d960a2027f472036f3fee15d7dbce9nd Unless required by applicable law or agreed to in writing, software
22d5d84393d960a2027f472036f3fee15d7dbce9nd distributed under the License is distributed on an "AS IS" BASIS,
22d5d84393d960a2027f472036f3fee15d7dbce9nd WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22d5d84393d960a2027f472036f3fee15d7dbce9nd See the License for the specific language governing permissions and
22d5d84393d960a2027f472036f3fee15d7dbce9nd limitations under the License.
22d5d84393d960a2027f472036f3fee15d7dbce9nd<description>Group authorizations based on host (name or IP
22d5d84393d960a2027f472036f3fee15d7dbce9ndaddress)</description>
ecdc51f25765b81b6d07389c6fa02a9529411f5drbowen<compatibility>Available in Apache HTTP Server 2.3 as a compatibility module with
ecdc51f25765b81b6d07389c6fa02a9529411f5drbowenprevious versions of Apache httpd 2.x. The directives provided by this module
22d5d84393d960a2027f472036f3fee15d7dbce9ndhave been deprecated by the new authz refactoring. Please see
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>The directives provided by <module>mod_access_compat</module> are
22d5d84393d960a2027f472036f3fee15d7dbce9nd used in <directive module="core" type="section">Directory</directive>,
22d5d84393d960a2027f472036f3fee15d7dbce9nd <directive module="core" type="section">Files</directive>, and
22d5d84393d960a2027f472036f3fee15d7dbce9nd <directive module="core" type="section">Location</directive> sections
22d5d84393d960a2027f472036f3fee15d7dbce9nd as well as <code><a href="core.html#accessfilename">.htaccess</a>
22d5d84393d960a2027f472036f3fee15d7dbce9nd </code> files to control access to particular parts of the server.
22d5d84393d960a2027f472036f3fee15d7dbce9nd Access can be controlled based on the client hostname, IP address, or
22d5d84393d960a2027f472036f3fee15d7dbce9nd other characteristics of the client request, as captured in <a
22d5d84393d960a2027f472036f3fee15d7dbce9nd href="/env.html">environment variables</a>. The <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_access_compat">Allow</directive> and <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_access_compat">Deny</directive> directives are used to
22d5d84393d960a2027f472036f3fee15d7dbce9nd specify which clients are or are not allowed access to the server,
22d5d84393d960a2027f472036f3fee15d7dbce9nd while the <directive module="mod_access_compat">Order</directive>
22d5d84393d960a2027f472036f3fee15d7dbce9nd directive sets the default access state, and configures how the
22d5d84393d960a2027f472036f3fee15d7dbce9nd <directive module="mod_access_compat">Allow</directive> and <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_access_compat">Deny</directive> directives interact with each
22d5d84393d960a2027f472036f3fee15d7dbce9nd other.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>Both host-based access restrictions and password-based
22d5d84393d960a2027f472036f3fee15d7dbce9nd authentication may be implemented simultaneously. In that case,
6a40b378ef57ef1dbc193c1afd600fa591d65ac9pctony the <directive module="mod_access_compat">Satisfy</directive> directive is used
22d5d84393d960a2027f472036f3fee15d7dbce9nd to determine how the two sets of restrictions interact.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>The directives provided by <module>mod_access_compat</module> have
22d5d84393d960a2027f472036f3fee15d7dbce9nd been deprecated by the new authz refactoring. Please see
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>In general, access restriction directives apply to all
22d5d84393d960a2027f472036f3fee15d7dbce9nd <code>POST</code>, etc). This is the desired behavior in most
22d5d84393d960a2027f472036f3fee15d7dbce9nd cases. However, it is possible to restrict some methods, while
22d5d84393d960a2027f472036f3fee15d7dbce9nd leaving other methods unrestricted, by enclosing the directives
22d5d84393d960a2027f472036f3fee15d7dbce9nd in a <directive module="core" type="section">Limit</directive> section.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<seealso><directive module="mod_authz_core">Require</directive></seealso>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<description>Controls which hosts can access an area of the
22d5d84393d960a2027f472036f3fee15d7dbce9ndserver</description>
81c816b41dff7591b248d78309189055e0c9ebectakashi<syntax> Allow from all|<var>host</var>|env=[!]<var>env-variable</var>
81c816b41dff7591b248d78309189055e0c9ebectakashi[<var>host</var>|env=[!]<var>env-variable</var>] ...</syntax>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<contextlist><context>directory</context><context>.htaccess</context>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</contextlist>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>The <directive>Allow</directive> directive affects which hosts can
22d5d84393d960a2027f472036f3fee15d7dbce9nd access an area of the server. Access can be controlled by
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper hostname, IP address, IP address range, or by other
22d5d84393d960a2027f472036f3fee15d7dbce9nd characteristics of the client request captured in environment
22d5d84393d960a2027f472036f3fee15d7dbce9nd variables.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>The first argument to this directive is always
22d5d84393d960a2027f472036f3fee15d7dbce9nd <code>from</code>. The subsequent arguments can take three
22d5d84393d960a2027f472036f3fee15d7dbce9nd different forms. If <code>Allow from all</code> is specified, then
22d5d84393d960a2027f472036f3fee15d7dbce9nd all hosts are allowed access, subject to the configuration of the
22d5d84393d960a2027f472036f3fee15d7dbce9nd <directive module="mod_access_compat">Deny</directive> and <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_access_compat">Order</directive> directives as discussed
22d5d84393d960a2027f472036f3fee15d7dbce9nd below. To allow only particular hosts or groups of hosts to access
22d5d84393d960a2027f472036f3fee15d7dbce9nd the server, the <em>host</em> can be specified in any of the
22d5d84393d960a2027f472036f3fee15d7dbce9nd following formats:</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd Allow from .net example.edu
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>Hosts whose names match, or end in, this string are allowed
22d5d84393d960a2027f472036f3fee15d7dbce9nd access. Only complete components are matched, so the above
22d5d84393d960a2027f472036f3fee15d7dbce9nd example will match <code>foo.apache.org</code> but it will not
22d5d84393d960a2027f472036f3fee15d7dbce9nd match <code>fooapache.org</code>. This configuration will cause
ecdc51f25765b81b6d07389c6fa02a9529411f5drbowen Apache httpd to perform a double DNS lookup on the client IP
22d5d84393d960a2027f472036f3fee15d7dbce9nd address, regardless of the setting of the <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="core">HostnameLookups</directive> directive. It will do
22d5d84393d960a2027f472036f3fee15d7dbce9nd a reverse DNS lookup on the IP address to find the associated
22d5d84393d960a2027f472036f3fee15d7dbce9nd hostname, and then do a forward lookup on the hostname to assure
22d5d84393d960a2027f472036f3fee15d7dbce9nd that it matches the original IP address. Only if the forward
22d5d84393d960a2027f472036f3fee15d7dbce9nd and reverse DNS are consistent and the hostname matches will
22d5d84393d960a2027f472036f3fee15d7dbce9nd Allow from 10.1.2.3<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Allow from 192.168.1.104 192.168.1.205
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd Allow from 10.1<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Allow from 10 172.20 192.168.2
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>The first 1 to 3 bytes of an IP address, for subnet
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>Similar to the previous case, except the netmask consists of
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>Note that the last three examples above match exactly the
22d5d84393d960a2027f472036f3fee15d7dbce9nd same set of hosts.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>IPv6 addresses and IPv6 subnets can be specified as shown
22d5d84393d960a2027f472036f3fee15d7dbce9nd below:</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd Allow from 2001:db8::a00:20ff:fea7:ccea<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>The third format of the arguments to the
22d5d84393d960a2027f472036f3fee15d7dbce9nd <directive>Allow</directive> directive allows access to the server
22d5d84393d960a2027f472036f3fee15d7dbce9nd to be controlled based on the existence of an <a
22d5d84393d960a2027f472036f3fee15d7dbce9nd href="/env.html">environment variable</a>. When <code>Allow from
22d5d84393d960a2027f472036f3fee15d7dbce9nd env=<var>env-variable</var></code> is specified, then the request is
22d5d84393d960a2027f472036f3fee15d7dbce9nd allowed access if the environment variable <var>env-variable</var>
81c816b41dff7591b248d78309189055e0c9ebectakashi exists. When <code>Allow from env=!<var>env-variable</var></code> is
81c816b41dff7591b248d78309189055e0c9ebectakashi specified, then the request is allowed access if the environment
81c816b41dff7591b248d78309189055e0c9ebectakashi The server provides the ability to set environment
22d5d84393d960a2027f472036f3fee15d7dbce9nd variables in a flexible way based on characteristics of the client
22d5d84393d960a2027f472036f3fee15d7dbce9nd request using the directives provided by
22d5d84393d960a2027f472036f3fee15d7dbce9nd <module>mod_setenvif</module>. Therefore, this directive can be
22d5d84393d960a2027f472036f3fee15d7dbce9nd used to allow access based on such factors as the clients
22d5d84393d960a2027f472036f3fee15d7dbce9nd <code>User-Agent</code> (browser type), <code>Referer</code>, or
22d5d84393d960a2027f472036f3fee15d7dbce9nd other HTTP request header fields.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd SetEnvIf User-Agent ^KnockKnock/2\.0 let_me_in<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd <Directory /docroot><br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Order Deny,Allow<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Deny from all<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Allow from env=let_me_in<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd </Directory>
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>In this case, browsers with a user-agent string beginning
22d5d84393d960a2027f472036f3fee15d7dbce9nd with <code>KnockKnock/2.0</code> will be allowed access, and all
22d5d84393d960a2027f472036f3fee15d7dbce9nd others will be denied.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<description>Controls which hosts are denied access to the
22d5d84393d960a2027f472036f3fee15d7dbce9ndserver</description>
81c816b41dff7591b248d78309189055e0c9ebectakashi<syntax> Deny from all|<var>host</var>|env=[!]<var>env-variable</var>
81c816b41dff7591b248d78309189055e0c9ebectakashi[<var>host</var>|env=[!]<var>env-variable</var>] ...</syntax>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<contextlist><context>directory</context><context>.htaccess</context>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</contextlist>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>This directive allows access to the server to be restricted
22d5d84393d960a2027f472036f3fee15d7dbce9nd based on hostname, IP address, or environment variables. The
22d5d84393d960a2027f472036f3fee15d7dbce9nd arguments for the <directive>Deny</directive> directive are
22d5d84393d960a2027f472036f3fee15d7dbce9nd identical to the arguments for the <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_access_compat">Allow</directive> directive.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<description>Controls the default access state and the order in which
22d5d84393d960a2027f472036f3fee15d7dbce9nd<directive>Allow</directive> and <directive>Deny</directive> are
22d5d84393d960a2027f472036f3fee15d7dbce9ndevaluated.</description>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<contextlist><context>directory</context><context>.htaccess</context>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</contextlist>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <p>The <directive>Order</directive> directive, along with the
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <directive module="mod_access_compat">Allow</directive> and
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <directive module="mod_access_compat">Deny</directive> directives,
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper controls a three-pass access control system. The first pass
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper processes either all <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Allow</directive> or all <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Deny</directive> directives, as specified
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper by the <directive module="mod_access_compat">Order</directive>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper directive. The second pass parses the rest of the directives
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper (<directive module="mod_access_compat">Deny</directive> or
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <directive module="mod_access_compat">Allow</directive>). The third
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper pass applies to all requests which do not match either of the first
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_access_compat">Allow</directive> and <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Deny</directive> directives are
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper processed, unlike a typical firewall, where only the first match is
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper used. The last match is effective (also unlike a typical firewall).
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper Additionally, the order in which lines appear in the configuration
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper files is not significant -- all <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Allow</directive> lines are processed as
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper one group, all <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Deny</directive> lines are considered as
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper another, and the default state is considered by itself.</p>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Allow</directive> directives are
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper evaluated; at least one must match, or the request is rejected.
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper Next, all <directive module="mod_access_compat">Deny</directive>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper directives are evaluated. If any matches, the request is rejected.
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper Last, any requests which do not match an <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Allow</directive> or a <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Deny</directive> directive are denied
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper by default.</dd>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Deny</directive> directives are
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper evaluated; if any match, the request is denied
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <strong>unless</strong> it also matches an <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Allow</directive> directive. Any
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper requests which do not match any <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Allow</directive> or <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper module="mod_access_compat">Deny</directive> directives are
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper permitted.</dd>
bc7dfcaa97d11b84ed1b259bf988921715f485e7pctony Allow,Deny</code> and is deprecated in its favor.</dd>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <p>Keywords may only be separated by a comma; <em>no whitespace</em>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper is allowed between them.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>In the following example, all hosts in the apache.org domain
22d5d84393d960a2027f472036f3fee15d7dbce9nd are allowed access; all other hosts are denied access.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd Order Deny,Allow<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Deny from all<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>In the next example, all hosts in the apache.org domain are
22d5d84393d960a2027f472036f3fee15d7dbce9nd allowed access, except for the hosts which are in the
22d5d84393d960a2027f472036f3fee15d7dbce9nd foo.apache.org subdomain, who are denied access. All hosts not
22d5d84393d960a2027f472036f3fee15d7dbce9nd in the apache.org domain are denied access because the default
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper state is to <directive module="mod_access_compat">Deny</directive>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper access to the server.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd Order Allow,Deny<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <p>On the other hand, if the <directive>Order</directive> in the
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper last example is changed to <code>Deny,Allow</code>, all hosts will
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper be allowed access. This happens because, regardless of the actual
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper ordering of the directives in the configuration file, the
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <code>Allow from apache.org</code> will be evaluated last and will
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper override the <code>Deny from foo.apache.org</code>. All hosts not in
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper the <code>apache.org</code> domain will also be allowed access
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper because the default state is <directive
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <p>The presence of an <directive>Order</directive> directive can
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper affect access to a part of the server even in the absence of
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper accompanying <directive module="mod_access_compat">Allow</directive>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper and <directive module="mod_access_compat">Deny</directive>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper directives because of its effect on the default access state. For
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper example,</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <Directory /www><br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Order Allow,Deny<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd </Directory>
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <p>will Deny all access to the <code>/www</code> directory
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper because the default access state is set to
b57e88079429c92f4de900e6ac0b27fc3d234b97pepper <directive module="mod_access_compat">Deny</directive>.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>The <directive>Order</directive> directive controls the order of access
22d5d84393d960a2027f472036f3fee15d7dbce9nd directive processing only within each phase of the server's
22d5d84393d960a2027f472036f3fee15d7dbce9nd configuration processing. This implies, for example, that an
22d5d84393d960a2027f472036f3fee15d7dbce9nd <directive module="mod_access_compat">Allow</directive> or <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_access_compat">Deny</directive> directive occurring in a
22d5d84393d960a2027f472036f3fee15d7dbce9nd <directive module="core" type="section">Location</directive> section will
22d5d84393d960a2027f472036f3fee15d7dbce9nd always be evaluated after an <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_access_compat">Allow</directive> or <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_access_compat">Deny</directive> directive occurring in a
22d5d84393d960a2027f472036f3fee15d7dbce9nd <directive module="core" type="section">Directory</directive> section or
22d5d84393d960a2027f472036f3fee15d7dbce9nd <code>.htaccess</code> file, regardless of the setting of the
22d5d84393d960a2027f472036f3fee15d7dbce9nd <directive>Order</directive> directive. For details on the merging
22d5d84393d960a2027f472036f3fee15d7dbce9nd of configuration sections, see the documentation on <a
22d5d84393d960a2027f472036f3fee15d7dbce9nd href="/sections.html">How Directory, Location and Files sections
22d5d84393d960a2027f472036f3fee15d7dbce9nd</directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<description>Interaction between host-level access control and
22d5d84393d960a2027f472036f3fee15d7dbce9nduser authentication</description>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<contextlist><context>directory</context><context>.htaccess</context>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</contextlist>
22d5d84393d960a2027f472036f3fee15d7dbce9nd<compatibility>Influenced by <directive module="core" type="section"
22d5d84393d960a2027f472036f3fee15d7dbce9ndtype="section">LimitExcept</directive> in version 2.0.51 and
22d5d84393d960a2027f472036f3fee15d7dbce9ndlater</compatibility>
bc7dfcaa97d11b84ed1b259bf988921715f485e7pctony module="mod_access_compat">Allow</directive> and <directive
22d5d84393d960a2027f472036f3fee15d7dbce9nd module="mod_authz_core">Require</directive> used. The parameter can be
22d5d84393d960a2027f472036f3fee15d7dbce9nd either <code>All</code> or <code>Any</code>. This directive is only
22d5d84393d960a2027f472036f3fee15d7dbce9nd useful if access to a particular area is being restricted by both
22d5d84393d960a2027f472036f3fee15d7dbce9nd username/password <em>and</em> client host address. In this case
22d5d84393d960a2027f472036f3fee15d7dbce9nd the default behavior (<code>All</code>) is to require that the client
22d5d84393d960a2027f472036f3fee15d7dbce9nd passes the address access restriction <em>and</em> enters a valid
22d5d84393d960a2027f472036f3fee15d7dbce9nd username and password. With the <code>Any</code> option the client will be
22d5d84393d960a2027f472036f3fee15d7dbce9nd granted access if they either pass the host restriction or enter a
22d5d84393d960a2027f472036f3fee15d7dbce9nd valid username and password. This can be used to password restrict
22d5d84393d960a2027f472036f3fee15d7dbce9nd an area, but to let clients from particular addresses in without
22d5d84393d960a2027f472036f3fee15d7dbce9nd prompting for a password.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>For example, if you wanted to let people on your network have
22d5d84393d960a2027f472036f3fee15d7dbce9nd unrestricted access to a portion of your website, but require that
22d5d84393d960a2027f472036f3fee15d7dbce9nd people outside of your network provide a password, you could use a
22d5d84393d960a2027f472036f3fee15d7dbce9nd configuration similar to the following:</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd Require valid-user<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Allow from 192.168.1<br />
22d5d84393d960a2027f472036f3fee15d7dbce9nd Satisfy Any
22d5d84393d960a2027f472036f3fee15d7dbce9nd </example>
8841be3bfba2e0814bee6c11ddae4207d97b843brbowen Another frequent use of the <directive>Satisfy</directive> directive
8841be3bfba2e0814bee6c11ddae4207d97b843brbowen is to relax access restrictions for a subdirectory:
8841be3bfba2e0814bee6c11ddae4207d97b843brbowen Require valid-user<br />
8841be3bfba2e0814bee6c11ddae4207d97b843brbowen </Directory><br />
8841be3bfba2e0814bee6c11ddae4207d97b843brbowen Allow from all<br />
8841be3bfba2e0814bee6c11ddae4207d97b843brbowen Satisfy Any<br />
8841be3bfba2e0814bee6c11ddae4207d97b843brbowen </Directory>
8841be3bfba2e0814bee6c11ddae4207d97b843brbowen <p>In the above example, authentication will be required for the
8841be3bfba2e0814bee6c11ddae4207d97b843brbowen <code>/var/www/private</code> directory, but will not be required
8841be3bfba2e0814bee6c11ddae4207d97b843brbowen for the <code>/var/www/private/public</code> directory.</p>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <p>Since version 2.0.51 <directive>Satisfy</directive> directives can
22d5d84393d960a2027f472036f3fee15d7dbce9nd be restricted to particular methods by <directive module="core"
22d5d84393d960a2027f472036f3fee15d7dbce9nd type="section">Limit</directive> and <directive module="core" type="section"
22d5d84393d960a2027f472036f3fee15d7dbce9nd <seealso><directive module="mod_access_compat">Allow</directive></seealso>
22d5d84393d960a2027f472036f3fee15d7dbce9nd <seealso><directive module="mod_authz_core">Require</directive></seealso>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</directivesynopsis>
22d5d84393d960a2027f472036f3fee15d7dbce9nd</modulesynopsis>