I am still having trouble with Apache::AuthCookieDBI.
I tried moving the PerlSetVar line out of the virtual server to the main server but
nothing in the behavior changed.
Is it possible that the "Apache->server->dir_config()" code is somehow wrong?
I grepped all the other .pm files on my server and did not find a similar construct
anywhere.
I realize that this begin statement happens when there is not yet a request object.
But is it somehow occurring too early in the startup phase for the vars to ba
available.
I really really want to figure out what's going wrong here - I am about to implement a
workaround where I hardcode the values of the PerlSetVars into the BEGIN block, but
that is very unsatisfying.
Other people use this module commonly, don't they? Is there a module I should be using
instead?
Thanks for your help!
GV
At 08:50 AM 10/11/2002 +0200, Vegard Vesterheim wrote:
>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 -------------------------------------------------