You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Rob Bloodgood <ro...@empire2.com> on 2001/04/04 03:14:28 UTC

RE: Apache::AuthCookieDBI forgets its config [UPDATE]

> HOWEVER, whenever the module is actually invoked, %SECRET_KEYS is empty!
> 
> Here's the BEGIN{} block:
> BEGIN {
> 	my @keyfile_vars = grep {
> 		$_ =~ /DBI_SecretKeyFile$/
> 	} keys %{ Apache->server->dir_config() };
> 	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_name in file
> $keyfile" );
> 		} else {
> 			$SECRET_KEYS{ $auth_name } = <KEY>;
> 			close KEY;
> 		}
> 	}
> }

OK, more examination reveals that:
At the time this BEGIN block is running, this call: 
      my @keyfile_vars = grep {
 		$_ =~ /DBI_SecretKeyFile$/
 	} keys %{ Apache->server->dir_config() };

is returning EMPTY.

Meaning it's evaling too early to see the dir_config???????  Or what?

PerlModule Apache::AuthCookieDBI
PerlSetVar AdminPath /admin
PerlSetVar AdminLoginScript /scripts/adminlogin.pl
#PerlSetVar AdminLoginScript /error/adminlogin.html

# Optional, to share tickets between servers.
#PerlSetVar AdminDomain .domain.com


# These must be set
PerlSetVar AdminDBI_DSN "dbi:Oracle:STATS"
PerlSetVar AdminDBI_SecretKeyFile /etc/httpd/conf/admin.secret.key

# etc.



Ideas?

L8r,
Rob

#!/usr/bin/perl -w
use Disclaimer qw/:standard/;


RE: Apache::AuthCookieDBI forgets its config [SOLVED]

Posted by Rob Bloodgood <ro...@empire2.com>.
> OK, more examination reveals that:
> At the time this BEGIN block is running, this call:
>       my @keyfile_vars = grep {
>  		$_ =~ /DBI_SecretKeyFile$/
>  	} keys %{ Apache->server->dir_config() };
>
> is returning EMPTY.
>
> Meaning it's evaling too early to see the dir_config???????  Or what?

- PerlModule Apache::AuthCookieDBI
> PerlSetVar AdminPath /admin
> PerlSetVar AdminLoginScript /scripts/adminlogin.pl
>
> # These must be set
> PerlSetVar AdminDBI_DSN "dbi:Oracle:STATS"
> PerlSetVar AdminDBI_SecretKeyFile /etc/httpd/conf/admin.secret.key
+ PerlModule Apache::AuthCookieDBI

My ealier message reveals the solution: move the line
PerlModule Apache::AuthCookieDBI
to *AFTER* the line(s)
PerlSetVar BlahBlahDBI_SecretKeyFile /path/to/keyfile

It now works perfectly!

Thx for putting up w/ me bouncing my problem-solving off the list...
hopefully somebody will save the day & a half I just spent on this.

L8r,
Rob

#/usr/bin/perl -w
use Disclaimer qw/:standard/;