Forum Moderators: open

Message Too Old, No Replies

Using Berkley DB for AUTH

mod_auth_db and Confusion over db formats

         

j_a_c_k

2:30 pm on Jul 31, 2007 (gmt 0)

10+ Year Member




I am trying to setup controlled access to a directory under Apache Apache/1.3.27
I have setup the following .htaccess
====================================
# -Test DB Basic Authentication-
AuthName "Members Area"
AuthType Basic
AuthDBUserFile /var/www/html/testaccessdb/passwords.db
AuthDBGroupFile /var/www/html/testaccessdb/passwords.db
require valid-user
====================================

I built the database with this php
------------------------------------
<html><head></head>
<body>
<?php
$id = dba_open("/var/www/html/testaccessdb/passwords.db", "c");
if (!$id) {
echo "dba_popen failed<br>\n";
exit;
}
dba_replace("tester", crypt("pwtest","de"), $id);
if (dba_exists("tester", $id)) {
echo dba_fetch("tester", $id);
}
echo "<br>\nPassword Created<br><hr>";
dba_close($id);
?>
</body></html>
------------------------------------

The db file created looks like this
++++++++++++++++++++++++++++++++++++++++
6
tester13
deZWP7mwouj6A
++++++++++++++++++++++++++++++++++++++++
All this looks good but does not work.
I get the password dialog prompt
but the user / pw of tester / pwtest does not work

I suspect that I may be using the wrong 'Berkley DB' format but I really cannot find anything to tell me what the password file should look like.

coopster

1:48 am on Aug 8, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I think you may need to use the dbmmanage utility.

[httpd.apache.org...]