小编waT*_*lon的帖子

如何用flask和nginx启动uwsgi

我想我的主要问题是我不知道,文件层次结构应该如何?到目前为止,我在他的"烧瓶开发"一书中关注了格林伯格的教程.所以我喜欢:

--manage.py ( Flask's Script extension script)
--app/   ( application folder as a package)
--virtual_env
Run Code Online (Sandbox Code Playgroud)

并且不确定我搞砸了什么,但现在当我用uwsgi命令尝试任何东西时,它会说以下错误:

current working directory: /home/gaucan/temp/my_app
detected binary path: /usr/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
Run Code Online (Sandbox Code Playgroud)

编辑:像这样工作开始:

uwsgi --http :9090 -w manage:app --enable-threads

这工作......在manage.py我有线: app=create_app('default') 所以这几乎就是我想我需要做的...

但我仍然无法得到上面的警告...我正在运行uwsgi没有它的主过程管理器......是否可以?或者我做错了什么?

这只是创建/etc/nginx/nginx.conf文件

    worker_processes 1;

events {

     worker_connections 1024;

}

http {

sendfile on;

gzip              on;
gzip_http_version 1.0;
gzip_proxied      any;
gzip_min_length   500;
gzip_disable      "MSIE [1-6]\."; …
Run Code Online (Sandbox Code Playgroud)

nginx flask uwsgi

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

uwsgi+nginx如何换组?

我正在尝试 uwsgi+nginx+django 教程,并被困在那里(链接直接到我被困的部分)\n https://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html#if-那不起作用

\n\n

nginx error.log 说:

\n\n
2015/03/09 13:44:51 [crit] 11642#0: *16 connect() to unix:///home/gaucan/temp/my_app/mysite.sock failed (13: Permission denied) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /favicon.ico HTTP/1.1", upstream: "uwsgi://unix:///home/gaucan/temp/my_app/mysite.sock:", host: "localhost:8000"\n
Run Code Online (Sandbox Code Playgroud)\n\n

教程说要修复它,请执行以下操作: \n \nYou may also have to add your user to nginx\xe2\x80\x99s group (which is probably www-data), or vice-versa, so that nginx can read and write to your socket properly.\n\n但是我是 Linux 菜鸟,我不知道该怎么做,或者如何查明该组是否是 www-data ......已经做了一些混乱在将某些文件夹的所有者更改为用户之前:“gaucan”

\n\n

我也在教程中跳过了这一步:\n \nYou will need the uwsgi_params …

nginx uwsgi

5
推荐指数
1
解决办法
3007
查看次数

标签 统计

nginx ×2

uwsgi ×2

flask ×1