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