一个问题搞了我三天,现在虽然能够运行了,但我还是不知道为什么。
一、原先运行很好,但最近总是显示500错误,查看error_logs,
[Sun Aug 12 01:28:16 2012] [error] [client 219.148.137.20] suexec policy violation: see suexec log for more details
[Sun Aug 12 01:28:16 2012] [error] [client 219.148.137.20] Premature end of script headers: brainico.cgi
查看html目录,权限是777,经godaddy指点,apache将777认为不安全,于是将777改为755,则出现二的问题。
二、
.htaccess文件
AddHandler fcgi-script .fcgi
AddHandler cgi-script cgi
Options ExecCGI
Options +FollowSymLinks
Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteRule ^site_static/(.*)$ brainico/static/$1 [L]
RewriteRule ^brainico/static/(.*)$ - [L]
RewriteRule ^site_media/(.*)$ brainico/media/$1 [L]
RewriteRule ^brainico/media/(.*)$ - [L]
RewriteRule ^admin_media/(.*)$ - [L]
RewriteCond %{REQUEST_URI} !(brainico.cgi)
RewriteRule (.*) /brainico.cgi/$1 [L]
当最后一句去掉/$1时,能正常显示,但只显示首页,如果加上,则500错误,error_logs为
[Sun Aug 12 01:28:16 2012] [error] [client 219.148.137.20] suexec policy violation: see suexec log for more details
[Sun Aug 12 01:28:16 2012] [error] [client 219.148.137.20] Premature end of script headers: brainico.cgi
不懂啊不懂啊,cgi不能传递参数吗,查了很多资料,也不明白,难道也是权限的问题,但我将所有文件都改为755,也没效果。gody!
试验时将
RewriteCond %{REQUEST_URI} !(brainico.cgi)
RewriteRule (.*) /brainico.cgi/$1 [L]
改为
RewriteCond %{REQUEST_URI} !(brainico.py)
RewriteRule (.*) /brainico.py/$1 [L]
解决。
但我还是不明白为什么。希望哪位大牛看到此篇博客不吝赐教。