1

Mac の Web サーバーで python cgi スクリプトを実行しようとしています。ファイル @ localhost/site.py にアクセスするたびに、403 禁止エラーが発生します。

Apache のエラー ログを見ていると、次のように表示されます。

[Mon Jun 11 09:52:42 2012] [error] [client ::1] Options ExecCGI is off in this directory: /Users/<username>/Sites/site.py

ドキュメント ルートが /Users//Sites になるように、httpd.conf ファイルを変更しました。

ユーザーの .conf ファイルには、次のものがあります。

<Directory "/Users/<username>/Sites/">
  Options All
  AllowOverride All
  Order allow,deny
  Allow from all
  AddHandler cgi-script .py
</Directory>

ユーザーの .conf ファイルですべてのオプションを許可しているのに、ExecCGI がオフになっていると表示されるのはなぜですか?

4

1 に答える 1

0

httpd.conf にスクリプト エイリアスを指定または追加する必要がある場合があります。

これは、Windowsでの私の外観です。

<IfModule alias_module>
    #other comments removed
    ScriptAlias /cgi-bin/ "C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/"

</IfModule>
于 2012-06-12T14:59:54.507 に答える