lighttpd not making global environment variables availble to executables
Asked Answered
S

1

5

How to set up lighttpd in order to make environment variables available to spawned processes?

I have an executable being called through CGI as an URL (e.g. http://.../cgi-bin/executable.bin).

The executable needs to load libraries and read environment variables that are set in /etc/profile using export FOO=BAR.

When I try to access the URL, it generates Internal Server Error (500), caused by an empty environment variable, which are properly set in /etc/profile.

Staal answered 2/3, 2015 at 19:39 Comment(0)
S
9

I ended up enabling mod_setenv in modules.conf and including each environment variable I needed like this:

##
## mod_setenv
##
setenv.add-environment = ( "PATH" => env.PATH,
                           "WSFC_HOME" => env.WSFC_HOME,
                           "LD_LIBRARY_PATH" => env.LD_LIBRARY_PATH )
Staal answered 15/4, 2015 at 22:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.