GNU/Linux Debian Stable マシンで実行されている apache2 サーバーで Rebol CGI スクリプトを実行しようとしています。
これが私のRebolスクリプトです:
# pierre@autan: ~$ < 2013_05_29__17_35_22 >
dog /usr/lib/cgi-bin/test.cgi
#!/usr/bin/rebol -cs
REBOL []
print "Content-type: text/html^/"
print "coucou! (signé: Rebol)"
失敗します:
# pierre@autan: ~$ < 2013_05_29__17_21_18 >
lynx http://127.0.0.1/cgi-bin/test.cgi
戻り値:
500 Internal Server Error
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator, webmaster@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/2.2.22 (Debian) Server at 127.0.0.1 Port 80
ログには次のように記載されています。
###ROOT### < 29/05/2013 17:02:45 > root@autan:/#
tail -1 /var/log/apache2/error.log
[Thu May 30 15:04:23 2013] [error] [client 127.0.0.1] Premature end of script headers: test.cgi
ドキュメント ( http://httpd.apache.org/docs/trunk/fr/howto/cgi.html ) を読んだ後、この Perl スクリプトを正常に実行できます。
# pierre@autan: ~$ < 2013_05_29__17_35_22 >
dog /usr/lib/cgi-bin/testpl.cgi
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "coucou! (signé: Perle)";
さて、Rebol スクリプトの何が問題なのか気になります...
私はいくつかのことをチェックしました:
Rebol 実行可能ファイルへのパスは正しいです。インタープリターを明示的に呼び出すことなく、シェルから直接スクリプトを起動できます。
# pierre@autan: ~$ < 2013_05_30__14_07_36 >
/usr/lib/cgi-bin/test.cgi
Content-type: text/html
coucou! (signé: Rebol)
実行権は私には問題ないように思えます。両方のファイルで同じです。
# pierre@autan: ~$ < 2013_05_29__17_35_22 >
ll /usr/lib/cgi-bin/test*.cgi
-rwxr-xr-x 1 root root 97 mai 29 09:28 /usr/lib/cgi-bin/test.cgi
-rwxr-xr-x 1 root root 87 mai 29 09:26 /usr/lib/cgi-bin/testpl.cgi
Rebol実行可能ファイルの実行権は私には問題ないようです:
# pierre@autan: ~$ < 2013_05_30__14_07_36 >
ll /usr/bin/rebol
-rwxr-xr-x 1 root root 1215652 déc. 30 22:50 /usr/bin/rebol
REBOL/View 2.7.8.4.2 2-Jan-2011 を使用しています。
変更した apache2 構成ファイルは次のとおりです。
###ROOT### < 29/05/2013 17:20:12 > root@autan:/etc/apache2/conf.d#
dog /etc/apache2/conf.d/httpd.conf
#ScriptAlias magic/cgi-bin/ /var/www/magic/cgi-bin/
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
AddHandler cgi-script .cgi
Options
AddHandler magic .rhtml
Action magic /cgi-bin/magic.cgi
<Directory "/var/www/magic/cgi-bin/">
AllowOverride None
Options ExecCGI MultiViews SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
<Directory "/usr/lib/cgi-bin/">
AllowOverride None
Options ExecCGI MultiViews SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
私はApacheの構成にまったく慣れていないことに注意してください。
何か案が?