2348N/A<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
2348N/A<
TITLE>Apache module mod_access</
TITLE>
2348N/A<!-- Background white, links blue (unvisited), navy (visited), red (active) --> 2348N/A<
H1 ALIGN="CENTER">Module mod_access</
H1>
2348N/Ais compiled in by default. It provides access control based on client
2348N/A<
LI><
A HREF="#allow">Allow</
A>
2348N/A<
LI><
A HREF="#allowfromenv">Allow from env=</
A>
2348N/A<
LI><
A HREF="#deny">Deny</
A>
2348N/A<
LI><
A HREF="#denyfromenv">Deny from env=</
A>
2348N/A<
LI><
A HREF="#order">Order</
A>
<
H2><
A NAME="allow">Allow directive</
A></
H2>
<!--%plaintext <?INDEX {\tt Allow} directive> --> ><
STRONG>Syntax:</
STRONG></
A> Allow from <
EM>host host ...</
EM><
BR>
><
STRONG>Context:</
STRONG></
A> directory, .htaccess<
BR>
><
STRONG>Override:</
STRONG></
A> Limit<
BR>
><
STRONG>Status:</
STRONG></
A> Base<
BR>
><
STRONG>Module:</
STRONG></
A> mod_access
The Allow directive affects which hosts can access a given directory.
<
EM>Host</
EM> is one of the following:
<
DD>All hosts are allowed access
<
DT>A (partial) domain-name
<
DD>Hosts whose names match, or end in, this string are allowed access.
<
DD>An IP address of a host allowed access
<
DD>The first 1 to 3 bytes of an IP address, for subnet restriction.
<
DT>A
network/
nnn CIDR specification (<
STRONG>Apache 1.3 and later</
STRONG>)
<
DD>Similar to the previous case, except the netmask consists of nnn
All hosts in the specified domain are allowed access.
Note that this compares whole components; <
CODE>
bar.edu</
CODE>
See also <
A HREF="#deny">Deny</
A>, <
A HREF="#order">Order</
A>, and
<
A NAME="allowfromenv"><
STRONG>Syntax:</
STRONG> Allow from
env=<
EM>variablename</
EM></
A><
BR>
><
STRONG>Context:</
STRONG></
A> directory, .htaccess<
BR>
><
STRONG>Override:</
STRONG></
A> Limit<
BR>
><
STRONG>Status:</
STRONG></
A> Base<
BR>
><
STRONG>Module:</
STRONG></
A> mod_access<
BR>
><
STRONG>Compatibility:</
STRONG></
A> Apache 1.2 and above
The <
CODE>Allow from env</
CODE> directive controls access to a directory by the
existence (or non-existence) of an environment variable.
<Directory /docroot>
In this case browsers with the user-agent string <
TT>
KnockKnock/
2.0</
TT> will
be allowed access, and all others will be denied.
See also <
A HREF="#denyfromenv">Deny from env</
A>
and <
A HREF="#order">Order</
A>.
<
H2><
A NAME="deny">Deny directive</
A></
H2>
<!--%plaintext <?INDEX {\tt Deny} directive> --> ><
STRONG>Syntax:</
STRONG></
A> Deny from <
EM>host host ...</
EM><
BR>
><
STRONG>Context:</
STRONG></
A> directory, .htaccess<
BR>
><
STRONG>Override:</
STRONG></
A> Limit<
BR>
><
STRONG>Status:</
STRONG></
A> Base<
BR>
><
STRONG>Module:</
STRONG></
A> mod_access
The <
CODE>Deny</
CODE> directive affects which hosts can access a given directory.
<
EM>Host</
EM> is one of the following:
<
DD>all hosts are denied access
<
DT>A (partial) domain-name
<
DD>host whose name is, or ends in, this string are denied access.
<
DD>An IP address of a host denied access
<
DD>The first 1 to 3 bytes of an IP address, for subnet restriction.
<
DT>A
network/
nnn CIDR specification (<
STRONG>Apache 1.3 and later</
STRONG>)
<
DD>Similar to the previous case, except the netmask consists of nnn
<
BLOCKQUOTE><
CODE>Deny from 16</
CODE></
BLOCKQUOTE>
All hosts in the specified network are denied access.
Note that this compares whole components; <
CODE>
bar.edu</
CODE>
See also <
A HREF="#allow">Allow</
A> and <
A HREF="#order">Order</
A>.
<
A NAME="denyfromenv"><
STRONG>Syntax:</
STRONG> Deny from
env=<
EM>variablename</
EM></
A><
BR>
><
STRONG>Context:</
STRONG></
A> directory, .htaccess<
BR>
><
STRONG>Override:</
STRONG></
A> Limit<
BR>
><
STRONG>Status:</
STRONG></
A> Base<
BR>
><
STRONG>Module:</
STRONG></
A> mod_access<
BR>
><
STRONG>Compatibility:</
STRONG></
A> Apache 1.2 and above
The <
CODE>Deny from env</
CODE> directive controls access to a directory by the
existence (or non-existence) of an environment variable.
<Directory /docroot>
In this case browsers with the user-agent string <
TT>
BadRobot/
0.9</
TT> will
be denied access, and all others will be allowed.
See also <
A HREF="#allowfromenv">Allow from env</
A>
and <
A HREF="#order">Order</
A>.
<
H2><
A NAME="order">Order directive</
A></
H2>
<!--%plaintext <?INDEX {\tt Order} directive> --> ><
STRONG>Syntax:</
STRONG></
A> Order <
EM>ordering</
EM><
BR>
><
STRONG>Default:</
STRONG></
A> <
CODE>Order Deny,Allow</
CODE><
BR>
><
STRONG>Context:</
STRONG></
A> directory, .htaccess<
BR>
><
STRONG>Override:</
STRONG></
A> Limit<
BR>
><
STRONG>Status:</
STRONG></
A> Base<
BR>
><
STRONG>Module:</
STRONG></
A> mod_access
The <
CODE>Order</
CODE> directive controls the order in which
<
A HREF="#allow">Allow</
A> and <
A HREF="#deny">Deny</
A> directives are
evaluated. <
EM>Ordering</
EM> is one
<
DD>the <
CODE>Deny</
CODE> directives are evaluated before the <
CODE>Allow</
CODE>
directives. (The initial state is OK.)
<
DD>the <
CODE>Allow</
CODE> directives are evaluated before the <
CODE>Deny</
CODE>
directives. (The initial state is FORBIDDEN.)
<
DD>Only those hosts which appear on the <
CODE>Allow</
CODE> list and do not
appear on the <
CODE>Deny</
CODE> list are granted access. (The initial state is
Keywords may only be separated by a comma; no whitespace is allowed between
<
STRONG>Note that in all cases every <
CODE>Allow</
CODE> and <
CODE>Deny</
CODE>
statement is evaluated, there is no "short-circuiting".</
STRONG>
Hosts in the
ncsa.uiuc.edu domain are allowed access; all other hosts are