标签: uwsgi

Django + uWSGI通过Ubuntu 11.10上的NGINX

我正在尝试部署一个django项目.我尝试了很多教程,但没有运气.我使用一个新的干净的Ubuntu 11.10.我已经表演了

apt-get install nginx
apt-get install uwsgi
service nginx start
Run Code Online (Sandbox Code Playgroud)

我已经创建了文件夹/deploy/project1并放在那里manage.py和其他文件.

我目前/deploy/project1/project1/wsgi.py包含:

import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "project1.settings")

from django.core.wsgi import get_wsgi_application
application = get_wsgi_application()
Run Code Online (Sandbox Code Playgroud)

那么,你能告诉我如何domain.com正确部署我的django应用程序吗?

我还通过pip和easy_install安装了Django

我应该加入/etc/nginx/sites-enabled/default.

django nginx uwsgi ubuntu-11.10

23
推荐指数
2
解决办法
2万
查看次数

错误:从上游读取响应头时上游过早关闭连接[uWSGI/Django/NGINX]

我目前总是在我的用户正在进行的查询中获得502 ...通常返回872行并在MySQL中运行2.07.然而,它返回了大量信息.(每行包含很多东西).有任何想法吗?

运行Django(tastypie Rest API),Nginx和uWSGI堆栈.

使用NGINX进行服务器配置

# the upstream component nginx needs to connect to
upstream django {
    server unix:///srv/www/poka/app/poka/nginx/poka.sock; # for a file socket
}

