使用Linode进行基本的uwsgi配置

时间:2016-11-29 22:18:46

标签: python-2.7 uwsgi linode

我正在学习配置Django,nginx和uwsgi的教程。 https://gist.github.com/evildmp/3094281

第一部分涉及配置uwsgi来运行这个python文件 /home/ofey/djangoenv/bin/test.py

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return "Hello world"

djangoenv是virtualenv目录。

它包含二进制uwsgi,它是使用

安装到此环境的
$ pip install uwsgi

请注意,我已经停止了nginx,

$ sudo systemctl stop nginx

并且还停止了作为systemd服务运行的uwsgi。

$ sudo systemctl stop uwsgi

运行test.py和输出

(djangoenv) [ofey@ofeyspi bin]$ uwsgi --http :8000 --master --wsgi-file test.py
*** Starting uWSGI 2.0.14 (64bit) on [Tue Nov 29 21:54:09 2016] ***
compiled with version: 6.2.1 20160916 (Red Hat 6.2.1-2) on 28 November 2016 14:39:40
os: Linux-4.8.6-x86_64-linode78 #1 SMP Tue Nov 1 14:51:21 EDT 2016
nodename: ofeyspi
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/ofey/djangoenv/bin
detected binary path: /home/ofey/djangoenv/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 7982
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uWSGI http bound on :8000 fd 4
uwsgi socket 0 bound to TCP address 127.0.0.1:41335 (port auto-assigned) fd 3
Python version: 2.7.12 (default, Sep 29 2016, 13:30:34)  [GCC 6.2.1 20160916 (Red Hat 6.2.1-2)]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0xb72990
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 145520 bytes (142 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0xb72990 pid: 11493 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 11493)
spawned uWSGI worker 1 (pid: 11494, cores: 1)
spawned uWSGI http 1 (pid: 11495)

我希望在http://qqiresources.com:8000看到'你好世界' 但没什么。

我知道qqiresources.com正在运行,因为当我打开nginx时,我看到了nginx默认主页。

这是在Linode上运行,虚拟部署Fedora 24。

我之前发过一个试图在Linode上配置Django,wsgi和nginx的问题,但我想我需要先弄清楚上面这个简单的情况。 Linode Django uwsgi Nginx

任何帮助将不胜感激, 感谢

0 个答案:

没有答案