From: Joshua Slive Date: Sun, 20 Aug 2006 19:46:24 +0000 (+0000) Subject: My last effort was a little too succinct and not quite precise X-Git-Tag: 2.3.0~2151 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=53133772ac0baaf835eb73451f58d17632bfb19f;p=thirdparty%2Fapache%2Fhttpd.git 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/trunk@433021 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/docs/manual/mod/mod_alias.html.en b/docs/manual/mod/mod_alias.html.en index 948881a474c..099c8950594 100644 --- a/docs/manual/mod/mod_alias.html.en +++ b/docs/manual/mod/mod_alias.html.en @@ -366,15 +366,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 @@ -382,8 +382,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

diff --git a/docs/manual/mod/mod_alias.xml b/docs/manual/mod/mod_alias.xml index ddf82f807bf..db12c55f2f7 100644 --- a/docs/manual/mod/mod_alias.xml +++ b/docs/manual/mod/mod_alias.xml @@ -361,15 +361,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 @@ -380,8 +380,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