Apache2::PerlSections $PerlConfig

Josh Narins <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <F61EA32D7A6A79478142BA12E77AEE83266EE72161@MS3.nyc.seniorbridgeinternal.com>
perl 5.12.3, httpd-2.2.16, mod_perl 2.0.5, RHEL5

This is part of a project to move a large a large-ish mod_perl application from mod_perl1 to 2. It's about time!

Most of the httpd.conf is read by setting $PerlConfig equal to the output of a HTML::Template in a <Perl> section.

Using a Cleanup handler and Apache2::Directive, I can see that only some PerlPassEnv, PerlOptions => '+GlobalRequest' and the <Perl> section which reads the template are defined, i.e. no locations or directives from the output of the template.

If I cut and paste the output of the template into httpd.conf, things work fine.

I've tried a few things.

my $r = Apache2::RequestUtil->request;
$r->add_config($template->output);

Which gets me

Syntax error on line 66 of /home/web/rosalind-dev9/etc/httpd/httpd.conf:
\t(in cleanup) Global $r object is not available. Set:\n\tPerlOptions +GlobalRequest\nin httpd.conf at /home/web/rosalind-dev9/etc/httpd/httpd.conf line 116.\n

This seems odd to me, because +GlobalRequest is set before the <Perl> section, and is clearly set when I check Apache2::Directive in Cleanup.

And, per this six year old bug report, http://www.gossamer-threads.com/lists/modperl/modperl/88339, I tried a begin block that redefines Apache2::PerlSections's dump_special in conjunction with lines like

@PerlConfig = split /\n/, $template->output;

Printing the contents of $template->output to the error log inside the <Perl> section produces what I expect.

If I simply cut and paste the template output into the httpd.conf, it works fine.

Any suggestions how I can fix this?





Josh Narins
Director of Application Development
SeniorBridge

845 Third Ave
7th Floor
New York, NY 10022
Tel: (212) 994-6194
Fax: (212) 994-4260
Mobile: (917) 488-6248
[email protected]
seniorbridge.com<http://www.seniorbridge.com/>

[http://www.seniorbridge.com/images/seniorbridgedisclaimerTAG.gif]


________________________________
SeniorBridge Statement of Confidentiality: The contents of this email message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. Any dissemination, distribution or copying of this email by an unintended or mistaken recipient is strictly prohibited. In said event, kindly reply to the sender and destroy all entries of this message and any attachments from your system. Thank you.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.