Python FastCGI、Apache、Django和500错误

Python FastCGI、Apache、Django和500错误,python,django,apache,fastcgi,Python,Django,Apache,Fastcgi,我在Apache和FastCGI中遇到500个内部错误。花了一整天的时间来寻找原因:-/ /etc/apache2/vhost.d/mysite.conf /home/me/web/mysite.fcgi /var/log/apache2/error\u log 执行.fcgi文件(该文件作为html页面工作,状态为“200 OK”,并按其应有的方式呈现): 看 感谢#django irc频道(特别是zk)的帮助 必须更改为(因为apache应该生成fcgi进程本身): 我以前看过这些链接

我在Apache和FastCGI中遇到500个内部错误。花了一整天的时间来寻找原因:-/

/etc/apache2/vhost.d/mysite.conf /home/me/web/mysite.fcgi /var/log/apache2/error\u log 执行.fcgi文件(该文件作为html页面工作,状态为“200 OK”,并按其应有的方式呈现):

感谢#django irc频道(特别是zk)的帮助

必须更改为(因为apache应该生成fcgi进程本身):


我以前看过这些链接,但它们不能帮助我解决问题/mysite.fcgi按原样呈现整个html页面。(我给出了上面的字符串状态:200 OK)。文件是可执行的,并且它本身可以工作。但是apache不想使用它(你在哪里修改这些我也有同样的错误
FastCGIExternalServer /home/me/web/mysite.fcgi -socket /home/me/web/mysite.sock
Listen 80
<VirtualHost *:80>
        ServerName os.me #That's my localhost machine
        DocumentRoot /home/me/web
        Alias /media/ /home/me/develop/projects/media

        <Directory "/home/me/web">
                AllowOverride All
                Allow from all
                Order allow,deny
        </Directory>

</VirtualHost>
Options +Indexes +FollowSymlinks
AddHandler fastcgi-script .fcgi

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ mysite.fcgi/$1 [QSA,L]
#!/usr/bin/python
import sys, os

os.chdir("/home/me/develop/projects/mysite")
os.environ['DJANGO_SETTINGS_MODULE'] = "mysite.settings"

from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded",daemonize="false")
...    
[Sat Aug 07 01:41:13 2010] [error] [client 127.0.0.1] (2)No such file or directory: FastCGI: failed to connect to server "/home/me/web/mysite.fcgi": connect() failed
[Sat Aug 07 01:41:13 2010] [error] [client 127.0.0.1] FastCGI: incomplete headers (0 bytes) received from server "/home/me/web/mysite.fcgi"
me@os ~/web $ python mysite.fcgi 
WSGIServer: missing FastCGI param REQUEST_METHOD required by WSGI!
WSGIServer: missing FastCGI param SERVER_NAME required by WSGI!
WSGIServer: missing FastCGI param SERVER_PORT required by WSGI!
WSGIServer: missing FastCGI param SERVER_PROTOCOL required by WSGI!
Status: 200 OK
Content-Type: text/html
...
FastCGIExternalServer /home/me/web/mysite.fcgi -socket /home/me/web/mysite.sock
FastCGIServer /home/me/web/mysite.fcgi -socket /home/me/web/mysite.sock