From 4377b1f9b2a26cad83c568d9c0ce1bec179fcf2c Mon Sep 17 00:00:00 2001 From: Luca Toscano Date: Mon, 1 Feb 2016 22:33:57 +0000 Subject: [PATCH] Backporting documentation changes from trunk related to mod_cgi/cgid and mod_deflate git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1728020 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_cgi.html.en | 25 +++++++++++++++++++++++++ docs/manual/mod/mod_cgi.xml | 25 +++++++++++++++++++++++++ docs/manual/mod/mod_deflate.html.en | 9 ++++++++- docs/manual/mod/mod_deflate.xml | 9 ++++++++- modules/generators/mod_cgi.c | 8 ++++---- modules/generators/mod_cgid.c | 17 +++++++++++------ 6 files changed, 81 insertions(+), 12 deletions(-) diff --git a/docs/manual/mod/mod_cgi.html.en b/docs/manual/mod/mod_cgi.html.en index 7d4aff7b3c..e7484bb595 100644 --- a/docs/manual/mod/mod_cgi.html.en +++ b/docs/manual/mod/mod_cgi.html.en @@ -115,7 +115,32 @@
This will only be set if the CGI script is subject to authentication.
+ +

This module also leverages the core functions + ap_add_common_vars and + ap_add_cgi_vars + to add environment variables like:

+
+
DOCUMENT_ROOT
+ +
Set with the content of the related DocumentRoot directive.
+ +
SERVER_NAME
+ +
The fully qualified domain name related to the request.
+ +
SERVER_ADDR
+ +
The IP address of the Virtual Host serving the request.
+ +
SERVER_ADMIN
+ +
Set with the content of the related ServerAdmin directive.
+
+

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. +

top

CGI Debugging

diff --git a/docs/manual/mod/mod_cgi.xml b/docs/manual/mod/mod_cgi.xml index b459c48bb6..aa7dd93943 100644 --- a/docs/manual/mod/mod_cgi.xml +++ b/docs/manual/mod/mod_cgi.xml @@ -100,7 +100,32 @@
This will only be set if the CGI script is subject to authentication.
+ +

This module also leverages the core functions + ap_add_common_vars and + ap_add_cgi_vars + to add environment variables like:

+
+
DOCUMENT_ROOT
+ +
Set with the content of the related DocumentRoot directive.
+ +
SERVER_NAME
+ +
The fully qualified domain name related to the request.
+ +
SERVER_ADDR
+ +
The IP address of the Virtual Host serving the request.
+ +
SERVER_ADMIN
+ +
Set with the content of the related ServerAdmin directive.
+
+

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. +

CGI Debugging diff --git a/docs/manual/mod/mod_deflate.html.en b/docs/manual/mod/mod_deflate.html.en index cfbbbc7776..48311d91ce 100644 --- a/docs/manual/mod/mod_deflate.html.en +++ b/docs/manual/mod/mod_deflate.html.en @@ -252,7 +252,14 @@ content

The DeflateBufferSize directive specifies the size in bytes of the fragments that zlib should compress at one - time.

+ time. If the compressed response size is bigger than the one specified + by this directive then httpd will switch to chunked encoding + (HTTP header Transfer-Encoding set to Chunked), with the + side effect of not setting any Content-Length HTTP header. This is particularly + important when httpd works behind reverse caching proxies or when httpd is configured with + mod_cache and mod_cache_disk because + HTTP responses without any Content-Length header might not be cached. +

top
diff --git a/docs/manual/mod/mod_deflate.xml b/docs/manual/mod/mod_deflate.xml index 8bec31c758..31647d49ec 100644 --- a/docs/manual/mod/mod_deflate.xml +++ b/docs/manual/mod/mod_deflate.xml @@ -296,7 +296,14 @@ CustomLog "logs/deflate_log" deflate

The DeflateBufferSize directive specifies the size in bytes of the fragments that zlib should compress at one - time.

+ time. If the compressed response size is bigger than the one specified + by this directive then httpd will switch to chunked encoding + (HTTP header Transfer-Encoding set to Chunked), with the + side effect of not setting any Content-Length HTTP header. This is particularly + important when httpd works behind reverse caching proxies or when httpd is configured with + mod_cache and mod_cache_disk because + HTTP responses without any Content-Length header might not be cached. +

diff --git a/modules/generators/mod_cgi.c b/modules/generators/mod_cgi.c index ffbef7ebfa..00bd02b5a4 100644 --- a/modules/generators/mod_cgi.c +++ b/modules/generators/mod_cgi.c @@ -21,10 +21,10 @@ * * 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" diff --git a/modules/generators/mod_cgid.c b/modules/generators/mod_cgid.c index 32a8d3351b..857e137b88 100644 --- a/modules/generators/mod_cgid.c +++ b/modules/generators/mod_cgid.c @@ -21,10 +21,10 @@ * * 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" @@ -1457,13 +1457,18 @@ static int cgid_handler(request_rec *r) 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); -- 2.40.0