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 ''.
我的conf文件:
WSGISocketPrefix /tmp/wsgi
<VirtualHost *:80>
ServerName mysite.com
ServerAlias www.mysite.com
ServerAdmin [email protected] /cdn-cgi/l/email-protection
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 http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions但我仍然不明白解决方案。
守护进程崩溃了。请参阅 mod_wsgi 常见问题解答中有关导致崩溃的原因的评论:
http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions http://code.google.com/p/modwsgi/wiki/FrequentlyAskedQuestions
并点击那里的链接。
最终原因可能有很多,包括同时加载不兼容的 mod_python、使用不与子解释器一起使用的 Python C 扩展模块、Apache 和/或 PHP 中的扩展模块使用的共享库版本不兼容等。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)