[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[plamo:21394] Apache2.0.48+perlCGIについて



このところ、雨の日が多いです。

OS Plamo3.3
Apache2.0.48ソースからコンパイル
Perl5.6.1 Plamo3.3パッケージ
CGIでアクセスカウンターを作ろうと思っています。
最終的には、htmlに組み込んで使おうとしています。
<!--#exec cmd="/usr/bin/perl ******.pl"-->
-----------------------------------------------------------------------
現在、以下では動作しています。
#! /usr/bin/perl

# カウントファイルの読み込み
open(IN, "<./count.dat");
$count = <IN>;
close(IN);

++$count;

# カウントファイルへの書き込み
open(OUT, ">./count.dat");
print OUT $count;
close(OUT);

# ヘッダ/html出力
print <<END;
Content-type: text/html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head><title>アクセスカウンタ</title></head>
<body>
<p>あなたは $count 番目の訪問者です。</p>
</body>
</html>
END
---------------------------------------------------------------
以下のようにすると、wazilla上でエラーとなります。
#! /usr/bin/perl

# カウントファイルの読み込み
open(IN, "<./count.dat");
eval{ flock(IN, 2); };
$count = <IN>;
close(IN);

++$count;

# カウントファイルへの書き込み
open(OUT, ">./count.dat");
print OUT $count;
close(OUT);

# ヘッダ/html出力
print "Content-type: text/html\n\n";

print "<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">\n";
print "<html>\n";
print "<head><title>アクセスカウンタ</title></head>\n";
print "<body>\n";
print "<p>あなたは $count 番目の訪問者です。</p>\n";
print "</body>\n";
print "</html>\n";
END

色々やってみましたが、エラーがでる原因を特定できません。
エラーは
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, aidatech@aidatech.org 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.
と出ます。httpd.conf等も眺めたり、検索をかけたりしていますが、
いまいち原因がわかりません。
---------------------------------------------------------------------
上も下もprint文の所は同じ意味な気がします。
print "<p>あなたは $count 番目の訪問者です。</p>\n";の
$countの付け方がおかしいのでしょうか?

どなたか解かる方おられましたら、御教授の程よろしくお願い致します。

竺原 

Follow-Ups
[plamo:21395] Re: Apache2.0.48+perlCGIについて, Koyama Mituru
[plamo:21397] Re: Apache2.0.48+perlCGIについて, Shun-ichi TAHARA (田原 俊一)

[検索ページ] [メール一覧]
Plamo ML 公開システム