为什么 cgi 脚本必须留在 cgi-bin 文件夹中?
在 public_html 文件夹和 cgi-bin 文件夹中插入 python 脚本(或 php 脚本或任何其他脚本)有什么区别?
我不明白 :-\
他们没有。唯一的限制是 CGI 脚本必须在目录中
Options +ExecCGI
指令打开,并且在默认的 Apache 配置中只有 /cgi-bin 目录有这个选项。但是没有什么能阻止您在其他目录中启用 CGI。
有些人认为将所有 CGI 脚本放在一个地方更安全。
它不必在 cgi-bin 中,但你必须指定在哪里!例如,我将我的移动到您的 index.htm 文件所在的主要 www 文件夹。
#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>