Click to See Complete Forum and Search --> : Simple Question on Apache


linuxluis
03-18-2002, 01:46 AM
Hello all,

I have a simple question for you guys and gals.

I have just installed apache on box (rh7.2)

My question is how do I passwd protect a link to my that page.

lets say that I host and run my own website. and I have a member page. you type that url into your browser prompting you with a username & passwd. Or could someone point me in the right direction or give me some links to how to set it up.

Thanks

bishop
:eek:

recluse.
03-18-2002, 11:44 AM
I belive it can be done with PHP. Maybe there's a way native to just Apache but I don't know anything afterall.

Dagda
03-18-2002, 12:04 PM
look here http://www.linuxnewbie.org/cgi-bin/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=21&t=002766

marvin
03-18-2002, 12:09 PM
I have used the .htaccess file for this. I didn't administer that box though, so I don't know if you need to change any apache settings or if this works out of the box.

Create a file called .htaccess in the dir wou want to password protect. Add the following to the file

AuthName "Members only"
AuthType Basic
AuthUserFile <path>/.htpasswd

require valid-user


Then cd to the <path> dir and type

htpasswd .htpasswd <username>

and enter a password. See man htpasswd for more info

Note, the .htpasswd file must be readable to the user apache runs as (usually apache or nobody). Also, passwords are sent in plain text to the server (if i recall correctly).

You can find more info here (http://apache-server.com/tutorials/ATusing-htaccess.html).

knute
03-18-2002, 01:20 PM
There are apache modules for pam authentication as well. I've seen them in the debian lists.