mod_access_compat.xml revision a330659fa32865eb8521adaccf5d9b75687b9aeb
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder<?xml version="1.0"?>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<!DOCTYPE modulesynopsis SYSTEM "/style/modulesynopsis.dtd">
e9458b1a7a19a63aa4c179f9ab20f4d50681c168Jens Elkner<?xml-stylesheet type="text/xsl" href="/style/manual.en.xsl"?>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<!-- $LastChangedRevision$ -->
431571057e88a650a974adec93ea4bb5173b6213Felix Gabriel Mance
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<!--
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Licensed to the Apache Software Foundation (ASF) under one or more
431571057e88a650a974adec93ea4bb5173b6213Felix Gabriel Mance contributor license agreements. See the NOTICE file distributed with
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu this work for additional information regarding copyright ownership.
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu The ASF licenses this file to You under the Apache License, Version 2.0
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu (the "License"); you may not use this file except in compliance with
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu the License. You may obtain a copy of the License at
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu http://www.apache.org/licenses/LICENSE-2.0
19e01e1a7e319063434bd86c8ecbc5f241ef9993Felix Gabriel Mance
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Unless required by applicable law or agreed to in writing, software
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski distributed under the License is distributed on an "AS IS" BASIS,
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
a604cbad8e2202147b5c6bb9f2e06ae61162d654Felix Gabriel Mance See the License for the specific language governing permissions and
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu limitations under the License.
be2439588008221e691321fdf4f75432cfb72878Felix Gabriel Mance-->
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
fc05327b875b5723b6c17849b83477f29ec12c90Felix Gabriel Mance<modulesynopsis metafile="mod_access_compat.xml.meta">
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<name>mod_access_compat</name>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<description>Group authorizations based on host (name or IP
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiuaddress)</description>
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder<status>Extension</status>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<sourcefile>mod_access_compat.c</sourcefile>
e0f1794e365dd347e97b37d7d22b2fce27296fa1Christian Maeder<identifier>access_compat_module</identifier>
424860079d47bf490fa98d5d7498096a0447c569mcodescu<compatibility>Available in Apache HTTP Server 2.3 as a compatibility module with
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiuprevious versions of Apache httpd 2.x. The directives provided by this module
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiuhave been deprecated by the new authz refactoring. Please see
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder<module>mod_authz_host</module></compatibility>
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder
32bbac77828be0233953f8fe476edb0a9585408dChristian Maeder<summary>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>The directives provided by <module>mod_access_compat</module> are
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu used in <directive module="core" type="section">Directory</directive>,
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <directive module="core" type="section">Files</directive>, and
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <directive module="core" type="section">Location</directive> sections
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu as well as <code><a href="core.html#accessfilename">.htaccess</a>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu </code> files to control access to particular parts of the server.
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Access can be controlled based on the client hostname, IP address, or
27fdf879983dd28e211b41f3be6c0e930b7c816bFelix Gabriel Mance other characteristics of the client request, as captured in <a
431571057e88a650a974adec93ea4bb5173b6213Felix Gabriel Mance href="/env.html">environment variables</a>. The <directive
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder module="mod_access_compat">Allow</directive> and <directive
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu module="mod_access_compat">Deny</directive> directives are used to
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu specify which clients are or are not allowed access to the server,
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu while the <directive module="mod_access_compat">Order</directive>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu directive sets the default access state, and configures how the
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <directive module="mod_access_compat">Allow</directive> and <directive
b84c87f199dc287d235d7dad6ea344f6912ef531Christian Maeder module="mod_access_compat">Deny</directive> directives interact with each
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu other.</p>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>Both host-based access restrictions and password-based
be00381168b3f10192afabbba136fb06d3a9f358Christian Maeder authentication may be implemented simultaneously. In that case,
be00381168b3f10192afabbba136fb06d3a9f358Christian Maeder the <directive module="mod_access_compat">Satisfy</directive> directive is used
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu to determine how the two sets of restrictions interact.</p>
27fdf879983dd28e211b41f3be6c0e930b7c816bFelix Gabriel Mance
7852de3551fc797566ee71165bafe05b6d81728cnotanartist <note type="warning"><title>Note</title>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>The directives provided by <module>mod_access_compat</module> have
27fdf879983dd28e211b41f3be6c0e930b7c816bFelix Gabriel Mance been deprecated by the new authz refactoring. Please see
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <module>mod_authz_host</module>.</p>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu </note>
27fdf879983dd28e211b41f3be6c0e930b7c816bFelix Gabriel Mance
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance <p>In general, access restriction directives apply to all
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance access methods (<code>GET</code>, <code>PUT</code>,
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance <code>POST</code>, etc). This is the desired behavior in most
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance cases. However, it is possible to restrict some methods, while
431571057e88a650a974adec93ea4bb5173b6213Felix Gabriel Mance leaving other methods unrestricted, by enclosing the directives
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu in a <directive module="core" type="section">Limit</directive> section.</p>
27fdf879983dd28e211b41f3be6c0e930b7c816bFelix Gabriel Mance</summary>
424860079d47bf490fa98d5d7498096a0447c569mcodescu
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance<seealso><directive module="mod_authz_core">Require</directive></seealso>
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance<seealso><module>mod_authz_host</module></seealso>
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder<seealso><module>mod_authz_core</module></seealso>
424860079d47bf490fa98d5d7498096a0447c569mcodescu
424860079d47bf490fa98d5d7498096a0447c569mcodescu<directivesynopsis>
424860079d47bf490fa98d5d7498096a0447c569mcodescu<name>Allow</name>
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance<description>Controls which hosts can access an area of the
d6d81ead61a5f9fb7d047e623f7898e730c258camcodescuserver</description>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<syntax> Allow from all|<var>host</var>|env=[!]<var>env-variable</var>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu[<var>host</var>|env=[!]<var>env-variable</var>] ...</syntax>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu<contextlist><context>directory</context><context>.htaccess</context>
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance</contextlist>
7852de3551fc797566ee71165bafe05b6d81728cnotanartist<override>Limit</override>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance<usage>
9475501a6acf48434052d9e6f4a05ed6681eaaabFrancisc Nicolae Bungiu <p>The <directive>Allow</directive> directive affects which hosts can
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu access an area of the server. Access can be controlled by
7852de3551fc797566ee71165bafe05b6d81728cnotanartist hostname, IP address, IP address range, or by other
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski characteristics of the client request captured in environment
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski variables.</p>
424860079d47bf490fa98d5d7498096a0447c569mcodescu
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder <p>The first argument to this directive is always
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder <code>from</code>. The subsequent arguments can take three
424860079d47bf490fa98d5d7498096a0447c569mcodescu different forms. If <code>Allow from all</code> is specified, then
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder all hosts are allowed access, subject to the configuration of the
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder <directive module="mod_access_compat">Deny</directive> and <directive
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu module="mod_access_compat">Order</directive> directives as discussed
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu below. To allow only particular hosts or groups of hosts to access
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance the server, the <em>host</em> can be specified in any of the
60f30f0eeeacdfc1e0dfe39664373ddf5a0675adFelix Gabriel Mance following formats:</p>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <dl>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <dt>A (partial) domain-name</dt>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <dd>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <example><title>Example:</title>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Allow from example.org<br />
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Allow from .net example.edu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu </example>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>Hosts whose names match, or end in, this string are allowed
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder access. Only complete components are matched, so the above
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu example will match <code>foo.example.org</code> but it will not
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder match <code>fooexample.org</code>. This configuration will cause
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder Apache httpd to perform a double DNS lookup on the client IP
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu address, regardless of the setting of the <directive
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu module="core">HostnameLookups</directive> directive. It will do
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu a reverse DNS lookup on the IP address to find the associated
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu hostname, and then do a forward lookup on the hostname to assure
3d3889e0cefcdce9b3f43c53aaa201943ac2e895Jonathan von Schroeder that it matches the original IP address. Only if the forward
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu and reverse DNS are consistent and the hostname matches will
31e9d2a02e15b7dbc157e0d3fb3b84f6c8666482Christian Maeder access be allowed.</p></dd>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <dt>A full IP address</dt>
656f17ae9b7610ff2de1b6eedeeadea0c3bcdc8dChristian Maeder
d3cb3401882f6956de016f8eecbec1cd3b868acbFelix Gabriel Mance <dd>
d3cb3401882f6956de016f8eecbec1cd3b868acbFelix Gabriel Mance <example><title>Example:</title>
d3cb3401882f6956de016f8eecbec1cd3b868acbFelix Gabriel Mance Allow from 10.1.2.3<br />
d3cb3401882f6956de016f8eecbec1cd3b868acbFelix Gabriel Mance Allow from 192.168.1.104 192.168.1.205
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu </example>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>An IP address of a host allowed access</p></dd>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
7852de3551fc797566ee71165bafe05b6d81728cnotanartist <dt>A partial IP address</dt>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <dd>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <example><title>Example:</title>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Allow from 10.1<br />
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu Allow from 10 172.20 192.168.2
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu </example>
0dd6e7830de0887c9a12356447975a826b3b3db2Christian Maeder <p>The first 1 to 3 bytes of an IP address, for subnet
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu restriction.</p></dd>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <dt>A network/netmask pair</dt>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <dd>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <example><title>Example:</title>
06acd8a23b2f06e7b2373d53f738cf56c7f03223Francisc Nicolae Bungiu Allow from 10.1.0.0/255.255.0.0
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu </example>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>A network a.b.c.d, and a netmask w.x.y.z. For more
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu fine-grained subnet restriction.</p></dd>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <dt>A network/nnn CIDR specification</dt>
7852de3551fc797566ee71165bafe05b6d81728cnotanartist
32bbac77828be0233953f8fe476edb0a9585408dChristian Maeder <dd>
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski <example><title>Example:</title>
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski Allow from 10.1.0.0/16
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski </example>
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski <p>Similar to the previous case, except the netmask consists of
32bbac77828be0233953f8fe476edb0a9585408dChristian Maeder nnn high-order 1 bits.</p></dd>
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski </dl>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder <p>Note that the last three examples above match exactly the
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder same set of hosts.</p>
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder <p>IPv6 addresses and IPv6 subnets can be specified as shown
b84c87f199dc287d235d7dad6ea344f6912ef531Christian Maeder below:</p>
7852de3551fc797566ee71165bafe05b6d81728cnotanartist
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski <example>
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder Allow from 2001:db8::a00:20ff:fea7:ccea<br />
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder Allow from 2001:db8::a00:20ff:fea7:ccea/10
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder </example>
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder <p>The third format of the arguments to the
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder <directive>Allow</directive> directive allows access to the server
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder to be controlled based on the existence of an <a
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder href="/env.html">environment variable</a>. When <code>Allow from
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder env=<var>env-variable</var></code> is specified, then the request is
cf0439f74f1d55a9840d38a88f9b0f4fc00d5547Christian Maeder allowed access if the environment variable <var>env-variable</var>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu exists. When <code>Allow from env=!<var>env-variable</var></code> is
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu specified, then the request is allowed access if the environment
7852de3551fc797566ee71165bafe05b6d81728cnotanartist variable <var>env-variable</var> doesn't exist.
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu The server provides the ability to set environment
7852de3551fc797566ee71165bafe05b6d81728cnotanartist variables in a flexible way based on characteristics of the client
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski request using the directives provided by
624f8c31bd8d6746b93f4b5966aa6fc7680fefc5Felix Gabriel Mance <module>mod_setenvif</module>. Therefore, this directive can be
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski used to allow access based on such factors as the clients
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <code>User-Agent</code> (browser type), <code>Referer</code>, or
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu other HTTP request header fields.</p>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <example><title>Example:</title>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu SetEnvIf User-Agent ^KnockKnock/2\.0 let_me_in<br />
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu &lt;Directory /docroot&gt;<br />
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <indent>
b84c87f199dc287d235d7dad6ea344f6912ef531Christian Maeder Order Deny,Allow<br />
624f8c31bd8d6746b93f4b5966aa6fc7680fefc5Felix Gabriel Mance Deny from all<br />
7852de3551fc797566ee71165bafe05b6d81728cnotanartist Allow from env=let_me_in<br />
624f8c31bd8d6746b93f4b5966aa6fc7680fefc5Felix Gabriel Mance </indent>
1a38107941725211e7c3f051f7a8f5e12199f03acmaeder &lt;/Directory&gt;
80875f917d741946a39d0ec0b5721e46ba609823Till Mossakowski </example>
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu
ee93ea764a2b8189253e912c8447f9419033f6d4Francisc Nicolae Bungiu <p>In this case, browsers with a user-agent string beginning
d0f58d27c2536eba454d8f77de8617bc6a2c99cdFelix Gabriel Mance with <code>KnockKnock/2.0</code> will be allowed access, and all
431571057e88a650a974adec93ea4bb5173b6213Felix Gabriel Mance others will be denied.</p>
431571057e88a650a974adec93ea4bb5173b6213Felix Gabriel Mance</usage>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu</directivesynopsis>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu<directivesynopsis>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu<name>Deny</name>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu<description>Controls which hosts are denied access to the
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescuserver</description>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu<syntax> Deny from all|<var>host</var>|env=[!]<var>env-variable</var>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu[<var>host</var>|env=[!]<var>env-variable</var>] ...</syntax>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu<contextlist><context>directory</context><context>.htaccess</context>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu</contextlist>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu<override>Limit</override>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu<usage>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu <p>This directive allows access to the server to be restricted
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu based on hostname, IP address, or environment variables. The
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu arguments for the <directive>Deny</directive> directive are
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu identical to the arguments for the <directive
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu module="mod_access_compat">Allow</directive> directive.</p>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu</usage>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu</directivesynopsis>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu<directivesynopsis>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu<name>Order</name>
b90f0b7fd6ccfbdd7e5adb65b1f6c02c7758ff5cmcodescu<description>Controls the default access state and the order in which
<directive>Allow</directive> and <directive>Deny</directive> are
evaluated.</description>
<syntax> Order <var>ordering</var></syntax>
<default>Order Deny,Allow</default>
<contextlist><context>directory</context><context>.htaccess</context>
</contextlist>
<override>Limit</override>
<usage>
<p>The <directive>Order</directive> directive, along with the
<directive module="mod_access_compat">Allow</directive> and
<directive module="mod_access_compat">Deny</directive> directives,
controls a three-pass access control system. The first pass
processes either all <directive
module="mod_access_compat">Allow</directive> or all <directive
module="mod_access_compat">Deny</directive> directives, as specified
by the <directive module="mod_access_compat">Order</directive>
directive. The second pass parses the rest of the directives
(<directive module="mod_access_compat">Deny</directive> or
<directive module="mod_access_compat">Allow</directive>). The third
pass applies to all requests which do not match either of the first
two.</p>
<p>Note that all <directive
module="mod_access_compat">Allow</directive> and <directive
module="mod_access_compat">Deny</directive> directives are
processed, unlike a typical firewall, where only the first match is
used. The last match is effective (also unlike a typical firewall).
Additionally, the order in which lines appear in the configuration
files is not significant -- all <directive
module="mod_access_compat">Allow</directive> lines are processed as
one group, all <directive
module="mod_access_compat">Deny</directive> lines are considered as
another, and the default state is considered by itself.</p>
<p><em>Ordering</em> is one of:</p>
<dl>
<dt><code>Allow,Deny</code></dt>
<dd>First, all <directive
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>
<example>
Order Deny,Allow<br />
Deny from all<br />
Allow from example.org
</example>
<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>
<example>
Order Allow,Deny<br />
Allow from example.org<br />
Deny from foo.example.org
</example>
<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>
<example>
&lt;Directory /www&gt;<br />
<indent>
Order Allow,Deny<br />
</indent>
&lt;/Directory&gt;
</example>
<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>
</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>
<example>
Require valid-user<br />
Allow from 192.168.1<br />
Satisfy Any
</example>
<p>
Another frequent use of the <directive>Satisfy</directive> directive
is to relax access restrictions for a subdirectory:
</p>
<example>
&lt;Directory /var/www/private&gt;<br />
Require valid-user<br />
&lt;/Directory&gt;<br />
<br />
&lt;Directory /var/www/private/public&gt;<br />
Allow from all<br />
Satisfy Any<br />
&lt;/Directory&gt;
</example>
<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>
</usage>
<seealso><directive module="mod_access_compat">Allow</directive></seealso>
<seealso><directive module="mod_authz_core">Require</directive></seealso>
</directivesynopsis>
</modulesynopsis>