Introducing Apache Access Control


<Directory /usr/local/apache2/htdocs/private>     Order Allow, Deny     Allow from 192.168.0 example.com     Deny from guest-terminal.example.com </Directory>


The example shows a sample configuration using IP and hostname-based access control with mod_access. Allow directives specify which individual IP addresses, networks, and hostnames have access to the content. Deny directives specify which ones will be denied. The Order directive specifies how Allow and Deny directives are evaluated.

In this example, the Order Allow, Deny directive specifies that Allow directives are to be evaluated first and Deny directives will be evaluated last. The order in which the directives are evaluated is important, and in this case the Deny directive will take precedence. Also, Order Allow, Deny ensures that if the client does not match any Allow directive, it will be denied access by default. Don't worry if you are a bit confused about how access control works. It is really easy once you understand the way directives are evaluated.




Apache(c) Phrase Book(c) Essential Code and Commands
Apache Phrasebook
ISBN: 0672328364
EAN: 2147483647
Year: 2006
Pages: 254

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net