2

How can I set an environment variable (not an "Apache environment variable", as described in the Apache HTTP server documentation here, but a plain old operating system environment variable) for processes spawned by Apache HTTP server?

I have a Flask WSGI application for which I would like to have an environment variable set for the user www-data under which the HTTP server runs.

This is basically the same as the question How to set an environment variable for a process spawned by the webserver?, except for Apache HTTP server.

1 Answer 1

3

You already mentioned the docs. There it is: http://httpd.apache.org/docs/2.2/mod/mod_env.html

Look for the SetEnv. It is exactly what you requested.

1
  • 1
    No, SetEnv isn't necessarily what they are after. Whether that is of any use depends on how they are hosting their WSGI application with Apache. May do what is wanted with CGI, but will not with mod_wsgi or mod_python. Can't remember what happens with mod_fastcgi and mod_fcgi and a FASTCGI/WSGI adapter. OP needs to state what WSGI hosting mechanism they are using. Jul 30, 2011 at 6:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .