【发布时间】:2011-05-28 23:01:15
【问题描述】:
Apache 登录模式调试:
[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 ''.
我的配置文件:
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 在没有数据连接(如 MySQLdb 或 sqlite3)的基本项目中工作正常。 我正在使用 CentOS 5 64 位、apache 2.x、mod_wsgi 3.2。 我认为这不是 Django 的问题,但我不知道。大家能解决吗?帮我。 谢谢! :)
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()
我在此链接中阅读了一些问题:http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions 但我仍然不明白解决方案。
【问题讨论】:
-
你能发布你的 django.wsgi 文件吗?
-
django.wsgi 文件已添加。我希望它能帮助你提出一些想法:(
-
我没有任何具体建议,但我发现此链接可能会有所帮助:htmlfixit.com/cgi-tutes/…
标签: django apache apache2 mod-wsgi centos