Paul Lussier wrote:
>
> I have a link that I want to restrict access to, so that when
> someone clicks it, they must enter their username and password.
> I know there's something about an htpasswd file somewhere, but
> I don't know how to use it.
It's simple and yet it's not. I think Apache Week has at
least one article about it <http://www.apacheweek.com/>.
The easiest path is something like the below. Replace "SR"
with the path to your server-root (the parent of th conf/ and
logs/ directories), and "DR" with the path to the directory
you want to protect.
% cd SR
% bin/htpasswd -cm .htpasswd-gnhlug username1
Password:
% bin/htpasswd -m .htpasswd-gnhlug username2
:
Edit conf/httpd.conf and add a <Directory> container like this:
<Directory DR>
AuthName "GNHLuggers Only"
AuthType Basic
AuthUserFile SR/.htpasswd-gnhlug
Require valid-user
</Directory>
Then "bin/apachectl graceful" to reload the server.
If you want to protect a file rather than a directory, use
<Directory DR>
<Files filename>
AuthName "GNHLuggers Only"
AuthType Basic
AuthUserFile SR/.htpasswd-gnhlug
Require valid-user
</Files>
</Directory>
--
#ken P-)}
Ken Coar <http://Golux.Com/coar/>
Apache Software Foundation <http://www.apache.org/>
"Apache Server for Dummies" <http://Apache-Server.Com/>
Come to the first official Apache Software Foundation
Conference! <http://ApacheCon.Com/>
**********************************************************
To unsubscribe from this list, send mail to
[EMAIL PROTECTED] with the following text in the
*body* (*not* the subject line) of the letter:
unsubscribe gnhlug
**********************************************************