Raspberry PiでWebサーバーを構築中ですが、
apache2、CGI設定をしたところ、
参考にしたチュートリアル
http://qiita.com/aryoa/items/2c28b466e911a3dd101d
pythonが実行されず、
500Internal 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 at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error. More information about this error may be available in the server error log.
と、表示されてしまいます。
エラーログを確認すると、以下のように似たようなエラーログがでてきていました。
※(私のラズパイのユーザー名)は(ユーザー)、(私のラズパイのIPアドレス)は(IP)、と下記記入しています。
[Sat May 14 00:40:18.596773 2016] [cgi:error] [pid 21080:tid 1844442160] [client (IP):49769] AH01215: (8)Exec format error: exec of '/home/(ユーザー)/public_html/cgi-bin/test.py' failed, referer: http://(IP)/~(ユーザー)/cgi-bin/ [Sat May 14 00:40:18.599075 2016] [cgi:error] [pid 21080:tid 1844442160] [client (IP):49769] End of script output before headers: test.py, referer: http://(IP)/~(ユーザー)/cgi-bin/
ちなみにtest.pyのスクリプトは以下です。
#!/usr/bin/python print "Content-type: text/html" print print "<html>" print "<head>" print "<title>test</title>" print "</head>" print "<body>test it.</body>" print "</html>"
どなたか改善点わかるかたいらっしゃいますでしょうか。
ご教授いただけますと大変助かります。
回答2件
あなたの回答
tips
プレビュー