那有:
1)ubuntu 11.10
2)切诺基(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添加到hosts文件(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 vserver中添加虚拟服务器 - &gt;添加 - &gt;平台 - &gt; uwsgi choise uwsgi.xml文件root / 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内部服务器错误
可能是错误的原因是什么?这一行:“没有app加载。进入完全动态模式”在控制台中。
答案 0 :(得分:1)
你还没有用
加载python插件<plugins>python</plugins>