• 締切済み

CGIと permissionの問題

win2000のos上で,ApacheでCGIをローカルで試していますが, 下記のようなerrが出ます。 Forbidden You don't have permission to access /namazu.cgi on this server. --------------------------------------------------------------------------------Apache/1.3.19 Server at 127.0.0.1 Port 80 logを見ると,下記です。 [Sun Sep 16 17:22:04 2001] [error] [client 127.0.0.1] Options ExecCGI is off in this directory: c:/~nakai/namazu.cgi このdirの .htaccess は下記です。 AllowOverride Options Options +ExecCGI 一方,Apache の httpd.conf  #ScriptAlias /cgi-bin/ "C:/Program Files/Apache Group/Apache/cgi-bin/" ScriptAlias /cgi-bin/ "C:/~nakai/cgi-bin/" # # "C:/Program Files/Apache Group/Apache/cgi-bin" should be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # #<Directory "C:/Program Files/Apache Group/Apache/cgi-bin"> <Directory "C:/~nakai/cgi-bin/"> AllowOverride None Options None # Options ExecCGI Order allow,deny Allow from all SetHandler cgi-script </Directory> どのあたりに問題点かあるのでしょうか?

みんなの回答

  • selenity
  • ベストアンサー率41% (324/772)
回答No.2

私もApache for Win32は自信がないのですが、 httpd.confで <Directory "C:/~nakai/cgi-bin/"> AllowOverride None </Directory> としていると、(少なくともUNIX版では、、、) .htaccessは使えませんよ。 あと、.cgiファイルの拡張子の関連づけはできていますか? AddHandlerの設定はできていますか?

  • natural
  • ベストアンサー率37% (419/1115)
回答No.1

