| Description: | Modifies the environment which is passed to CGI scripts andSSI 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 thehttpd process. Alternatively, environment variables may be set or unset within the configuration process.
| Description: | Passes environment variables from the shell |
|---|---|
| Syntax: | PassEnvenv-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 thehttpd process.
PassEnv LD_LIBRARY_PATH
| Description: | Sets environment variables |
|---|---|
| Syntax: | SetEnvenv-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 thevalue argument, the variable is set to an empty string.
The internal environment variables set by this directive are setafter 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 theRewriteRule directive, you should instead set the environment variable withSetEnvIf.
| Description: | Removes variables from the environment |
|---|---|
| Syntax: | UnsetEnvenv-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
Copyright 2025 The Apache Software Foundation.
Licensed under theApache License, Version 2.0.