[olug] website authentication with apache

Jason Ferguson jferguson3 at HOME.COM
Wed Mar 7 19:32:46 UTC 2001


Adam,

Im presuming that you're wanting to use Basic authentication, which is one of
the simpler methods. Drawback: users have to have another password and username
to access the resource. There are some modules that could interact with your
current login system, but let me see if I can pound through Basic first (its
been awhile).

First, yes, you will need a password file. Apache provide the htpassword
utility with the distribution.

htpassword -c Filename username

That creates the password file (if necessary) and adds a user to it. So now you
have the password file. Now we protect our directory:


<directory stuff>
AuthUserFile /path/to/htpassword
AuthGroup /dev/null
AuthName "Private Web Server"
AuthType Basic

</directory>

Now, you should be able to protect the whole virtual host that way if you do
desire. However, if adding lots of users, there are better ways of doing
business. Basic authentication requires the mod_auth module. The are plenty of
other mod_auth modules:

mod_auth_dbm
mod_auth_ldap
mod_auth_smb (???)

Okay, anyone else wanna critique what I did here?

Jason
El Vice Presidente

Adam Lassek wrote:

> I'm running two different websites on the webserver at work, one which is a
> public website and one that needs to be private to the company. I need to
> make the webserver ask for a username and password in order to access the
> private website--it doesn't even have to be very fancy, in fact there will
> be only one login and password that everyone will use. I know that I need to
> use a .htaccess file in the directory of the private website in order to do
> this, but how do I set that up? Does anyone know?
>
> ______________________________________________
> FREE Personalized Email at Mail.com
> Sign up at http://www.mail.com/?sr=signup
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: olug-unsubscribe at bstc.net
> For additional commands, e-mail: olug-help at bstc.net


---------------------------------------------------------------------
To unsubscribe, e-mail: olug-unsubscribe at bstc.net
For additional commands, e-mail: olug-help at bstc.net



More information about the OLUG mailing list