有:
1)ubuntu 11.10
2)cherokee(https://launchpad.net/~cherokee-webserver/+archive/ppa)(版本1.2.101)
安装如下:
sudo apt-get install cherokee
sudo apt-get install libcherokee-mod-rrd
sudo apt-get install cherokee-doc
3)uwsgi(版本0.9.8.1-1)安装如下:
sudo apt-get install uwsgi uwsgi-plugin-python
4) Django 1.3.1 (sudo pip install django)
运行:
1)将example.com添加到主机文件(example.com 127.0.0.1)
2)创建uwsgi.xml
<uwsgi>
<pythonpath>/var/www/vtest/</pythonpath>
<pythonpath>/var/www/</pythonpath>
<app mountpoint="/">
<script>django_wsgi</script>
</app>
</uwsgi>
和 django_wsgi.py
import os
import django.core.handlers.wsgi
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
application = django.core.handlers.wsgi.WSGIHandler()
3)
/var/www$ sudo django-admin.py startproject vtest
/var/www$ sudo chown -R www-data:www-data vtest/
将文件 uwsgi.xml、django_wsgi.py 移动到 /var/www/vtest 和 chmod +x django_wsgi.py
4) 在 cherokee-admin vservers -> 添加 -> 平台 -> uwsgi 选择 uwsgi.xml 文档根目录 /var /www/vtest 在控制台中:
ps -A | grep uwsgi
6352 ? 00:00:00 uwsgi
如果在控制台中运行 uwsgi 命令:
/var/www/vtest$ /usr/bin/uwsgi -s 127.0.0.1:59238 -x /var/www/vtest/uwsgi.xml
tmp = /
[uWSGI] parsing config file /var/www/vtest/uwsgi.xml
*** Starting uWSGI 0.9.8.1-debian (32bit) on [Sun Jan 15 13:28:42 2012] ***
compiled with version: 4.6.1 on 28 June 2011 10:38:32
*** WARNING: you are running uWSGI without its master process manager ***
your memory page size is 4096 bytes
uwsgi socket 0 bound to TCP address 127.0.0.1:59238 fd 3
your server socket listen backlog is limited to 100 connections
*** Operational MODE: single process ***
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 6515, cores: 1)
在浏览器 example.com 中:
500 Internal Server Error 错误
的原因是什么?而这一行:“没有加载应用程序。进入完全动态模式”在控制台中。