httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Henderson <>
Subject [users@httpd] apache2 and .htaccess
Date Tue, 19 May 2009 05:59:14 GMT
Is there any way to tell Apache2 to prompt for username and password
when it sees a .htaccess file in a directory?

At the moment, I need to define the directory in the following
fashion in Apache2 conf file but it becomes a problem as I have
thousands of directories that needs .htaccess file password

For example, assuming /website is DirectoryRoot then protect
/website/a1, /website/b2 etc.

<Directory "/website/dir">
AllowOverride All
Options Indexes
Order allow,deny
Allow from all
AuthUserFile /website/dir/.htaccess

Here is my .htaccess file

AuthName "Restricted"
AuthType Basic
AuthLDAPURL ldap://,dc=company,dc=com?sAMAccountName?sub
AuthBasicProvider ldap
AuthzLDAPAuthoritative off
require valid-user

In /etc/apache2/default-server.conf, I have changed

DocumentRoot "/srv/www/htdocs"
<Directory "/srv/www/htdocs/">
Options None
AllowOverride None
Order allow,deny
Allow from all


DocumentRoot "/website"
<Directory "/website/">
Options None
AllowOverride All
Order allow,deny
Allow from all

but it don't seem to work. Thanks for any help.

The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message