in your apache config "/usr/local/apache/conf/httpd.conf"

look for these lines:
<Directory "/usr/local/apache/htdocs"> 
    Options Indexes FollowSymLinks MultiViews Includes ExecCGI

    AllowOverride None

    Order allow,deny
    Allow from all
</Directory>            
-------
change:

   AllowOverride None 

to:

  AllowOverride AuthConfig

the restart your httpd. you can do "killall -HUP httpd".  then create a
".htaccess" file in which directory you want to protect.

heres an example of an ".htaccess" content:

AuthUserFile /usr/local/apache/conf/.htpasswd
AuthGroupFile /dev/null
AuthName "Authorization Required"
AuthType Basic

<Limit GET POST>
require user <username>
</Limit>       
--------
here's a brief definition:
AuthuserFile is the password file
AuthGroupFile is the group password file but in this case this is
        specified as a singleuser.
AuthName is the message to appear.
AuthType is set to basic.
then specify the username.

Then create now the password file type:
htpasswd -c /usr/local/apache/conf/.htpasswd <username>

It should prompt you a password. If you are to add another username ommit
the "-c" flag:
htpasswd -c /usr/local/apache/conf/.htpasswd <anotheruser>

That's all.


~gams


On Wed, 5 Jul 2000, Systems Administrator wrote:

> Guys,
> 
> I need help asap.  How do I set up a web-page that asks for a username and
> password before you could see a certain html file for directory.?
> 
> Thanks!!! a lot!!
> 
> 
> -
> Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
> To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
> 



-
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Reply via email to