Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old May 8th, 2001, 12:40 PM
crash_nic crash_nic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 14 crash_nic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Troubleshooting mod_auth_db

Any ideas how to troubleshoot mod_auth_db?

Everything seems to be in order...

httpd.conf says AddModule/LoadModule mod_auth_db.so...
I put .htaccess in the protected directory with all the directives...
I created .htpasswd with dbmmanage and that file exists...

But when I fire up the protected page in my browser the server only says "access forbidden" and won't throw me an authenitication box...

Any help much appreciated.

Reply With Quote
  #2  
Old May 8th, 2001, 02:32 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
>> I created .htpasswd with dbmmanage and that file exists

You shouldn't use and fancy db authentication if you can't get the plain text htpasswd to work. If you don't have that many users (100 fewer), don't use db, it's slower.

>> the server only says "access forbidden"

Can you access to that dir when that .htaccess is removed?
If not, you need options Indexes

<Directory "/path/to/docroot/protected_dir">
# or /path/to/docroot
options Indexes
..
..
</Directory>

>> and won't throw me an authenitication box

Right on. Apache is not reading your Auth... lines because you have told Apache not to grant permission for .htaccess to do so. You need AllowOverride AuthConfig or AllowOverride All to enable that. Start here -> http://httpd.apache.org/docs/mod/co...l#allowoverride

>> I created .htpasswd with dbmmanage and that file exists

It doesn't matter whether or not .htpasswd exists, at the very least, you should get authentication prompt. Whether you can authenticated relies on .htpasswd.

If you still have any problems with this, maybe you should start here -> http://www.apacheweek.com/features/userauth or post your .htaccess plus the fake or real URL plus the directory paths or so.

Reply With Quote
  #3  
Old May 8th, 2001, 06:50 PM
crash_nic crash_nic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 14 crash_nic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
I fiddled with httpd.conf a bit, adding the lines:

<Directory /path/to/file>
AllowOverride AuthConfig
</Directory>

and that seemed to do the trick; I get an authorization box when trying to the access protected page.

However, no username/password combination added via the dbmmanage adduser command seems to work!

Help! Help!

I will have to work on that tomorrow.

Thanks again for the help.

----------------
I can understand anything that's explained well enough.

Reply With Quote
  #4  
Old May 9th, 2001, 07:40 AM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Check the message .htaccess never matches the password, when password is correct in this Forum and go to http://www.apacheweek.com/features/. I already told you not to use the fancy db authentication stuffs when you can't even get the simple plain text .htpasswd to work. You are just causing yourself some troubles for not listening.

Reply With Quote
  #5  
Old May 9th, 2001, 01:02 PM
crash_nic crash_nic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 14 crash_nic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
My httpd/error_log reads:

...Can't open db auth file...

so I searched around the web and, well, there could be a bug in the dbmmanage script. I found this bit of code which was offered as a patch:

# Got this from http://www.humanfactor.com/cgi-bin/...9/Mar/0087.html


package dbmmanage;
-# -ldb -lndbm -lgdbm
-BEGIN { @AnyDBM_File::ISA = qw(DB_File NDBM_File GDBM_File) }
+
use strict;
use Fcntl;
-use AnyDBM_File ();
+use Getopt::Std;
+
+# shorthand-to-real-name lookup
+my %formats = ( "db", "DB_File",
+ "ndbm", "NDBM_File",
+ "gdbm", "GDBM_File" );
+
+my %opts;
+getopt 'f:', \%opts;
+if (my $dbm_class = $formats{$opts{'f'}}) {
+ @AnyDBM_File::ISA = ($dbm_class);
+}
+require AnyDBM_File;

my($file,$command,$key,$crypted_pwd) = @ARGV;

@@ -91,7 +102,7 @@
my($mode, $flags) = $command =~
/^(?:view|check)$/ ? (0644, O_RDONLY) : (0644, O_RDWR|O_CREAT);

-tie %DB, "AnyDBM_File", $file, $flags, $mode || die "Can't tie $file: $!";
+tie %DB, "AnyDBM_File", $file, $flags, $mode or die "Can't tie $file: $!";
dbmc->$command();
untie %DB;


...

I put this in my dbmmanage script, and lo, it didn't seem to make any difference. It creates a Berkeley DB file which still cannot be opened!

Regards,

Last edited by crash_nic : May 10th, 2001 at 10:57 AM.

Reply With Quote
  #6  
Old May 9th, 2001, 07:20 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Apache doc doesn't mention this, you can either use mod_auth_db or mod_auth_dbm (not both), compiling both are known to cause problems. Find out which particular one your OS supports. When compiling apache from src, you should explicitly disable either one of those modules.

Reply With Quote
  #7  
Old May 14th, 2001, 10:53 AM
crash_nic crash_nic is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Posts: 14 crash_nic User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
http://www.apacheweek.com/features/dbmauth says I must edit the Configuration file in the Apache /src directory, then run ./Configure and Make. What is the configuration file called, I can't seem to find it. Thanks.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Troubleshooting mod_auth_db


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway