2 <!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
3 <?xml-stylesheet type="text/xsl" href="../style/manual.en.xsl"?>
4 <!-- $LastChangedRevision$ -->
7 Licensed to the Apache Software Foundation (ASF) under one or more
8 contributor license agreements. See the NOTICE file distributed with
9 this work for additional information regarding copyright ownership.
10 The ASF licenses this file to You under the Apache License, Version 2.0
11 (the "License"); you may not use this file except in compliance with
12 the License. You may obtain a copy of the License at
14 http://www.apache.org/licenses/LICENSE-2.0
16 Unless required by applicable law or agreed to in writing, software
17 distributed under the License is distributed on an "AS IS" BASIS,
18 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 See the License for the specific language governing permissions and
20 limitations under the License.
23 <modulesynopsis metafile="mod_env.xml.meta">
26 <description>Modifies the environment which is passed to CGI scripts and
27 SSI pages</description>
29 <sourcefile>mod_env.c</sourcefile>
30 <identifier>env_module</identifier>
32 <p>This module allows for control of internal environment variables that
33 are used by various Apache HTTP Server modules. These variables are also
34 provided to CGI scripts as native system environment variables, and available
35 for use in SSI pages. Environment variables may be passed from the shell
36 which invoked the <program>httpd</program> process. Alternatively,
37 environment variables may be set or unset within the configuration process.</p>
39 <seealso><a href="../env.html">Environment Variables</a></seealso>
40 <seealso><directive module="mod_setenvif">SetEnvIf</directive></seealso>
44 <description>Passes environment variables from the shell</description>
45 <syntax>PassEnv <var>env-variable</var> [<var>env-variable</var>]
47 <contextlist><context>server config</context><context>virtual host</context>
48 <context>directory</context><context>.htaccess</context></contextlist>
49 <override>FileInfo</override>
52 <p>Specifies one or more native system environment variables to make available
53 as internal environment variables, which are available to Apache HTTP Server modules
54 as well as propogated to CGI scripts and SSI pages. Values come from the
55 native OS environment of the shell which invoked the
56 <program>httpd</program> process.</p>
58 <example><title>Example</title>
59 <highlight language="config">
60 PassEnv LD_LIBRARY_PATH
68 <description>Sets environment variables</description>
69 <syntax>SetEnv <var>env-variable</var> <var>value</var></syntax>
70 <contextlist><context>server config</context><context>virtual host</context>
71 <context>directory</context><context>.htaccess</context></contextlist>
72 <override>FileInfo</override>
75 <p>Sets an internal environment variable, which is then available to Apache
76 HTTP Server modules, and passed on to CGI scripts and SSI pages.</p>
78 <example><title>Example</title>
79 <highlight language="config">
80 SetEnv SPECIAL_PATH /foo/bin
84 <note><p>The internal environment variables set by this directive are set
85 <em>after</em> most early request processing directives are run, such as access
86 control and URI-to-filename mapping. If the environment variable you're
87 setting is meant as input into this early phase of processing such as the
88 <directive module="mod_rewrite">RewriteRule</directive> directive, you should
89 instead set the environment variable with
90 <directive module="mod_setenvif"> SetEnvIf</directive>.</p>
94 <seealso><a href="../env.html">Environment Variables</a></seealso>
99 <description>Removes variables from the environment</description>
100 <syntax>UnsetEnv <var>env-variable</var> [<var>env-variable</var>]
102 <contextlist><context>server config</context><context>virtual host</context>
103 <context>directory</context><context>.htaccess</context></contextlist>
104 <override>FileInfo</override>
107 <p>Removes one or more internal environment variables from those passed
108 on to CGI scripts and SSI pages.</p>
110 <example><title>Example</title>
111 <highlight language="config">
112 UnsetEnv LD_LIBRARY_PATH