You are here: Foswiki>Tasks Web>Item13398 (05 Jul 2015, GeorgeClark)Edit Attach

Item13398: Lighttpd doesn't detect perlbrew perl, or the system PATH

pencil
Priority: Low
Current State: Closed
Released In: 2.0.0
Target Release: major
Applies To: Engine
Component:
Branches: master
Reported By: JozefMojzis
Waiting For:
Last Change By: GeorgeClark
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
 

ItemTemplate edit

Summary Lighttpd doesn't detect perlbrew perl, or the system PATH
ReportedBy JozefMojzis
Codebase 1.2.0 beta1, trunk
SVN Range
AppliesTo Engine
Component
Priority Low
CurrentState Closed
WaitingFor
Checkins distro:5c17572ce25e
TargetRelease major
ReleasedIn 2.0.0
CheckinsOnBranches master
trunkCheckins
masterCheckins distro:5c17572ce25e
ItemBranchCheckins
Release01x01Checkins
Topic revision: r4 - 05 Jul 2015, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy