Modules | Directives | FAQ | Glossary | Sitemap
Apache HTTP Server Version 2.4
Apache > HTTP Server > Documentation > Version 2.4 > Modules
Apache Module mod_env
Description: Modifies the environment which is passed to CGI scripts and SSI pages Status: Base Module Identifier: env_module Source File: mod_env.c
Summary
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.
Directives
Bugfix checklist
See also
- Environment Variables
- SetEnvIf
SetEnv Directive
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.
Example
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, we should instead set the environment variable with SetEnvIf.
See also
UnsetEnv Directive
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.
Example
UnsetEnv LD_LIBRARY_PATH