httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] authentication question
Date Fri, 10 Sep 2004 07:35:25 GMT
> -----Original Message-----
> From: mbastreak [mailto:mbastreak@awofm.info]
> 
> I have a question about using a .htpasswd file for 
> authentication. I have
> read through the documetation on Apache's website, but I am 
> just not getting
> understanding it. Here is my situation:
> I have a website, www.awofm.info on that website we have an 
> two areas that
> we would like to password protect. I was wondering, what do I 
> need to do in
> order to get apache to use a .htpasswd file in order to allow 
> that user to
> access those directory. I have the .htpasswd file created, 
> but I am not able
> to just put the file in the directory and it work. 

First off - get your names figured out:

.htpasswd is usually the name of the file containing the credentials
.htaccess is the name of the file containing the auth directives

To set up password authentication, apache needs to read a bunch of
"Auth" directives, eg:

AuthType Basic
AuthName "By Invitation Only"
AuthUserFile /usr/local/apache/passwd/passwords
Require user rbowen sungo

There are two ways you can use this group of directives:

1) In the config, inside a Directory container - eg:

<Directory /path/to/password/dir>
  .. auth directives

2) In a .htaccess file which you store in the directory to be protected

If you use method 2, you need to allow apache to read the .htaccess
file, so in the config, you must say:

AllowOverride All

The file containing the credentials (in the example
/usr/local/apache/passwd/passwords) can be anywhere but must not be
under the docroot (or people could read it!).

All this is in the docs:
http://httpd.apache.org/docs/howto/auth.html#basic

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 


> I think I 
> am missing
> something, I have had this set up before, but I don't 
> remember how I got it
> working. Can someone remind me? Do I need to add a something 
> to the vhost
> part of my httpd.conf file or somewhere else. Since I use 
> Gentoo Linux,
> there are several conf files, if needed I can attatch them.
> 
> Patrick
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP 
> Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
Diese E-mail ist eine private und persönliche Kommunikation. Sie hat
keinen Bezug zur Börsen- bzw. Geschäftstätigkeit der SWX Gruppe. This
e-mail is of a private and personal nature. It is not related to the
exchange or business activities of the SWX Group. Le présent e-mail est
un message privé et personnel, sans rapport avec l'activité boursière du
Groupe SWX.

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message