PDA

View Full Version : apache authentication (password protecting a web page)


timbo
8th March 2004, 08:46 PM
What's the quickest way I can lock a webpage with a username/password on apache?

(I'm generally a fan of RTFM, and I plan on doing my homework, but I'm looking for a quick fix in the meantime so I can keep my site running while I read up :) )

...basically, I setup a page with some family photos, and I'd like to make it private. In the long run, I'd like to get fancy and use PAM, etc., but a single user/pass should do the trick for now.

mike
8th March 2004, 09:12 PM
Using .htaccess is the easiest. Just do a google search on htaccess, and you will find dozen of pages on how to set it up.

Mike

timbo
8th March 2004, 10:25 PM

Originally posted by mike
Using .htaccess is the easiest. Just do a google search on htaccess, and you will find dozen of pages on how to set it up.

Mike

Awesome. I used the example here: http://www.he.net/faq/tutorials/htaccess/demo.html to create a .htpasswd and .htaccess file in the directory I wanted to lock. It worked great and the change was immediate. Now I'm off to hit the docs to find a better long term solution.

Thanks!