在 cherokee 上运行 django 项目 +乌沃斯吉

发布于 2024-12-27 05:34:16 字数 2222 浏览 1 评论 0原文

其中有:
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 添加到主机文件(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 内部服务器错误
错误的原因可能是什么?这行:“没有加载应用程序。进入完全动态模式”在控制台中。

That have:
1) ubuntu 11.10
2) cherokee (https://launchpad.net/~cherokee-webserver/+archive/ppa) (version 1.2.101)
installed like this:

sudo apt-get install cherokee
sudo apt-get install libcherokee-mod-rrd
sudo apt-get install cherokee-doc

3) uwsgi (version 0.9.8.1-1)
installed like this:

sudo apt-get install uwsgi uwsgi-plugin-python

4) Django 1.3.1 (sudo pip install django)

Run:
1) add example.com to hosts file (example.com 127.0.0.1)
2) create uwsgi.xml

<uwsgi>
    <pythonpath>/var/www/vtest/</pythonpath>
    <pythonpath>/var/www/</pythonpath>
    <app mountpoint="/">
        <script>django_wsgi</script>
    </app>
</uwsgi>

and 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/

Move file uwsgi.xml, django_wsgi.py to /var/www/vtest and chmod +x django_wsgi.py

4) add virtual server in cherokee-admin vservers -> add -> platforms -> uwsgi choise uwsgi.xml document root /var/www/vtest
in console:

ps -A | grep uwsgi
6352 ?        00:00:00 uwsgi

if run uwsgi command in console:

/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)

in browser example.com:
500 Internal Server Error
what could be the cause of the error? And this line: "no app loaded. going in full dynamic mode" in the console.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凯凯我们等你回来 2025-01-03 05:34:16

你还没有加载 python 插件

<plugins>python</plugins>

you have not loaded the python plugin with

<plugins>python</plugins>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文