Windows系は自信がないのですが・・・。(^_^; 通常Unix系のサーバーではcgiファイルそのものに実行権を付与する必要があります。 namazu.cgiのパーミッションを御確認下さい。 それから、 <Directory "C:/~nakai/cgi-bin/"> AllowOverride None Options None # Options ExecCGI ですが、 <Directory "C:/~nakai/cgi-bin/"> AllowOverride None # Options None Options ExecCGI ではありませんか?

関連するQ&A

  • CGIの設置ができません。

    Apacheのhttpd.confを設定して、aska.cgiという掲示板を動かそうとしているのですが、うまく動きません。 色々調べた結果、httpd.conf内のOptionというところにExec CGIを追記すればいいとのことだったので、 <Directory "C:/Program Files/Apache Group/Apache2/htdocs"> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> としましたが、 Options ExecCGI is off in this directory: C:/Program Files/Apache Group/Apache2/htdocs/aska/aska.cgi, referer: http://localhost/aska/ とerror.logには表示されてしまいます。 ちなみにaska.cgiは C:/Program Files/Apache Group/Apache2/htdocs/aska/ に入っています。 よろしくお願いします

  • apacheのScriptAliasの記述について

    どなたか,ご教授いただければ幸いです。 WindowsXp Proでapacheを動かしています。次の設定で,cgiはうまく動作していました。 --- <IfModule alias_module> ScriptAlias /cgi-bin/ \"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/\" </IfModule> <Directory \"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin\"> AllowOverride None Options ExecCGI Order allow,deny Allow from all AddHandler image/gif .gif AddHandler image/jpeg .jpg </Directory> --- これに, http://www.miloweb.net/win/server/apache.html を参考にして,各ユーザーフォルダでcgiが実行できるようにしようと,次のようにしました。 --- <IfModule alias_module> ScriptAlias /cgi-bin/ \"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/\" ScriptAlias /cgi/ \"C:/www/users/*/cgi/\" </IfModule> <Directory \"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin\"> AllowOverride None Options ExecCGI Order allow,deny Allow from all AddHandler image/gif .gif AddHandler image/jpeg .jpg </Directory> <IfModule mod_userdir.c> UserDir \"C:/www/users/*/\" </IfModule> <Directory \"C:/www/users/*/cgi/\"> AllowOverride None Options ExecCGI Order allow,deny Allow from all AddHandler image/gif .gif AddHandler image/jpeg .jp </Directory> --- その結果, http://localhost/~user/ としてuserのホームページにアクセスできるようになったのですが, cgiについては, http://localhost/~user/cgi/・・・ としてもアクセスできません。どなたか原因をご教授いただけないでしょうか。 ScriptAlias /cgi-bin/ \"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/\" ScriptAlias /cgi/ \"C:/www/users/*/cgi/\" の行を入れ替えると,\"C:/Program Files/Apache Software Foundation/Apache2.2/cgi-bin/\"においてあるcgiが実行できなくなります。ScriptAliasは1行目しか有効でないようにも見えるのですが,上に書いた参考URLではできているようなので,戸惑っています。

  • cgi-binにアクセスできない

    apache初心者です。 Turbolinux6.0+apache1.3.12でHTTPサーバを試しているのですが、 cgi-binにあるファイルを見ようとするとHTTP 403エラーが出て表示できません。 属性とグループを色々変えてみたんですが、だめでした。 access.confで関係ありそうな所は <Directory /> Options None AllowOverride None order allow,deny allow from all </Directory> <Directory /home/httpd/html> Options Indexes Includes FollowSymLinks AllowOverride None order allow,deny allow from all </Directory> <Directory /home/httpd/cgi-bin> AllowOverride None Options FollowSymlinks ExecCGI order allow,deny allow from all </Directory> としていますが、なぜcgi-binの中身が見えないのかわかりません。 よろしくおねがいします。

  • CGIが動きません!!

    CGIが動きません。htmlを表示できる状態です。 エラーログには「 couldn't spawn child process: g:/program files/apache group/apache/cgi-bin/hello.cgi」と表示されています。 どうしたら良いのでしょうか? windouw NT 4.0 + Apache version 1.3.19 + Active Perl version 5.005_03 です。 perlの構文チェックは問題なしです。 httpd.confの設定は下記のようにしました。 1.AddHandler cgi-script .cgi を追加。 2.オプションの設定にExecCGIを追加。 <Directory "G:/Program Files/Apache Group/Apache/cgi-bin"> AllowOverride None # Options None Options ExecCGI Order allow,deny Allow from all </Directory>

  • cgi-binディレクトリ内のhtmlを有効にしたい

    度々お騒がせしております。 本日は、Apacheの設定について 伺いたく投稿させていただきました。 apacheの設定を終え、 一通り動作するようにできたのですが、 cgi-binディレクトリに置いたhtmlや jpg,gifといったcgi以外のファイルが 表示されません。 httpd.confによる cgi-binディレクトリの設定でどうにかなるものと思い、 色々調べてみたのですが、 いまいち設定方法がわかりません。 以下、私の環境です。 Apacche 1.3.20 htmlディレクトリ /var/www/html/ (775) cgi-binディレクトリ /var/www/html/cgi-bin/ (775) 現在のcgi-binディレクトリの設定 ScriptAlias /cgi-bin/ "/var/www/html/cgi-bin/" <Directory "/var/www/cgi-bin"> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> 以上、どうかよろしくお願いいたします。

  • ApacheのScriptAliasについて

    ScriptAlias /cgi-bin/ /var/www/cgi-bin/ ScriptAlias /cgi-bin/ /home/*/public_html/cgi-bin/ # # "/usr/lib/cgi-bin" could be changed to whatever your ScriptAliased # CGI directory exists, if you have that configured. # <Directory /var/www/cgi-bin/> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> <Directory /home/*/public_html/cgi-bin> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> 何がやりたいかと言うと複数箇所でcgi-binを作ってCGIをうごかせるようにしたいのですが、ScriptAliasは複数指定ってできるのでしょうか? できなければ何かうまい方法はないでしょうか?よろしくお願いしますm(_ _)m

  • Apacheでcgiを動かす場合のファイルの場所は‥。

    いつもお世話になってます。  今、Apache2を導入して、サーバを構築しているのですが、cgiファイルをおく場所で困っています。  デフォルトでApacheをインストールすると、*:\Program Files\apach group\apach2\cgi-bin 配下に、cgiファイルをおくように設定することになりますよね。  そこにおけばcgiは動きましたが、出来れば、 任意の場所にcgiファイルをおいて動かしたいと思いました。 httpd.conf内の ScriptAlias /cgi-bin/ "E:/Program Files/Apache Group/Apache2/cgi-bin" や、 <Directory "E:/Program Files/Apache Group/Apache2/cgi-bin"> AllowOverride None Options None Order allow,deny Allow from all の部分を任意の場所に変えたりするのですが、それだとcgiファイルはただ単にテキストで表示されてしまうだけでした。  あきらめるしかないのでしょうか。  初歩的な質問かもしれませんが、FAQ等を探しても見つからなかったので質問させて頂きました。 どなたかご教授下さい。 よろしくお願い致します。

    • ベストアンサー
    • CGI
  • apacheとCGIの設定(httpd.conf)について

    Apache/1.3.26を使用しています。 CGIの定義の中に Alias /cgi-bin/ /usr/lib/cgi-bin <Directory /usr/lib/cgi-bin/> AllowOverride None Options ExecCGI Order allow,deny Allow from all </Directory> があるのですがこれは何を定義しているのでしょうか? また、ある指定のフォルダ /var/www/cgi-bin だけ CGI設置可能にするにはどうすればよいでしょうか?

  • /cgi-bin/のファイル読み出し

    WindowsXPでApacheをlocalhostで使用しています。 httpd.confを以下のように設定してcgiは問題なく作動していますが、/cgi-bin/に置いた画像やhtmlが読み出せません (すなわちhttp://localhost/cgi-bin/にアクセス出来ず、Forbiddenのエラーが出ます) 今は仕方なく、cgiで使用するファイルや画像をDocumentRoot配下に置いていますが、/cgi-bin/配下のファイルを読み出すhttpd.confの設定を教えて下さい。 DocumentRoot "F:/" <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory "F:/"> AllowOverride None Order allow,deny Allow from all </Directory> <IfModule mod_alias.c> ScriptAlias /cgi-bin/ "F:/cgi-bin/" <Directory "F:/cgi-bin"> AllowOverride None Options ExecCGI MultiViews Order allow,deny Allow from all </Directory> </IfModule>

  • cgi-bin配下のファイルに読込許可を!

    最近、Apache2を使い始めたばかりで設定がよくわかりません。 Apacheの設定ファイルで、httpd.confというファイルがありますが、その中で、 ScriptAlias /cgi-bin/ "C:/Apache2/htdocs/cgi-bin/" <Directory "C:/Apache2/htdocs/cgi-bin"> AllowOverride None Options All Order allow,deny Allow from all </Directory> と記述して"C:/Apache2/htdocs/cgi-bin"配下にあるファイルに CGIが動作するように許可しました。 しかし、これだと逆に"C:/Apache2/htdocs/cgi-bin"配下にある HTMLファイル(.htm等)が読み込めなくなってしまいます。 cgi-bin配下にあるhtmlファイルも表示できるように許可を 出したいのですが、どのように設定すればよろしいのでしょうか?

専門家に質問してみよう