开发者

Why cgi scripts have to stay in cgi-bin folder?

开发者 https://www.devze.com 2022-12-23 19:29 出处:网络
Why cgi scripts have to stay in cgi-bin folder ? What is the difference from insert python script ( or php script or any other script ) in public_html folder and in cgi-bin folder ?

Why cgi scripts have to stay in cgi-bin folder ?

What is the difference from insert python script ( or php script or any other script ) in public_html folder and in cgi-bin folder ?

I don't un开发者_C百科derstand :-\


They don't have. The only restriction is that CGI scripts have to be in deirectory which has

Options +ExecCGI

directive switched on, and in default Apache configuration only /cgi-bin directory has this option on. But nothing prevents you from enabling CGI in other directories.

Some believe that putting all CGI scripts in one place is more secure.


It does not have to be in the cgi-bin, but you have to specify where! For example I moved mine to my main www folder where your index.htm file would be.

#ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"  <-This was the original
ScriptAlias /html/ "/var/www/html"
#
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
# CGI directory exists, if you have that configured.
#Directory below used to be /var/www/cgi-bin
<Directory "/var/www/html">
    AllowOverride None
    Options ExecCGI <-this line used top be Options None
    Order allow,deny
    Allow from all
</Directory>
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号