You were right, now i have this that works[...]
PerlModule Apache2 ----------------------------------- <Perl > $Location{'~ .*log$'} = { SetHandler => "perl-script", PerlResponseHandler => "Blogum::UserLog", PerlOptions => "+ParseHeaders", Allow => "from all", }; </Perl>
But now it doesn't work: PerlRequire ...archive.pl
inside archive.pl use Apache2(); $Location{'~ .*log$'} = { SetHandler => "perl-script", PerlResponseHandler => "Blogum::UserLog", PerlOptions => "+ParseHeaders", Allow => "from all", };
I've tried also with LocationMatch. Anything i'm doing wrong?
You mean you have moved the contents of that <Perl> section to a perl file and expect it to work? It has no idea what %main::Location is. It needs to be in the special Apache::ReadConfig namespace. like:
$Apache::ReadConfig::Location{....
though I think Philippe has changed things recently and I'm not sure whether the above will work.
Philippe, what's the current state of things with perl section namespaces, when people want to add config from perl, rather than <Perl> sections? Should they do something like:
my $file = __FILE__; my $namespace = "Apache::ReadConfig\::$file"; ${"$namespace\::Location"}{foo} = {...};
We need to document this issue.
But, Gerard, this should work for sure:
use Apache::ServerUtil (); my $config = <<EOI; <Perl > $Location{'~ .*log$'} = { SetHandler => "perl-script", PerlResponseHandler => "Blogum::UserLog", PerlOptions => "+ParseHeaders", Allow => "from all", }; </Perl> EOI Apache->server->add_config([split /\n/, $config]);
all it does is feeding the config section to the server, as if it was written in httpd.conf.
__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com
-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html