You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Kendall Koning <kk...@egl.net> on 2000/03/17 18:52:02 UTC
Problem with Authentication.
Hi-
I'm trying to set up authentication using mod_perl, but I'm having a rough
time of it. I've spent quite a few hours now struggling with this problem,
so I'm posting it to the list to see if someone's got a pointer (or
cluestick!) for me.
My test module just OKs everything:
package Apache::DumbAuth
use strict;
use Apache::Constants qw(:common);
`echo module loaded >> /tmp/debug`;
sub handler {
my $r = shift;
`echo inside handler >> /tmp/debug`;
return OK;
}
and this is in /usr/lib/perl5/site_perl/5.005/Apache/DumbAuth.pm
in my httpd.conf I've got
PerlModule Apache::DumbAuth
in the .htaccess file I've got
AuthName test
AuthType Basic
PerlAuthenHandler Apache::DumbAuth
require valid-user
If I look at /tmp/debug while I try to access the restricted section, I see
that it loads the file, but the sub handler never gets called, and my l/p is
rejected. (yes, /tmp/debug is chmod 666) If I just use this module for a
PerlAccessHandler, it works fine. Am I missing something obvious?
Any responses appreciated.
--
Kendall Koning
Internet Operations Engineer, egl.net
Re: Problem with Authentication.
Posted by Kendall Koning <kk...@egl.net>.
It's reading .htaccess all right, when I do a 'PerlAccessHandler
Apache::DumbAuth' in .htaccess, I can see my debug statements (Thanks for
the tip) Enting Handler getting printed to the error log. It's just when I
change PerlAccessHandler to PerlAuthenHandler, I get
[Fri Mar 17 13:14:09 2000] [error] (2)No such file or directory: access to
/gallery/ failed for 208.163.4.1, reason: Authentication failure
- suspiciously the same error I get when I do 'PerlAuthenHandler junkhere'.
Which kinda tells me that it can't find the file or something- I don't know
why this would be a problem for one and not the other... :(
--
Kendall Koning
Internet Operations Engineer, egl.net
----- Original Message -----
From: "Dan Rench" <dr...@i-works.com>
To: "Kendall Koning" <kk...@egl.net>
Cc: <mo...@apache.org>
Sent: Friday, March 17, 2000 3:42 PM
Subject: Re: Problem with Authentication.
>
> On Fri, 17 Mar 2000, Kendall Koning wrote:
>
> > I'm trying to set up authentication using mod_perl, but I'm having a
rough
> > time of it. I've spent quite a few hours now struggling with this
problem,
> > so I'm posting it to the list to see if someone's got a pointer (or
> > cluestick!) for me.
>
> Here's a possibility: in your httpd.conf, do you have "AllowOverride None"
> for the directory where you put the .htaccess file? If so, Apache will
> ignore your .htaccess files. Just to test, try an .htaccess file that
> contains just this:
>
> <Perl>
> print STDERR '.htaccess hit at ', scalar localtime, "\n";
> </Perl>
>
> Then hit that location with a browser and watch your error_log.
> If you don't see anything, Apache is ignoring it.
>
> Aside: "man perlstyle" and find the part about not using backticks in a
> void context. I realize it's just for debugging, but there are nicer ways
> to go about it. $r->log methods are probably cleanest, but I tend to
print
> to STDERR, which just goes to the error_log.
>
>
Re: Problem with Authentication.
Posted by Dan Rench <dr...@i-works.com>.
On Fri, 17 Mar 2000, Kendall Koning wrote:
> I'm trying to set up authentication using mod_perl, but I'm having a rough
> time of it. I've spent quite a few hours now struggling with this problem,
> so I'm posting it to the list to see if someone's got a pointer (or
> cluestick!) for me.
Here's a possibility: in your httpd.conf, do you have "AllowOverride None"
for the directory where you put the .htaccess file? If so, Apache will
ignore your .htaccess files. Just to test, try an .htaccess file that
contains just this:
<Perl>
print STDERR '.htaccess hit at ', scalar localtime, "\n";
</Perl>
Then hit that location with a browser and watch your error_log.
If you don't see anything, Apache is ignoring it.
Aside: "man perlstyle" and find the part about not using backticks in a
void context. I realize it's just for debugging, but there are nicer ways
to go about it. $r->log methods are probably cleanest, but I tend to print
to STDERR, which just goes to the error_log.