From faf86a24fdbe86e2b79ef2d6c582cbbe9e816816 Mon Sep 17 00:00:00 2001
From: Joshua Slive The Apache HTTP Server provides a mechanism for storing
information in named variables that are called environment
variables. This information can be used to control various
@@ -22,17 +22,17 @@
server itself runs, you must use the standard environment
manipulation mechanisms provided by your operating system
shell. The most basic way to set an environment variable in Apache
- is using the unconditional Apache HTTP Server Version 2.0
Environment Variables in Apache
+ -->Apache HTTP Server Version 2.0
Environment Variables in Apache
Setting Environment Variables
+ Setting Environment Variables
-
+ Related Modules mod_env
mod_rewrite
mod_setenvif
mod_unique_id
Related Directives BrowserMatch
BrowserMatchNoCase
PassEnv
RewriteRule
SetEnv
SetEnvIf
SetEnvIfNoCase
UnsetEnv
Related Modules mod_env
mod_rewrite
mod_setenvif
mod_unique_id
Related Directives BrowserMatch
BrowserMatchNoCase
PassEnv
RewriteRule
SetEnv
SetEnvIf
SetEnvIfNoCase
UnsetEnv
Basic Environment Manipulation
SetEnv
directive. Variables may also be passed from
+ is using the unconditional SetEnv
directive. Variables may also be passed from
the environment of the shell which started the server using the
- PassEnv
directive.PassEnv
directive.
RewriteRule
which uses the
+ is available through the mod_rewrite's RewriteRule
which uses the
[E=...]
option to set environment variables.
@@ -92,7 +92,7 @@
Related Modulesmod_access mod_cgi mod_headers mod_include mod_log_config mod_rewrite | Related DirectivesAllow CustomLog Deny Header LogFormat RewriteCond RewriteRule |
Related Modulesmod_access mod_cgi mod_ext_filter mod_headers mod_include mod_log_config mod_rewrite | Related DirectivesAllow CustomLog Deny ExtFilterDefine Header LogFormat RewriteCond RewriteRule |
Access to the server can be controlled based on the value of
environment variables using the allow from env=
and deny from env=
directives. In combination with
- SetEnvIf
, this
+ SetEnvIf
, this
allows for flexible control of access to the server based on
characteristics of the client. For example, you can use these
directives to deny access to a particular browser (User-Agent).
@@ -134,12 +134,12 @@
Environment variables can be logged in the access log using
- the LogFormat
+ the LogFormat
option %e
. In addition, the decision on whether
or not to log requests can be made based on the status of
environment variables using the conditional form of the
- CustomLog
- directive. In combination with SetEnvIf
this allows for flexible control of which
+ CustomLog
+ directive. In combination with SetEnvIf
this allows for flexible control of which
requests are logged. For example, you can choose not to log
requests for filenames ending in gif
, or you can
choose to only log requests from clients which are outside your
@@ -149,7 +149,7 @@
The Header
+
The Header
directive can use the presence or
absence of an environment variable to determine whether or not
a certain HTTP header will be placed in the response to the
@@ -158,11 +158,21 @@
request from the client.
External filters configured by mod_ext_filter
+ using the ExtFilterDefine
directive can
+ by activated conditional on an environment variable using the
+ disableenv=
and enableenv=
options.
The %{ENV:...}
form of TestString in
- the RewriteCond
+ the RewriteCond
allows mod_rewrite's rewrite
engine to make decisions conditional on environment variables.
Note that the variables accessible in mod_rewrite without the
@@ -177,9 +187,9 @@
mechanisms to modify the way Apache behaves when talking to
particular clients. To make these mechanisms as flexible as
possible, they are invoked by defining environment variables,
- typically with BrowserMatch
,
- though SetEnv
and
- PassEnv
could also be used,
+ typically with BrowserMatch
,
+ though SetEnv
and
+ PassEnv
could also be used,
for example.
When set to a value of "1", this variable disables the DEFLATE
+ output filter provided by mod_deflate
for
+ content-types other than text/html
.
This disables KeepAlive
when set.
This disables KeepAlive
when set.
Available in versions after 2.0.40
+ +When Apache issues a redirect in response to a client request, + the response includes some actual text to be displayed in case + the client can't (or doesn't) automatically follow the redirection. + Apache ordinarily labels this text according to the character set + which it uses, which is ISO-8859-1.
+However, if the redirection is to a page that uses a different + character set, some broken browser versions will try to use the + character set from the redirection text rather than the actual page. + This can result in Greek, for instance, being incorrectly rendered.
+Setting this environment variable causes Apache to omit the character + set for the redirection text, and these broken browsers will then correctly + use that of the destination page.
+ + +