# configuration of the server
server {
    # the port your site will be served on
    listen  443;


    # the domain name it will serve for
    server_name xxxx; # substitute your machine's IP address or FQDN
    charset     utf-8;

    # max upload size
    client_max_body_size 750M;   # adjust to taste

    # Finally, send all non-media requests …
Run Code Online (Sandbox Code Playgroud)

mysql django nginx amazon-ec2 uwsgi

23
推荐指数
2
解决办法
7万
查看次数

无法以root身份运行uwsgi,"bind():权限被拒绝"

我尝试使用此文档配置uWsgi,Django,Nginx:http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html

完成配置uwsgi.ini文件,创建一个软链接/etc/uwsgi/vassals.

最后一步失败:在系统引导时启动uWSGI.

运行此命令时:

sudo /usr/local/bin/uwsgi --emperor /etc/uwsgi/vassals --uid www-data --gid www-data

我收到了这个错误:

clock source: unix
detected number of CPU cores: 1
current working directory: /etc/uwsgi/vassals
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
your processes number limit is 3813
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 …
Run Code Online (Sandbox Code Playgroud)

linux nginx uwsgi

23
推荐指数
3
解决办法
3万
查看次数

Nginx - 在uwsgi_pass之前重写request_uri

我有一个Nginx vhost而不是这样配置:

...
location /one {
  include uwsgi_params;
  uwsgi_pass unix:///.../one.sock;
}
location /two {
  include uwsgi_params;
  uwsgi_pass unix:///.../two.sock
}
...
Run Code Online (Sandbox Code Playgroud)

这当然是简化的配置

当我请求/one/something我希望我的Python脚本接收/somethingrequest_uri.

我正在使用BottlePy,但希望由Nginx处理,而不是在我的Python代码中处理.

我能做点什么uwsgi_param REQUEST_URI replace($request_uri, '^/one', '')吗?

编辑

以下是我的Python代码的请求:[pid:30052 | app:0 | req:1/1](){42 vars in 844 bytes} [Tue Aug 21 14:22:07 2012] GET/one/something = >在4 msecs(HTTP/1.1 200)中生成0个字节,在85个字节中生成2个标头(核心0上的0个开关)

所以Python是可以的,但uWSGI不是.

如何解决?

regex nginx bottle uwsgi

22
推荐指数
1
解决办法
8588
查看次数

将命令行参数传递给uwsgi脚本

我正在尝试将参数传递给示例wsgi应用程序,:

config_file = sys.argv[1]

def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return [b"Hello World %s" % config_file]
Run Code Online (Sandbox Code Playgroud)

并运行:

uwsgi --http :9090 --wsgi-file test_uwsgi.py  -???? config_file # argument for wsgi script
Run Code Online (Sandbox Code Playgroud)

我能做到的任何聪明方式吗?无法在uwsgi文档中找到它.也许还有另一种方法可以为wsgi应用程序提供一些参数?(环境变量超出范围)

python wsgi uwsgi

22
推荐指数
2
解决办法
8536
查看次数

Django App配置不当 - 应用程序模块有多个文件系统位置

我想我真的搞砸了.在我的django应用程序(生产一个)上,我推了一个重大更新,每当我尝试进入我的域时就会出现"内部服务器错误".我在uwsgi日志中收到错误:

*** Starting uWSGI 2.0.8 (64bit) on [Thu Jan 29 00:36:43 2015] ***
compiled with version: 4.8.2 on 11 December 2014 17:29:38
os: Linux-3.13.0-41-generic #70-Ubuntu SMP Tue Nov 25 14:40:34 UTC 2014
nodename: ip-172-31-9-208
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /
detected binary path: /usr/local/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
uWSGI running as root, you can use --uid/--gid/--chroot options
*** WARNING: you are running uWSGI as root …
Run Code Online (Sandbox Code Playgroud)

django uwsgi

22
推荐指数
1
解决办法
8888
查看次数

是否需要WSGI服务器和HTTP服务器来提供Flask应用程序?

使用uWSGI和Nginx设置Flask非常困难,即使使用buildout脚本也需要很长时间,并且必须将其记录到稍后要再现的指令中.

如果我不计划服务器上的大负载(它是公开的隐藏),没有uWSGI运行它是否有意义?(Flask可以收听端口.Nginx可以转发请求吗?)

甚至不使用Nginx,只是在端口上运行裸烧瓶应用程序是否有意义?

python nginx flask uwsgi

22
推荐指数
3
解决办法
1万
查看次数

gunicorn 发送信息消息处理信号:绞盘

有人可以帮助知道gunicorn发送信息消息处理信号的原因:绞盘应用程序空闲时。

没有错误,应用程序继续响应,但当它空闲时会显示上面的消息。

除了 WINCH : Gracefully shutdown the worker processes when Gunicorn is daemonized之外,我在 gunicorn 处理信号文档部分找不到更多信息 。

  1. 这里gunicorn daemonized是什么意思
  2. 处理信号:空闲时绞盘信息,需要为此采取一些措施吗?
  3. 任何关于 WINCH 和所有其他人的简要信息都表示意义 提前致谢!

python flask uwsgi gunicorn

22
推荐指数
1
解决办法
4297
查看次数

Nginx连接重置,uWsgi的响应丢失

我有一个通过Nginx和uWsgi托管的django应用程序.在某个非常简单的请求中,我得到了GET和POST的不同行为,但情况并非如此.

uWsgi守护程序日志:

[pid: 32454|app: 0|req: 5/17] 127.0.0.1 () {36 vars in 636 bytes} [Tue Oct 19 11:18:36 2010] POST /buy/76d4f520ae82e1dfd35564aed64a885b/a_2/10/ => generated 80 bytes in 3 msecs (HTTP/1.0 440) 1 headers in 76 bytes (0 async switches on async core 0)
[pid: 32455|app: 0|req: 5/18] 127.0.0.1 () {32 vars in 521 bytes} [Tue Oct 19 11:18:50 2010] GET /buy/76d4f520ae82e1dfd35564aed64a885b/a_2/10/ => generated 80 bytes in 3 msecs (HTTP/1.0 440) 1 headers in 76 bytes (0 async switches on async core 0) …
Run Code Online (Sandbox Code Playgroud)

django nginx uwsgi

21
推荐指数
4
解决办法
1万
查看次数

主管未能重启一半的时间

我正在尝试在运行Debian 8.1的机器上使用Uwsgi和supervisor部署Django应用程序.

当我重新启动时,sudo systemctl restart supervisor它无法重启一半的时间.

$ root@host:/# systemctl start supervisor
    Job for supervisor.service failed. See 'systemctl status supervisor.service' and 'journalctl -xn' for details.
$ root@host:/# systemctl status supervisor.service
    ? supervisor.service - LSB: Start/stop supervisor
       Loaded: loaded (/etc/init.d/supervisor)
       Active: failed (Result: exit-code) since Wed 2015-09-23 11:12:01 UTC; 16s ago
      Process: 21505 ExecStop=/etc/init.d/supervisor stop (code=exited, status=0/SUCCESS)
      Process: 21511 ExecStart=/etc/init.d/supervisor start (code=exited, status=1/FAILURE)
    Sep 23 11:12:01 host supervisor[21511]: Starting supervisor:
    Sep 23 11:12:01 host systemd[1]: supervisor.service: control process exited, code=exited …
Run Code Online (Sandbox Code Playgroud)

debian uwsgi supervisord systemd

21
推荐指数
1
解决办法
1万
查看次数