我在AWS EC2 Micro实例上使用Ubuntu 12.04.1,并尝试使用uWSGI和nginx设置简单的Flask应用程序。 而且我面对uWSGIconfiguration奇怪的事情。
这是我的app.conf :
[uwsgi] socket = /tmp/tmp.sock plugins = python27 chdir = /home/ubuntu/app pythonpath = .. module = app:app virtualenv = /home/ubuntu/.virtualenvs/app
uWSGI没有重新启动后创build套接字文件,如果我用uwsgi -i /etc/uwsgi/apps-enabled/app.conf手动运行它,这里的日志:
*** Starting uWSGI 1.0.3-debian (64bit) on [Sat Mar 16 06:54:39 2013] *** compiled with version: 4.6.3 on 17 July 2012 02:26:54 current working directory: /home/ubuntu/app detected binary path: /usr/bin/uwsgi-core *** WARNING: you are running uWSGI without its master process manager *** your memory page size is 4096 bytes The -s/--socket option is missing and stdin is not a socket.
但是当我添加-s参数时,一切正常。
uwsgi -i /etc/uwsgi/apps-enabled/app.conf -s /tmp/tmp.sock *** Starting uWSGI 1.0.3-debian (64bit) on [Sat Mar 16 06:56:04 2013] *** compiled with version: 4.6.3 on 17 July 2012 02:26:54 current working directory: /home/ubuntu/app detected binary path: /usr/bin/uwsgi-core *** WARNING: you are running uWSGI without its master process manager *** your memory page size is 4096 bytes uwsgi socket 0 bound to UNIX address /tmp/tmp.sock fd 3 your server socket listen backlog is limited to 100 connections *** Operational MODE: single process *** *** no app loaded. going in full dynamic mode *** spawned uWSGI worker 1 (and the only) (pid: 18023, cores: 1)
所以,似乎uWSGI忽略了在应用程序configuration文件中设置的socket选项?
这只发生在ini格式的configuration文件中 – 所有的configuration都可以使用XML编写。 看起来像一个错误。
uWSGI预计只有一些扩展名如.ini , .xml …
将你的app.conf文件重命名为app.ini将解决这个问题。