PerlSetEnv not working consistently in libapache2-mod-perl
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
libapache2-mod-perl2 (Ubuntu) |
Fix Released
|
Low
|
Unassigned |
Bug Description
Binary package hint: libapache2-
PerlSetEnv does not work correctly, unless it appears after a <Perl></Perl> block.
This may also affect PerlPassEnv, SetEnv, or other directives.
This has been reported elsewhere on the web but no-one seems to take note.
Here's how to duplicate...
Test1 - In http.conf:
PerlModule Data::Dumper
PerlSetEnv BOB hello
<Perl>
warn Data::Dumper:
</Perl>
Ok, so when we run apache2ctl configtest we get:
$VAR1 = {
'PATH' => '/usr/local/
};
Syntax OK
As you can see the environment variable BOB does not exist. So, next test...
Test2 - In http.conf:
PerlModule Data::Dumper
<Perl>
</Perl>
PerlSetEnv BOB hello
<Perl>
warn Data::Dumper:
</Perl>
Note the empty <Perl></Perl> block with a blank line! (The blank line is important)
Ok, so when we run apache2ctl configtest we get:
$VAR1 = {
'BOB' => 'hello',
'PATH' => '/usr/local/
};
Syntax OK
Suddenly the PerlSetEnv works! PerlSetEnv should work without the need to include a blank <Perl></Perl> block.
This is particularly important because scripts called with PerlRequire and other directives (PerlConfigRequire PerlPostConfigR
This was tested on:
Linux ubuntu 2.6.27-9-generic (Ubuntu 8.10)
libapache2-
apache2 2.2.9-7ubuntu3
Hi,
I was wondering if you were still having this problem?
Thanks
chuck