mod_env

mod_env overview

mod_env module is used for control of w3wp process environment variables that will be provided to CGI scripts and SSI pages. Alternatively, environment variables may be set or unset within the configuration process.

mod_env directives

PassEnv

Description: Passes environment variables from the shell
Syntax: PassEnv env-variable [env-variable] ...
Context: server config, virtual host, directory, .htaccess
Module: mod_env

Actually, PassEnv directive is left for Apache compatibility and practically does not perform any actions. This happens because IIS unlike Apache automatically adds the list of w3wp process environment variables to the list of server variables.

Example:

PassEnv LD_LIBRARY_PATH 

SetEnv

Description: Passes Sets environment variables
Syntax: SetEnv env-variable value
Context: server config, virtual host, directory, .htaccess
Module: mod_env

SetEnv directive sets an environment variable that is then passed on to CGI scripts and SSI pages.

Example:

SetEnv SPECIAL_PATH /foo/bin

UnsetEnv

Description: Removes variables from the environment
Syntax: UnsetEnv env-variable [env-variable] ...
Context: server config, virtual host, directory, .htaccess
Module: mod_env

UnsetEnv removes one or more environment variables from those passed to CGI scripts and SSI pages.

Example:

 UnsetEnv LD_LIBRARY_PATH