- publishing free software manuals
The Apache HTTP Server Reference Manual
by Apache Software Foundation
Paperback (6"x9"), 862 pages
ISBN 9781906966034
RRP £19.95 ($29.95)

Get a printed copy>>>

3.37  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 the environment that will be provided to CGI scripts and 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:

PassEnv

SetEnv

UnsetEnv

See also:

PassEnv Directive

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 environment variables to pass to CGI scripts and SSI pages from the environment of the shell which invoked the httpd process.

Example

PassEnv LD_LIBRARY_PATH

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 environment variable, which is then passed on to CGI scripts and SSI pages.

Example

SetEnv SPECIAL_PATH /foo/bin

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.

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 environment variables from those passed on to CGI scripts and SSI pages.

Example

UnsetEnv LD_LIBRARY_PATH

ISBN 9781906966034The Apache HTTP Server Reference ManualSee the print edition