Linux で自宅サーバ [ Home Server Techncial ]

>>トップページに戻る

BBS 過去ログ No.0012に戻る

タイトル: CGIを使えるように設定しておりますが?
記事No: 3842
投稿日: 2005/09/02(Fri) 22:23
投稿者: おとちゃん   <npo_suport@yahoo.co.jp>
Vine Linux3.1でCGIを使えるように設定しております。
次の設定手順ではCGIは上手く作動しました。
1.CGI実行許可の設定
「/etc/httpd/conf/httpd.conf」の設定内容

 AddHandler cgi-script .cgi

 ScriptAlias /cgi-bin/ /home/httpd/cgi-bin/

 <Directory /home/httpd/cgi-bin>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
 </Directory>
2.CGIスクリプト「test.cgi」の作成 以下の内容
  #!/usr/bin/perl
  print "Content-type: text/html\n\n";
  print "<body>\n";
  print "test\n";
  print "</body>\n";
3.「home/httpd/cgi-bin/」ディレクトリ内に「test.cgi」を保存
4.パーミッションの設定
  cgi-bin:775 test.cgi:755
5.実行
  ブラウザのアドレス欄に「http://×××/cgi-bin/test.cgi」と入力
  画面に「test」と表示される。→成功

次の設定ではCGIは作動しなくて、次のエラーがでました。
1.CGI実行許可の設定
「/etc/httpd/conf/httpd.conf」の設定内容

 AddHandler cgi-script .cgi

 ScriptAlias /html/ /home/httpd/html/

 <Directory /home/httpd/html>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
 </Directory>
2.「home/httpd/html/」ディレクトリ内に「test.cgi」を保存
3.パーミッションの設定
  html:775 test.cgi:755
4.実行
  ブラウザのアドレス欄に「http://×××/test.cgi」と入力
  以下のエラーメッセージが表示された。
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
--------------------------------------------------------------------------------
Apache/1.3.33 Server at localhost.localdomain Port 80

1.何が原因でしょうか?
2.どのようにすれば宜しいのでしょうか?
宜しくお願い致します。

タイトル: Re: 前のは解決したの?
記事No: 3843
投稿日: 2005/09/03(Sat) 07:36
投稿者: Pokari
Webサーバー構築中とお見受けしますが、前の疑問は解決したのですか?
ひとつひとつ確実に解決していかないと訳がわからなくなりますよ。

タイトル: Re^2: 前のは解決したの?
記事No: 3844
投稿日: 2005/09/03(Sat) 07:40
投稿者: おとちゃん   <npo_suport@yahoo.co.jp>
> Webサーバー構築中とお見受けしますが、前の疑問は解決したのですか?
> ひとつひとつ確実に解決していかないと訳がわからなくなりますよ。
ご心配頂き感謝します。
ひとつひとつづつですが、なんとか解決しながらやっております。
今回の場合は、やはり
/home/httpd/cgi-bin のディレクトリの中でCGIを作動させたほうが宜しいのでしょうか?
宜しくお願い致します。

タイトル: Re^3: 別々で
記事No: 3845
投稿日: 2005/09/03(Sat) 09:18
投稿者: Pokari
 解決したら 解決のコメントが欲しいですね 他の閲覧者のためにも
> /home/httpd/cgi-bin のディレクトリの中でCGIを作動させたほうが宜しいのでしょうか?

自分は別の方が良いと思います。
しかし、スプリクトによってはそうもいかない物もありますので
htmの中でcgi動作じゃなく cgiの中でhtmを動作させる 逆の発想で対処できます。
方法は cgi デレクトリ指定のすぐ後に
AddHandler text/html .html .htm .text
を追記してやります。
あなたの場合は
 <Directory /home/httpd/cgi-bin>
AllowOverride None
Options ExecCGI
Order allow,deny
Allow from all
 </Directory>
AddHandler text/html .html .htm .text
ですね。

タイトル: Re^3: 前のは解決したの?
記事No: 3853
投稿日: 2005/09/09(Fri) 16:06
投稿者: おとちゃん   <npo_suport@yahoo.co.jp>
この件は解決いたしました。
有難う御座いました。

▲ページの最上部に戻る

Copyright©2003 Home Server Technical. All Right Reserved.
webmaster@miloweb.net