On Thu, 10 Oct 2002 17:44:51 -0700 George Valpak <[EMAIL PROTECTED]> wrote:

> At 04:16 PM 10/10/2002 -0700, I wrote:
> >I am having trouble with Apache:AuthCookieDBI. I hope someone here can help because 
>I have not been able to find a solution despite extensive searching.
> 
> <snip>
> 
> OK, now I am poking in the code.
> 
> I modified the BEGIN section for AuthCookieDBI.pm thusly:
> 
> BEGIN {
>         my @keyfile_vars = grep {
>                 $_ =~ /DBI_SecretKeyFile$/
>         } keys %{ Apache->server->dir_config() };
> #my changes start here
> my @list = keys %{ Apache->server->dir_config()};
> Apache::log_error("keys:@list");
> Apache::log_error( "all varrs=$_" );
> Apache::log_error( "keyfile_vars=@keyfile_vars" );
> #my changes end here
>         foreach my $keyfile_var ( @keyfile_vars ) {
>                 my $keyfile = Apache->server->dir_config( $keyfile_var );
>                 my $auth_name = $keyfile_var;
>                 $auth_name =~ s/DBI_SecretKeyFile$//;
>                 unless ( open( KEY, "<$keyfile" ) ) {
>                         Apache::log_error( "Could not open keyfile for $auth_nam
> e in file $keyfile" );
>                 } else {
>                         $SECRET_KEYS{ $auth_name } = <KEY>;
>                         close KEY;
>                 }
>         }
> }
> 
> and restarted the server. the logs show:
> 
> 
> [Thu Oct 10 17:34:14 2002] [error] keys:
> [Thu Oct 10 17:34:14 2002] [error] all varrs=
> [Thu Oct 10 17:34:14 2002] [error] keyfile_vars=
> [Thu Oct 10 17:34:14 2002] [notice] Apache/1.3.23 (Unix)  (Red-Hat/Linux) 
>mod_ssl/2.8.7 OpenSSL/0.9.6b DAV/1.0.3 PHP/4.1.2 mod_perl/1.26 configured -- resuming 
>normal operations
> [Thu Oct 10 17:34:14 2002] [notice] suEXEC mechanism enabled (wrapper: 
>/usr/sbin/suexec)
> [Thu Oct 10 17:34:14 2002] [notice] Accept mutex: sysvsem (Default: sysvsem)
> 
> This to me indicates that the call to Apache->server->dir_config() is not returning 
>anything at all.  A quick look a the eagle book, p 456 does not explain to me why 
>that should be....any thoughts?
> 

I had a similar problem a while ago. Check out this thread:

http://groups.yahoo.com/group/modperl/message/34266

----- snip - snip -------------------------------------------------
I discovered the same thing. I think the problem is that the BEGIN
block as written, only considers parameters defined in the *main
server*. So if you have any PerlSetVar in a Virtual Server, it will
not be found.

A kludgy workaround is to move the PerlSetVar out of any Virtual
Server sections. A better option is to reimplement the mechanism for
populating the SECRET_KEYS hash, so that Virtual Servers are handled
properly.
----- snip - snip -------------------------------------------------

-- 
Vegard Vesterheim               : Phone: +47 73 55 79 12
UNINETT                         : Fax:   +47 73 55 79 01
N-7465 Trondheim, NORWAY        : Email: [EMAIL PROTECTED]

Reply via email to