CGIの設置ができない!Apacheの設定を調整してもうまく動かない問題

このQ&Aのポイント
  • Apacheのhttpd.confを設定して、aska.cgiという掲示板を動かそうとしているが、うまく動かない。
  • httpd.conf内のOptionにExec CGIを追記したが、Options ExecCGI is off in this directoryというエラーが表示される。
  • aska.cgiはC:/Program Files/Apache Group/Apache2/htdocs/aska/ディレクトリに入っている。
回答を見る
  • ベストアンサー

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/ に入っています。 よろしくお願いします

質問者が選んだベストアンサー

  • ベストアンサー
  • zitaku
  • ベストアンサー率100% (1/1)
回答No.1

こんにちわ まず、http://localhost/のアドレスでindex.htmlの ページが見れますか。確認してください。 askaのホルダーを作ってください。そこにファイルを 入れてください。そうすると、http://localhost/aska/aska.cgiのURLになります。 それと、ご存知でしょうが、ActivePerl 5.8.7を インストールずみですよね。 上記の確認をしてください。

kenkenkenken25
質問者

お礼

ご回答ありがとうございます! ActivePerlの存在を知りませんでした。インストールし、Perlのパスを設定しなおすと掲示板が表示されました。 ありがとうございました。 まだまだ知識不足でした。

関連するQ&A

  • 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と 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> どのあたりに問題点かあるのでしょうか?

  • 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の中身が見えないのかわかりません。 よろしくおねがいします。

  • apache でバイナリのCGIを動かすには

    apache でバイナリのCGIを動かすにはどうすればよいのでしょうか? (なお、プログラム自体に問題は決してありません。『HTTPD』を使うと問題なく動作します) OS:WIN98 C++バイナリのCGIを呼び出すと下記エラーとなります。 Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please .... the error. More ... log. - Apache/1.3.12 Server at http://127.0.0.2/ Port 80 最終アクセスログ 127.0.0.1 - - [12/Mar/2001:23:20:27 +0900] "GET /ab.cgi HTTP/1.1" 500 610 最終エラーログ [Mon Mar 12 23:20:25 2001] [error] [client 127.0.0.1] Premature end of script headers: e:/www.homepage/kokucho81/ab.cgi apache の httpd.conf と httpd.conf.default との比較 ** httpd.conf ServerName http://127.0.0.2/ ** httpd.conf.default #ServerName new.host.name ** httpd.conf DocumentRoot "E:/WWW.HOMEPAGE/KOKUCHO81" ** httpd.conf.default DocumentRoot "C:/Apache/htdocs" ** httpd.conf <Directory /> Options FollowSymLinks ExecCGI AllowOverride None ** httpd.conf.default <Directory /> Options FollowSymLinks AllowOverride None ** httpd.conf <Directory "E:/WWW.HOMEPAGE/KOKUCHO81"> ** httpd.conf.default <Directory "C:/Apache/htdocs"> ** httpd.conf Options Indexes FollowSymLinks ExecCGI ** httpd.conf.default Options Indexes FollowSymLinks MultiViews ** httpd.conf AddHandler cgi-script .cgi ** httpd.conf.default #AddHandler cgi-script .cgi そもそも、設定が足りてないんでしょうか? apacheを良く使う方、よろしくお願いします。m(_ _)m

  • ApacheでCGIが正常に動作しません。

    httpd.confの設定でPerl.exeの場所の指定は必要なのでしょうか? 以下の場所に設定を行うのかと思ったのですが、設定するとApache起動時にprogram filesがエラーになってしまいます。 ServerSignature On !g:/program files/apache group/apache/perl/bin/" 設定が必要であれば設定方法をお願いします。 httpd.confの設定に <Directory "G:/Program Files/Apache Group/Apache/cgi-bin"> AllowOverride None # Options None Options ExecCGI Order allow,deny Allow from all </Directory> は追加してあります。 現在、CGIの結果として #!/perl/bin/Perl.exe print "Content-type: text/html\n\n"; print "\n"; print " Hello! WORLD \n"; print "\n"; exit; のように表示されない命令も全て表示されます。 本当はHello!WORLDだけを表示したいのですが。

  • 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ファイルも表示できるように許可を 出したいのですが、どのように設定すればよろしいのでしょうか?

  • /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のアクセス制限について

    環境は windowsXPHome SP3 / Apache2.2 / ActivePerl5 / (MySQLを使う予定) です。 htdocs\index.html htdocs\ddd\aaa.cgi htdocs\ddd\bbb.cgi のようなディレクトリ構成で、httpd.confは、htdocs以下を公開する設定になっていて <Directory "D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\ddd"> AddHandler cgi-script .cgi Options +ExecCGI </Directory> を指定しました。 これを自宅サーバーとして公開する場合、外部からはindex.htmlにアクセスできるようにして、 aaa.cgiやbbb.cgiはindex.htmlからリンクやformのactionから呼び出されてからしか実行できない (直接cgiのurlを指定して開けない)ようにするにはどうすればいいでしょうか? よろしくお願いします。

    • ベストアンサー
    • CGI
  • 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
  • CGIの実行

    CGIを実行しようとしたら、下記のようなメッセージが出てしまいました。このDirectoryではダメって事なのでしょうか。 Options ExecCGI is off in this directory: C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/ruby.cgi CGIってCgi-Binの下って決まっているのでしょうか? どなたかご存知であれば教えてください。

    • 締切済み
    • CGI