1

なぜcgiスクリプトはcgi-binフォルダに留まらなければならないのですか?

public_htmlフォルダーおよびcgi-binフォルダーにPythonスクリプト(またはphpスクリプトまたはその他のスクリプト)を挿入することとの違いは何ですか?

理解できない :-\

4

2 に答える 2

5

彼らは持っていません。唯一の制限は、CGIスクリプトがdeirectoryにある必要があるということです。

Options +ExecCGI

ディレクティブがオンになり、デフォルトのApache構成では、/cgi-binディレクトリのみがこのオプションをオンにします。ただし、他のディレクトリでCGIを有効にすることを妨げるものは何もありません。

すべてのCGIスクリプトを1か所に配置する方が安全であると考える人もいます。

于 2010-03-20T13:41:47.937 に答える
0

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>
于 2012-01-18T23:27:31.240 に答える