Django, apache, mod_wsgi - Fehler: Vorzeitiges Ende der Skript-Header

Apache-logs im debug-Modus:

[Tue Dec 21 11:36:33 2010] [info] [client 1.53.149.114] mod_wsgi (pid=24831, process='mysite', application='mysite.com|'): Loading WSGI script '/home/anhtran/webapps/mysite.com/django.wsgi'.
[Tue Dec 21 11:36:33 2010] [error] [client 1.53.149.114] Premature end of script headers: django.wsgi
[Tue Dec 21 11:36:33 2010] [notice] child pid 24831 exit signal Segmentation fault (11)
[Tue Dec 21 11:36:33 2010] [info] mod_wsgi (pid=24980): Attach interpreter ''.

Meine conf-Datei:

WSGISocketPrefix /tmp/wsgi

<VirtualHost *:80>
   ServerName mysite.com
   ServerAlias www.mysite.com
   ServerAdmin admin@mysite.com

   DocumentRoot /home/anhtran/webapps/mysite.com/public_html

   WSGIDaemonProcess mysite processes=5 threads=25
   WSGIProcessGroup mysite
   WSGIScriptAlias //home/anhtran/webapps/mysite.com/django.wsgi

   LogLevel debug

   <Directory /home/anhtran/webapps/mysite.com/mysite>
      Order allow,deny
      Allow from all
   </Directory>

</VirtualHost>

Django funktioniert gut in einem basic-Projekt ohne eine Datenverbindung wie MySQLdb oder sqlite3.
Ich bin mit CentOS 5 64 bit, apache 2.x, mod_wsgi 3.2.
Ich denke, das ist kein problem, Django, aber ich habe keine Ahnung. Jeder kann es beheben? Helfen Sie mir.
Danke! 🙂

django.wsgi

#!/usr/local/bin/python
import os, site, sys

# add the virtual environment path
site.addsitedir('/home/anhtran/webapps/mysite.com/env/lib/python2.6/site-packages')
site.addsitedir('/home/anhtran/webapps/mysite.com/mysite')
site.addsitedir('/home/anhtran/webapps/mysite.com')

# fix markdown.py (and potentially others) using stdout
sys.stdout = sys.stderr

#Calculate the path based on the location of the WSGI script.
project = os.path.dirname(__file__)
workspace = os.path.dirname(project)
sys.path.append(workspace)

os.environ['PYTHON_EGG_CACHE'] = '/home/anhtran/webapps/mysite.com/.python-eggs'
os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'
from django.core.handlers.wsgi import WSGIHandler
application = WSGIHandler()

Ich gelesen habe, einige Fragen in diesem link: http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions
Aber ich verstehe immer noch nicht die Lösungen.

InformationsquelleAutor der Frage anhtran | 2010-12-21

Schreibe einen Kommentar