Introducing Apache Authorization and Authentication Configuration


<Directory /usr/local/apache2/htdocs/private> AuthType Basic AuthName "Password Protected Area" AuthUserFile /usr/local/apache2/conf/htusers Require user admin </Directory>


The listing shows a sample configuration snippet that password-protects a directory. AuthType defines the authentication type: in this case, HTTP basic authentication. AuthName associates a text with the area that will be password-protected. This text will be presented to the user when the browser prompts her for a password (usually in a separate pop-up window). The AuthUserFile points to the user database and the Require directive specifies a user who will be granted access upon successful authentication. The following sections include more details on the previous example as well as instructions on how to create and manipulate the user database and how to combine IP and user-based control access, as shown in the "Combining Access Control Methods" section.




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