Apache HTTP Server Version 2.5

| Description: | Modifies the environment which is passed to CGI scripts and SSI pages |
|---|---|
| Status: | Base |
| Module Identifier: | env_module |
| Source File: | mod_env.c |
This module allows for control of internal environment variables that
are used by various Apache HTTP Server modules. These variables are also
provided to CGI scripts as native system environment variables, and available
for use in SSI pages. Environment variables may be passed from the shell
which invoked the httpd process. Alternatively,
environment variables may be set or unset within the configuration process.
| Description: | Passes environment variables from the shell |
|---|---|
| Syntax: | PassEnv env-variable [env-variable]
... |
| Context: | server config, virtual host, directory, .htaccess |
| Override: | FileInfo |
| Status: | Base |
| Module: | mod_env |
Specifies one or more native system environment variables to make available
as internal environment variables, which are available to Apache HTTP Server modules
as well as propagated to CGI scripts and SSI pages. Values come from the
native OS environment of the shell which invoked the
httpd process.
PassEnv LD_LIBRARY_PATH
| Description: | Sets environment variables |
|---|---|
| Syntax: | SetEnv env-variable [value] |
| Context: | server config, virtual host, directory, .htaccess |
| Override: | FileInfo |
| Status: | Base |
| Module: | mod_env |
Sets an internal environment variable, which is then available to Apache HTTP Server modules, and passed on to CGI scripts and SSI pages.
SetEnv SPECIAL_PATH /foo/bin
If you omit the value argument, the variable is set to an empty string.
The internal environment variables set by this directive are set
after most early request processing directives are run, such as access
control and URI-to-filename mapping. If the environment variable you're
setting is meant as input into this early phase of processing such as the
RewriteRule directive, you should
instead set the environment variable with
SetEnvIf.
| Description: | Sets environment variables from a file |
|---|---|
| Syntax: | SetEnvFromFile file-path |
| Context: | server config, virtual host, directory |
| Status: | Base |
| Module: | mod_env |
| Compatibility: | Available in version 2.5.1 and later. |
Sets internal environment variables read from a file, which are then
available to Apache HTTP Server modules, and passed on to CGI scripts and
SSI pages. This is equivalent to a series of SetEnv directives, one per variable, but keeps
the values in a separate file.
The file-path is either an absolute path or a path relative
to the ServerRoot. The file is read
once when the configuration is parsed; changes to it take effect only after
the server is restarted.
Each line of the file has the form name=value. Blank lines
and lines beginning with # are ignored, and leading and
trailing whitespace is stripped. If a line contains no =, the
variable is set to an empty string. A line ending in a backslash
(\) is continued on the following line, just as in the main
configuration files.
SetEnvFromFile conf/app.env
conf/app.env) # Application settings
APP_MODE=production
SPECIAL_PATH=/foo/bin
As with SetEnv, the
variables are set after most early request processing directives
are run, such as access control and URI-to-filename mapping.
Unlike SetEnv, this directive
reads the contents of a file into the internal environment, where
they may be exposed through CGI, SSI, logging and other consumers. To
prevent an untrusted author from disclosing the contents of any file
readable by the server (for example configuration or credential files
elsewhere on the host), SetEnvFromFile is
not permitted in .htaccess files; it may only
be used in the main server configuration.
| Description: | Removes variables from the environment |
|---|---|
| Syntax: | UnsetEnv env-variable [env-variable]
... |
| Context: | server config, virtual host, directory, .htaccess |
| Override: | FileInfo |
| Status: | Base |
| Module: | mod_env |
Removes one or more internal environment variables from those passed on to CGI scripts and SSI pages.
UnsetEnv LD_LIBRARY_PATH