From: Joshua Slive Date: Sun, 20 Aug 2006 19:47:19 +0000 (+0000) Subject: Backport: X-Git-Tag: 2.0.60~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c466f3f5411180054ffe6daa419127ba13e5476a;p=thirdparty%2Fapache%2Fhttpd.git Backport: My last effort was a little too succinct and not quite precise enough. Try being more explicit. This does leave the danger that people will clip the example as the proper way to do things, when they should be reading on to the example. The example is only correct when used in conjunction with Alias. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.0.x@433023 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_alias.html.en b/docs/manual/mod/mod_alias.html.en index 9d65d753bee..bf7a2903665 100644 --- a/docs/manual/mod/mod_alias.html.en +++ b/docs/manual/mod/mod_alias.html.en @@ -355,15 +355,15 @@ target as a CGI script is essentially equivalent to:

Alias /cgi-bin/ /web/cgi-bin/
- <Directory /web/cgi-bin >
+ <Location /cgi-bin >
SetHandler cgi-script
Options +ExecCGI
- </Directory> + </Location>

-
It is safer to avoid placing CGI scripts under the +
It is safer to avoid placing CGI scripts under the DocumentRoot in order to avoid accidentally revealing their source code if the configuration is ever changed. The @@ -371,8 +371,20 @@ target as a CGI script URL and designating CGI scripts at the same time. If you do choose to place your CGI scripts in a directory already accessible from the web, do not use - ScriptAlias. Instead, use <Directory>, SetHandler, and Options as shown in the second example - above.
+ ScriptAlias. Instead, use <Directory>, SetHandler, and Options as in: +

+ <Directory /usr/local/apache2/htdocs/cgi-bin >
+ + SetHandler cgi-script
+ Options ExecCGI
+
+ </Directory> +

+ This is necessary since multiple URL-paths can map + to the same filesystem location, potentially bypassing the + ScriptAlias and revealing the source code + of the CGI scripts if they are not restricted by a + Directory section.

See also

@@ -412,4 +424,4 @@ and designates the target as a CGI script - \ No newline at end of file + diff --git a/docs/manual/mod/mod_alias.xml b/docs/manual/mod/mod_alias.xml index 4bc5320416e..f4731c9f9ad 100644 --- a/docs/manual/mod/mod_alias.xml +++ b/docs/manual/mod/mod_alias.xml @@ -348,15 +348,15 @@ target as a CGI script is essentially equivalent to:

Alias /cgi-bin/ /web/cgi-bin/
- <Directory /web/cgi-bin >
+ <Location /cgi-bin >
SetHandler cgi-script
Options +ExecCGI
- </Directory> + </Location>
- It is safer to avoid placing CGI scripts under the + It is safer to avoid placing CGI scripts under the DocumentRoot in order to avoid accidentally revealing their source code if the configuration is ever changed. The @@ -367,8 +367,20 @@ target as a CGI script ScriptAlias. Instead, use Directory, SetHandler, and Options as shown in the second example - above. + module="core">Options as in: + + <Directory /usr/local/apache2/htdocs/cgi-bin >
+ + SetHandler cgi-script
+ Options ExecCGI
+
+ </Directory> +
+ This is necessary since multiple URL-paths can map + to the same filesystem location, potentially bypassing the + ScriptAlias and revealing the source code + of the CGI scripts if they are not restricted by a + Directory section.
CGI Tutorial