2010-03-20 51 views
1

为什么cgi脚本必须留在cgi-bin文件夹中?为什么cgi脚本必须留在cgi-bin文件夹中?

在public_html文件夹和cgi-bin文件夹中插入python脚本(或php脚本或任何其他脚本)有什么区别?

我不明白: - \

+0

他们不这样,它取决于你的apache配置。 – skaffman 2010-03-20 13:42:47

回答

5

他们没有。唯一的限制是CGI脚本必须在deirectory具有

Options +ExecCGI 

指令接通,并且在默认的Apache配置只/ cgi-bin目录有这个选项。但是没有任何东西阻止你在其他目录中启用CGI。

有人认为将所有CGI脚本放在一个地方更安全。

0

它不一定要在cgi-bin中,但你必须指定在哪里!例如,我把我的主要www文件夹移到你的index.htm文件所在的位置。

#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> 
相关问题