<dd>This will only be set if the CGI script is subject to
authentication.</dd>
+
</dl>
+ <p>This module also leverages the core functions
+ <a href="https://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__SCRIPT.html#ga0e81f9571a8a73f5da0e89e1f46d34b1">ap_add_common_vars</a> and
+ <a href="https://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__SCRIPT.html#ga6b975cd7ff27a338cb8752381a4cc14f">ap_add_cgi_vars</a>
+ to add environment variables like:</p>
+ <dl>
+ <dt>DOCUMENT_ROOT</dt>
+
+ <dd>Set with the content of the related <code class="directive"><a href="../mod/core.html#documentroot">DocumentRoot</a></code> directive.</dd>
+
+ <dt>SERVER_NAME</dt>
+
+ <dd>The fully qualified domain name related to the request.</dd>
+
+ <dt>SERVER_ADDR</dt>
+
+ <dd>The IP address of the Virtual Host serving the request.</dd>
+
+ <dt>SERVER_ADMIN</dt>
+
+ <dd>Set with the content of the related <code class="directive"><a href="../mod/core.html#serveradmin">ServerAdmin</a></code> directive.</dd>
+ </dl>
+ <p>For an exhaustive list it is suggested to write a basic CGI script
+ that dumps all the environment variables passed by Apache in a convenient format.
+ </p>
</div><div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<div class="section">
<h2><a name="cgi-debug" id="cgi-debug">CGI Debugging</a></h2>
<dd>This will only be set if the CGI script is subject to
authentication.</dd>
+
</dl>
+ <p>This module also leverages the core functions
+ <a href="https://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__SCRIPT.html#ga0e81f9571a8a73f5da0e89e1f46d34b1">ap_add_common_vars</a> and
+ <a href="https://ci.apache.org/projects/httpd/trunk/doxygen/group__APACHE__CORE__SCRIPT.html#ga6b975cd7ff27a338cb8752381a4cc14f">ap_add_cgi_vars</a>
+ to add environment variables like:</p>
+ <dl>
+ <dt>DOCUMENT_ROOT</dt>
+
+ <dd>Set with the content of the related <directive module="core">DocumentRoot</directive> directive.</dd>
+
+ <dt>SERVER_NAME</dt>
+
+ <dd>The fully qualified domain name related to the request.</dd>
+
+ <dt>SERVER_ADDR</dt>
+
+ <dd>The IP address of the Virtual Host serving the request.</dd>
+
+ <dt>SERVER_ADMIN</dt>
+
+ <dd>Set with the content of the related <directive module="core">ServerAdmin</directive> directive.</dd>
+ </dl>
+ <p>For an exhaustive list it is suggested to write a basic CGI script
+ that dumps all the environment variables passed by Apache in a convenient format.
+ </p>
</section>
<section id="cgi-debug"><title>CGI Debugging</title>
</table>
<p>The <code class="directive">DeflateBufferSize</code> directive specifies
the size in bytes of the fragments that zlib should compress at one
- time.</p>
+ time. If the compressed response size is bigger than the one specified
+ by this directive then httpd will switch to chunked encoding
+ (HTTP header <code>Transfer-Encoding</code> set to <code>Chunked</code>), with the
+ side effect of not setting any <code>Content-Length</code> HTTP header. This is particularly
+ important when httpd works behind reverse caching proxies or when httpd is configured with
+ <code class="module"><a href="../mod/mod_cache.html">mod_cache</a></code> and <code class="module"><a href="../mod/mod_cache_disk.html">mod_cache_disk</a></code> because
+ HTTP responses without any <code>Content-Length</code> header might not be cached.
+ </p>
</div>
<div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
<usage>
<p>The <directive>DeflateBufferSize</directive> directive specifies
the size in bytes of the fragments that zlib should compress at one
- time.</p>
+ time. If the compressed response size is bigger than the one specified
+ by this directive then httpd will switch to chunked encoding
+ (HTTP header <code>Transfer-Encoding</code> set to <code>Chunked</code>), with the
+ side effect of not setting any <code>Content-Length</code> HTTP header. This is particularly
+ important when httpd works behind reverse caching proxies or when httpd is configured with
+ <module>mod_cache</module> and <module>mod_cache_disk</module> because
+ HTTP responses without any <code>Content-Length</code> header might not be cached.
+ </p>
</usage>
</directivesynopsis>
*
* Adapted by rst from original NCSA code by Rob McCool
*
- * Apache adds some new env vars; REDIRECT_URL and REDIRECT_QUERY_STRING for
- * custom error responses, and DOCUMENT_ROOT because we found it useful.
- * It also adds SERVER_ADMIN - useful for scripts to know who to mail when
- * they fail.
+ * This modules uses a httpd core function (ap_add_common_vars) to add some new env vars,
+ * like REDIRECT_URL and REDIRECT_QUERY_STRING for custom error responses and DOCUMENT_ROOT.
+ * It also adds SERVER_ADMIN - useful for scripts to know who to mail when they fail.
+ *
*/
#include "apr.h"
*
* Adapted by rst from original NCSA code by Rob McCool
*
- * Apache adds some new env vars; REDIRECT_URL and REDIRECT_QUERY_STRING for
- * custom error responses, and DOCUMENT_ROOT because we found it useful.
- * It also adds SERVER_ADMIN - useful for scripts to know who to mail when
- * they fail.
+ * This modules uses a httpd core function (ap_add_common_vars) to add some new env vars,
+ * like REDIRECT_URL and REDIRECT_QUERY_STRING for custom error responses and DOCUMENT_ROOT.
+ * It also adds SERVER_ADMIN - useful for scripts to know who to mail when they fail.
+ *
*/
#include "apr_lib.h"
return log_scripterror(r, conf, HTTP_NOT_FOUND, 0, APLOGNO(01266)
"AcceptPathInfo off disallows user's path");
}
-/*
+ /*
if (!ap_suexec_enabled) {
if (!ap_can_exec(&r->finfo))
return log_scripterror(r, conf, HTTP_FORBIDDEN, 0, APLOGNO(01267)
"file permissions deny server execution");
}
-*/
+ */
+
+ /*
+ * httpd core function used to add common environment variables like
+ * DOCUMENT_ROOT.
+ */
ap_add_common_vars(r);
ap_add_cgi_vars(r);
env = ap_create_environment(r->pool, r->subprocess_env);