mod_authz_host.html.en revision 1b390add6886fb1c0acdea82be0ef0920f1158ca
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz<?xml version="1.0" encoding="ISO-8859-1"?>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><!--
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz This file is generated from xml source: DO NOT EDIT
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd -->
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<title>mod_authz_host - Apache HTTP Server</title>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<link href="/style/css/manual.css" rel="stylesheet" media="all" type="text/css" title="Main stylesheet" />
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<link href="/style/css/manual-loose-100pc.css" rel="alternate stylesheet" media="all" type="text/css" title="No Sidebar - Default font size" />
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<link href="/style/css/manual-print.css" rel="stylesheet" media="print" type="text/css" />
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<link href="/images/favicon.ico" rel="shortcut icon" /></head>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<body>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div id="page-header">
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p>
52fff662005b1866a3ff09bb6c902800c5cc6dedjerenkrantz<p class="apache">Apache HTTP Server Version 2.3</p>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<img alt="" src="/images/feather.gif" /></div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div class="up"><a href="./"><img title="&lt;-" alt="&lt;-" src="/images/left.gif" /></a></div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div id="path">
4b5981e276e93df97c34e4da05ca5cf8bbd937dand<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.3</a> &gt; <a href="./">Modules</a></div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div id="page-content">
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div id="preamble"><h1>Apache Module mod_authz_host</h1>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="toplang">
0066eddda7203f6345b56f77d146a759298dc635gryzor<p><span>Available Languages: </span><a href="/en/mod/mod_authz_host.html" title="English">&nbsp;en&nbsp;</a> |
0066eddda7203f6345b56f77d146a759298dc635gryzor<a href="/fr/mod/mod_authz_host.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a></p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd</div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<table class="module"><tr><th><a href="module-dict.html#Description">Description:</a></th><td>Group authorizations based on host (name or IP
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4ndaddress)</td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="module-dict.html#Status">Status:</a></th><td>Base</td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="module-dict.html#ModuleIdentifier">Module�Identifier:</a></th><td>authz_host_module</td></tr>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<tr><th><a href="module-dict.html#SourceFile">Source�File:</a></th><td>mod_authz_host.c</td></tr>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin<tr><th><a href="module-dict.html#Compatibility">Compatibility:</a></th><td>Available in Apache 2.3 and later</td></tr></table>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<h3>Summary</h3>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>The authorization providers implemented by <code class="module"><a href="/mod/mod_authz_host.html">mod_authz_host</a></code> are
3267af3f6fbf9743e64a9f019c745317f18cd9f7poirier registered using the <code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code>
3267af3f6fbf9743e64a9f019c745317f18cd9f7poirier directive. The directive can be referenced within a
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <code class="directive"><a href="/mod/core.html#directory">&lt;Directory&gt;</a></code>,
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <code class="directive"><a href="/mod/core.html#files">&lt;Files&gt;</a></code>,
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin or <code class="directive"><a href="/mod/core.html#location">&lt;Location&gt;</a></code> section
cb3a1082aec4b3b4f4ed238c93c3cc54933a7f0end as well as <code><a href="core.html#accessfilename">.htaccess</a>
cb3a1082aec4b3b4f4ed238c93c3cc54933a7f0end </code> files to control access to particular parts of the server.
f8b7daeb0e3f0ac4544fcc665de10c6b69a1ce0dsf Access can be controlled based on the client hostname or IP address.</p>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz <p>In general, access restriction directives apply to all
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz access methods (<code>GET</code>, <code>PUT</code>,
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz <code>POST</code>, etc). This is the desired behavior in most
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz cases. However, it is possible to restrict some methods, while
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz leaving other methods unrestricted, by enclosing the directives
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz in a <code class="directive"><a href="/mod/core.html#limit">&lt;Limit&gt;</a></code> section.</p>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div id="quickview"><h3 class="directives">Directives</h3>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin<p>This module provides no
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin directives.</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin<h3>Topics</h3>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin<ul id="topics">
35ff2d06df95b9593ee312dfff883c76f3b97798noodl<li><img alt="" src="/images/down.gif" /> <a href="#requiredirectives">The Require Directives</a></li>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin</ul><h3>See also</h3>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<ul class="seealso">
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin<li><a href="/howto/auth.html">Authentication, Authorization,
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin and Access Control</a></li>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin<li><code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code></li>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</ul></div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<div class="top"><a href="#page-header"><img alt="top" src="/images/up.gif" /></a></div>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin<div class="section">
35ff2d06df95b9593ee312dfff883c76f3b97798noodl<h2><a name="requiredirectives" id="requiredirectives">The Require Directives</a></h2>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
3267af3f6fbf9743e64a9f019c745317f18cd9f7poirier <p>Apache's <code class="directive"><a href="/mod/mod_authz_core.html#require">Require</a></code>
3267af3f6fbf9743e64a9f019c745317f18cd9f7poirier directive is used during the authorization phase to ensure that a user is allowed or
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin denied access to a resource. mod_authz_host extends the
f8b7daeb0e3f0ac4544fcc665de10c6b69a1ce0dsf authorization types with <code>ip</code> and <code>host</code>.
f8b7daeb0e3f0ac4544fcc665de10c6b69a1ce0dsf Other authorization types may also be
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin used but may require that additional authorization modules be loaded.</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>These authorization providers affect which hosts can
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz access an area of the server. Access can be controlled by
f8b7daeb0e3f0ac4544fcc665de10c6b69a1ce0dsf hostname, IP Address, or IP Address range.</p>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
a7a43799fed7fcdeaa70584dbd3ecd130b25deb3noodl<h3><a name="reqip" id="reqip">Require ip</a></h3>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>The <code>ip</code> provider allows access to the server
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin to be controlled based on the IP address of the remote client.
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin When <code>Require ip <var>ip-address</var></code> is specified,
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin then the request is allowed access if the IP address matches.</p>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>A full IP address:</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <div class="example"><p><code>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Require ip 10.1.2.3<br />
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Require ip 192.168.1.104 192.168.1.205
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin </code></p></div>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>An IP address of a host allowed access</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>A partial IP address:</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <div class="example"><p><code>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Require ip 10.1<br />
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Require ip 10 172.20 192.168.2
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin </code></p></div>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>The first 1 to 3 bytes of an IP address, for subnet
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin restriction.</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>A network/netmask pair:</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <div class="example"><p><code>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Require ip 10.1.0.0/255.255.0.0
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin </code></p></div>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>A network a.b.c.d, and a netmask w.x.y.z. For more
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin fine-grained subnet restriction.</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>A network/nnn CIDR specification:</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <div class="example"><p><code>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Require ip 10.1.0.0/16
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin </code></p></div>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>Similar to the previous case, except the netmask consists of
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin nnn high-order 1 bits.</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>Note that the last three examples above match exactly the
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin same set of hosts.</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>IPv6 addresses and IPv6 subnets can be specified as shown
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin below:</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <div class="example"><p><code>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Require ip 2001:db8::a00:20ff:fea7:ccea<br />
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Require ip 2001:db8::a00:20ff:fea7:ccea/10
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin </code></p></div>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
a7a43799fed7fcdeaa70584dbd3ecd130b25deb3noodl<h3><a name="reqhost" id="reqhost">Require host</a></h3>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>The <code>host</code> provider allows access to the server
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin to be controlled based on the host name of the remote client.
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin When <code>Require host <var>host-name</var></code> is specified,
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin then the request is allowed access if the host name matches.</p>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>A (partial) domain-name</p>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
aa0b2780958e9b1467c9d0153a05738e399811a5nd <div class="example"><p><code>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Require host apache.org<br />
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Require host .net example.edu
aa0b2780958e9b1467c9d0153a05738e399811a5nd </code></p></div>
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin <p>Hosts whose names match, or end in, this string are allowed
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin access. Only complete components are matched, so the above
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin example will match <code>foo.apache.org</code> but it will not
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin match <code>fooapache.org</code>. This configuration will cause
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin Apache to perform a double reverse DNS lookup on the client IP
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin address, regardless of the setting of the <code class="directive"><a href="/mod/core.html#hostnamelookups">HostnameLookups</a></code> directive. It will do
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin a reverse DNS lookup on the IP address to find the associated
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin hostname, and then do a forward lookup on the hostname to assure
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin that it matches the original IP address. Only if the forward
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin and reverse DNS are consistent and the hostname matches will
8951c7d73bfa2ae5a2c8fe5bd27f3e677be02564noirin access be allowed.</p>
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
1f53e295ebd19aed1767d12da7abfab9936c148cjerenkrantz
1b390add6886fb1c0acdea82be0ef0920f1158casf<h3><a name="reqlocal" id="reqlocal">Require local</a></h3>
1b390add6886fb1c0acdea82be0ef0920f1158casf <p>The <code>local</code> provider allows access to the server if any
1b390add6886fb1c0acdea82be0ef0920f1158casf of the following conditions is true:</p>
1b390add6886fb1c0acdea82be0ef0920f1158casf
1b390add6886fb1c0acdea82be0ef0920f1158casf <ul>
1b390add6886fb1c0acdea82be0ef0920f1158casf <li>the client address matches 127.0.0.0/8</li>
1b390add6886fb1c0acdea82be0ef0920f1158casf <li>the client address is ::1</li>
1b390add6886fb1c0acdea82be0ef0920f1158casf <li>both the client and the server address of the connection are
1b390add6886fb1c0acdea82be0ef0920f1158casf the same</li>
1b390add6886fb1c0acdea82be0ef0920f1158casf </ul>
1b390add6886fb1c0acdea82be0ef0920f1158casf
1b390add6886fb1c0acdea82be0ef0920f1158casf <p>This allows a convenient way to match connections that originate from
1b390add6886fb1c0acdea82be0ef0920f1158casf the local host:</p>
1b390add6886fb1c0acdea82be0ef0920f1158casf
1b390add6886fb1c0acdea82be0ef0920f1158casf <div class="example"><p><code>
1b390add6886fb1c0acdea82be0ef0920f1158casf Require local
1b390add6886fb1c0acdea82be0ef0920f1158casf </code></p></div>
1b390add6886fb1c0acdea82be0ef0920f1158casf
1b390add6886fb1c0acdea82be0ef0920f1158casf
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</div>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd<div class="bottomlang">
0066eddda7203f6345b56f77d146a759298dc635gryzor<p><span>Available Languages: </span><a href="/en/mod/mod_authz_host.html" title="English">&nbsp;en&nbsp;</a> |
0066eddda7203f6345b56f77d146a759298dc635gryzor<a href="/fr/mod/mod_authz_host.html" hreflang="fr" rel="alternate" title="Fran�ais">&nbsp;fr&nbsp;</a></p>
3b3b7fc78d1f5bfc2769903375050048ff41ff26nd</div><div id="footer">
50039065d571fe01fd458a3f031c995a1fd53c22rbowen<p class="apache">Copyright 2010 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>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd<p class="menu"><a href="/mod/">Modules</a> | <a href="/mod/directives.html">Directives</a> | <a href="/faq/">FAQ</a> | <a href="/glossary.html">Glossary</a> | <a href="/sitemap.html">Sitemap</a></p></div>
bdd978e5ecd8daa2542d4d4e1988c78a622cd7f4nd</body></html>