"pc_newbie" <ay RemoveThis @computermail.net> wrote in message
news:3f8ce3ab_1@news.iprimus.com.au...
> if u want to set some password for different users to access some
> protected subdirectories which under public_html, is it putting
> something into .htaccess and how, or which part of doc do i have to read
> for this? thanks
>
I just spent two hours fighting this...
mkdir /home/somedomain/public_html/passdir
htpasswd -cb /home/somedomain/.htpasswd billbob bobbill
(this next part is the part I missed )
chgrp apache .htpasswd
chmod 644 .htpasswd
(If the web process can not see the .htpasswd file it will not let in access
the directory)
In your /etc/httpd/conf/httpd.conf file add:
<Directory /home/somedomain/public_html/passdir>
AuthUserFile /home/somedomain/.htpasswd
AuthGroupFile /dev/null
AuthType Basic
AuthName "Restricted Files"
Require valid-user
</Directory>
Or add the above to /home/somedomain/public_html/passdir/.htaccess file
put an index.html file in the passdir directory then
<a style='text-decoration: underline;' href="http://somedomain.com/passdir" target="_blank">http://somedomain.com/passdir</a>
you will get a login window - enter the username billbob and password
bobbill
RTM works if the manual has all the steps to make the process work, in this
case the manual does not mention access rights to the .htpasswd file or
whatever you call your file.<!-- ~MESSAGE_AFTER~ -->
>> Stay informed about: newbie questions!