Basic HTTP authentication

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
jamal
Forum Commoner
Posts: 57
Joined: Sat Oct 26, 2002 7:53 pm
Location: London

Basic HTTP authentication

Post by jamal »

hi GUys
Please this may sound too elementary but
I need your help.
How can I configure apache httpd.con file in
order to support the use of Basic HTTP authentication.
I am using apache 1.3.26 on windows.
Thanks
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

jamal
Forum Commoner
Posts: 57
Joined: Sat Oct 26, 2002 7:53 pm
Location: London

Post by jamal »

can anyone please help me on how to properly configure the directives.
I use apache 1.3.26 on win98.
this is what I have in my httpd.con file


<Directory “c:/inetpub/wwwroot/http_cookie”>
AuthUserFile c:/inetpub/wwwroot/http_cookie
AuthName "Enter Username and Password"
AuthType Basic

<Limit GET POST>
require valid-user
</Limit>
</Directory>


Please help if you can.
Thanks
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

The configuration seems ok, except that your authuserfile must be a file somewhere (not a directory) and should never be in the web area, you should put it somewhere else, such as

AuthUserFile c:/mysecrets/htpasswd

Then you must create that file, easiest way to do that is using the binary htpasswd that comes with apache

The first user you create with the -c option so that the file is created, after that you add new users at will

mkdir c:\mysecrets
htpasswd -c c:\mysecrets\htpasswd myusername

htpasswd c:\mysecrets\htpasswd someotherusername
Post Reply