Apache .htaccess problem (dbmmanage not working)

Apache .htaccess problem (dbmmanage not working)

Post by Brad Bal » Mon, 21 Jun 1999 04:00:00



I am running RedHat 5.2 and Apache 1.3.6 (compiled from source). I am
trying to setup DBM Authentication using the 'dbmmanage' program but it
doesn't seem to work. Using the 'htpasswd' program everything works
great.

Basically, I can create my password database fine using dbmmanage (I
used /usr/local/apache/htdocs/.htpasswd). And I then create the
.htaccess file in the directory I want to restrict. And yes I'm aware of
"AuthUserFile" vs. "AuthDBMUserFile".

Then when I try to access the page it correctly asks for my password.
The problem is that I keep getting denied even though I HAVE entered the
correct password! The apache error_log shows: (I removed my ipadr)

[Sat Jun 19 09:04:57 1999] [error] [client xx.xx.xx.xx] (2)No such file
or directory: could not open dbm auth file:
/usr/local/apache/htdocs/.htpasswd
[Sat Jun 19 09:04:57 1999] [error] [client xx.xx.xx.xx] DBM user brad
not found: /usr/local/apache/htdocs/myfiles

The 'user brad not found' is bullshit because I can do 'dbmmanage
/usr/local/apache/htdocs/.htpasswd view' and it lists all of my accounts
including 'brad'.

For some reason apache is having problems opening the .htpasswd file
when it's created using 'dbmmanage'. If I create it using 'htpasswd' and
change .htacess to use "AuthUserFile" then everything works great. Why
doesn't it work using "AuthDBMUserFile" and 'dbmmanage'??? Apache is
configured properly to load dbm_auth and db_auth (and a few others).

The only thing I can think of is the 'dbmmanage' program is not the
correct version for RedHat 5.2. Is there such a thing as a 5.2 vs 6.0
version of this script?

Any help would be greatly appreciated. Linux is once again testing my
patience. And it's wearing damn thin!!!!! ;-)

Brad.

 
 
 

Apache .htaccess problem (dbmmanage not working)

Post by Brad Bal » Mon, 21 Jun 1999 04:00:00



> I am running RedHat 5.2 and Apache 1.3.6 (compiled from source). I am
> trying to setup DBM Authentication using the 'dbmmanage' program but it
> doesn't seem to work. Using the 'htpasswd' program everything works
> great.

Well, I found the problem. The 'dbmmanage' script is fubar.
Find the this line:

and change it to read:

Now when you create a password file it is given a .db extension and
everything works fine. Do not specify the .db extension when referencing
the file in .htaccess or when creating/deleting/modifying users.

Brad.

 
 
 

1. .htaccess/dbmmanage problems with RedHat6.1 & Apache 1.3.9

Ok this is starting to drive me crazy. I can create a flat file of users
using "htpasswd" and my apache authentication works fine. However, when
trying to use a password file created from "dbmmanage" I cannot get apache
to accept my password.

I am aware that you need to change AuthUserFile to AuthDMBUserFile in your
.htaccess. And I am aware of the problems caused by this line in the
dbmmanage script:


I tried switching this line so that NDBM_File was first but it didn't help.
Actually, I created a database using all three methods and none of them
work. The password is not accepted.

Here is my .htaccess file:
- - -
Authname "Private Area"
AuthType Basic
AuthDBMUserFile "/usr/local/apache/auth/passwd"
require valid-user
- - -

The error in my apache log shows:

[Mon Jan 24 15:05:18 2000] [error] [client X.X.X.X] (2)No such file or direc
tory: could not open dbm auth file: /usr/local/apache/auth/passwd
[Mon Jan 24 15:05:18 2000] [error] [client X.X.X.X] DBM user brad not found:
 /usr/local/apache/htdocs

I thought maybe the password database should be inside of htdocs so I tried
that but it made no difference. In fact, I know /usr/local/apache/auth/
should work because I placed a flat file there created from "htpasswd" and
everything works fine. And permissions are fine as well.

So I am stumped! Can someone please point me in the right direction? What is
going wrong here? These are the four files I created:

# file one
one: Berkeley DB 2.X Hash/Little Endian (Version 5)
# file two
two: GNU dbm 1.x or ndbm database, little endian
# file three.db
three.db: Berkeley DB 2.X Hash/Little Endian (Version 5)
# file four
four: ASCII text

None of these work except for "four" which was created using "htpasswd". I
also checked http.conf to make sure the proper modules were loaded and
everything seems to be fine:

LoadModule dbm_auth_module    libexec/mod_auth_dbm.so
LoadModule db_auth_module     libexec/mod_auth_db.so
AddModule mod_auth_dbm.c
AddModule mod_auth_db.c

PLEASE HELP!!!!

Brad.

2. nat and ms-messenger chat rooms

3. dbmmanage not working as advertised

4. I18N and "Kon" ?

5. Apache: .htaccess does not work

6. smb restart issue on RH8

7. .htaccess Apache Virtual Host not working

8. Extended Characters

9. Apache 1.1.3 and .htaccess: not working

10. .htaccess will not work on apache / SuSE Linux6.0

11. Help: Apache .htaccess on Solaris 2.6 not working

12. htaccess not working (apache 1.3.3/mod_perl 1.16_01/AuthenDBI 0.81)

13. .htaccess does not work with Apache 1.3.6 on Suse 6.2