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

发布于 2024-08-26 02:48:18 字数 125 浏览 7 评论 0原文

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

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

我不明白 :-\

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 understand :-\

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

来日方长 2024-09-02 02:48:18

他们没有。唯一的限制是 CGI 脚本必须位于已

Options +ExecCGI

打开指令的目录中,并且在默认 Apache 配置中,只有 /cgi-bin 目录打开了此选项。但没有什么可以阻止您在其他目录中启用 CGI。

有些人认为将所有 CGI 脚本放在一处更安全。

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.

清醇 2024-09-02 02:48:18

它不必位于 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>

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>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文