natenho
natenho

Reputation: 5621

lighttpd not making global environment variables availble to executables

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.

Upvotes: 5

Views: 3314

Answers (1)

natenho
natenho

Reputation: 5621

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 )

Upvotes: 9

Related Questions