Item13398: Lighttpd doesn't detect perlbrew perl, or the system PATH
Priority: Low
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component:
Branches: master
The recent updates in the Foswiki changes every shebang to
#! /usr/bin/env perl
what greatly helps it's usability with perlbrew environment. However, using the
tools/lighttpd.pl
still runs the foswiki
/bin
scripts with the default system perl, so still is must be done the pretty annoying
rewriteshebang.pl
.
The following edit in the
tools/lighhtpd.pl
solves the problem and ensures environment homogeneity.
@@ -141,7 +141,7 @@
";
}
else {
- print CONF '$HTTP["url"] =~ "^/bin" { cgi.assign = ( "" => "" ) }', "\n";
+ print CONF '$HTTP["url"] =~ "^/bin" { cgi.assign = ( "" => "'.$^X.'" ) }', "\n";
}
close(CONF);
e.g.:
- for the
/bin
execute explicitly the perl under what is currently running the lighttpd.pl
script. $^X
- and because the
lighttpd.pl
script contains the /usr/bin/env perl
the Foswiki-cgi will use the same perl too.
--
JozefMojzis - 09 May 2015
One more thing: The
lighttpd
doesn't provides
PATH
in it's default environment, so in the configure is always needed setup the
SafeEnvPath (expert setting) manually. Adding the following line into the generated
lighttpd.conf
file, fixes this:
setenv.add-environment = ("PATH" => env.PATH )
e.g. for the development, use the user's standard
$PATH
. It is probably not fully OK for the production, but i'm believe than any developer who uses the
tools/lighttpd.pl
for some quick foswiki hacks - could live with this. (For the production probably nobody uses the
tools/lighttpd.pl
anyway.
--
JozefMojzis - 09 May 2015