|The Apache HTTP Server Reference Manual
by Apache Software Foundation
Paperback (6"x9"), 862 pages
RRP £19.95 ($29.95)
If you jumped directly to this part of the document to find out how to do authentication, it is important to note one thing. There is a common misconception that you are required to use .htaccess files in order to implement password authentication. This is not the case. Putting authentication directives in a <Directory> section, in your main server configuration file, is the preferred way to implement this, and .htaccess files should be used only if you don’t have access to the main server configuration file. See above for a discussion of when you should and should not use .htaccess files.
Having said that, if you still think you need to use a .htaccess file, you may find that a configuration such as what follows may work for you.
.htaccess file contents:
AuthName "Password Required"
Require Group admins
Note that AllowOverride AuthConfig must be in effect for these directives to have any effect.
Please see the authentication tutorial (p. 1265) for a more complete discussion of authentication and authorization.
|ISBN 9781906966034||The Apache HTTP Server Reference Manual||See the print edition|