Articles of uwsgi

Django(uWSGI)和php(fastcgi)NGINX

我是configuration服务器的新手,我有问题让PHP使用我的django应用程序在nginx上使用UWSGI。 Django的伟大作品使用uwsgi和PHP伟大的时候,我删除了Django网站的conf,但是当我一起使用Django和PHP一起PHP文件不工作(浏览器只是下载它们),任何想法(请具体我是新来的东东)? 我接受build议,在这里变得有点绝望。 谢谢 这里是我的nginx的django站点conf文件: # mysite_nginx.conf #################### # the upstream component nginx needs to connect to upstream django { # server unix:///home/appdeploy/uwsgi-tutorial/mysite/mysite.sock; # for a file socket server 127.0.0.1:8001; # for a web port socket (we'll use this first) } # configuration of the server server { # the port your site will be […]

同时使用uwsgi和gunicorn或完全切换到gunicorn?

我们在nginx后面运行我们的python应用程序。 首先我们使用uWSGI,因为它是快速,可靠和易于部署的。 接下来,随着并发客户端(使用服务器发送的事件/事件stream)数量的增加,我们已经部分切换到gunicorn + gevent的应用程序。 目前,该应用程序是这样的服务: 静态是由nginx直接处理的; 短请求(REST API)由uWSGI(通过unix套接字连接的nginx < – > uwsgi)处理, 长的请求(服务器发送的事件)由gunicorn + gevent处理(而nginx作为rev代理) 我们应该保持这种设置还是有任何理由从uWSGI切换到gunicorn?

设置nginx在uWSGIclosures时显示维护页面

我有nginx设置为一个Flask应用程序uWSGI服务。 有时会出现错误,或者我将重新启动uWSGI服务,但是我希望nginx提供更好的维护页面,而不是在uWSGI没有响应时发生的默认502错误网关。 我已经尝试了多个configuration,应该这样做,但没有一个似乎有任何效果。 这是我目前的configuration: server { listen 80; server_name mydomain.com; charset utf-8; client_max_body_size 75M; location / { try_files $uri @flask; error_page 502 =200 @maintenance; } location @flask { include uwsgi_params; uwsgi_pass unix:/path/to/socket/uwsgi.sock; } location @maintenance { root /path/to/web; rewrite ^(.*)$ /maintenance.html break; } }

centos + apache + uWSGI任何选项?

我正在尝试在centos上设置“apache + uWSGI”。 但是我收到以下错误: 无效的命令“uWSGISocket”,可能是拼写错误.. 为此,我find了一个解决scheme,我需要一个名为: 中的libapache2-MOD-uwsgi 但是,在该包没有可用的centos。 现在我很困惑是否可以在centos上configuration“apache + uWSGI”? 以下是我的虚拟主机configuration: LoadModule wsgi_module modules / mod_wsgi.so WSGISocketPrefix / var / run / wsgi ServerName www.example.com ServerAlias example.com DocumentRoot /usr/src/example/templates <Location /> SetHandler uwsgi-handler uWSGISocket 127.0.0.1:3031 </Location> <Directory /usr/src/example/templates> Order allow,deny Allow from all </Directory> 请帮忙

我不得不重新启动uwsgi进程

我正在使用uwsgi和nginx的组合来服务我的烧瓶应用程序。 发生什么事是几个小时后(在非常低的负载下,<几百个请求),请求超时,直到我重新启动uwsgi进程,事情再次工作相同的时间。 这里是nginx的conf: server { listen 3001; server_name localhost; charset utf-8; client_max_body_size 75M; location / { try_files $uri @myapp; } location @myapp { include uwsgi_params; uwsgi_pass unix:/my/dir/uwsgi.sock; } } 我的uwsgi.ini: [uwsgi] #application's base folder base = /my/dir #python module to import app = app module = %(app) home = %(base)/venv pythonpath = %(base) #socket file's […]

uwsgi + Django与nginx:高可用性设置

从https://stackoverflow.com/questions/25304968/uwsgi-django-with-nginx-high-availability-setup移到这里。 我在RHEL 6.5上设置了高可用性。 我的堆栈是 1. uwsgi 2. nginx 3. django 4. Pacemaker 现在我明白了,可以通过监视nginx_status轻松设置nginx location /nginx_status { # Turn on nginx stats stub_status on; access_log off; # Security: Only allow access from 192.168.1.100 IP # allow 127.0.0.1; # Send rest of the world to /dev/null # deny all; } 这将确保nginx的心跳监视。 但是,我的问题是如何确保uwsgi将处于运行状态,以便当第二个nginx机器启动时它会识别uwsgi进程并将其绑定到它。 或者,如果uwsgi发生故障,如何确保将其恢复并重新绑定到nginx 设置如下 假设集群机器: 1. xxxx […]

uWSGI以root身份写入日志

我有以下uwsgi.ini : [uwsgi] uid = myuser gid = myuser master = true daemonize = /path-to-log/uwsgi.log … 我在rc.local运行uwsgi。 我可以看到工作人员以myuser身份运行,我可以看到uwsgi在日志中切换到myuser ,并假设myuser也将是uwsgi.log所有者。 但root是uwsgi.log所有者。 我怎么能设置uwsgi.log所有者? 这是为了方便 – 我想看看没有sudo的日志。

Django邮件报告被Gmail阻止

我configuration我的Django 1.6框架发送错误报告到Gmail帐户,所以我可以检查他们。 在此之前,虽然我不得不定义filter来捕获发件人邮件地址我configuration为这些电子邮件报告被标记为“非垃圾邮件”和正确分类。 虽然我每次打开报告时都会出现一条消息,例如“这不是垃圾邮件”文件夹,因为您将其标记为“非垃圾邮件”。 …直到几天前。 报告停止到达。 我检查了/var/log/mail.log中的日志,发现这个: Our system has detected that this message is 550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail, 550-5.7.1 this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550 5.7.1 more information. t17si11455054wiv.44 – gsmtp (in reply to end of DATA command)) 几乎所有的错误报告都被Gmail阻止,所以我参考了Google的“批量发件人指南”来尝试解决此问题。 我的邮件服务器使用一致的IP地址,并且域已经获得了正确的反向DNSlogging,但发件人地址可能会根据发生错误的子域更改(例如:[email protected],如果subdomain1抛出exception,或者[email protected]如果是子域2)。 […]

uWSGI:chdir():没有这样的文件或目录

我正在configurationuWSGI和这个im.iniconfiguration文件: [uwsgi] uid = www-data gid = www-data plugins = python chdir = '/var/www/im/' module = texst master = true processes = 5 我得到chdir():没有这样的文件或UWSGI错误日志中的目录。 该目录由万维网数据拥有,不知道它。 任何小费?

是否有可能让uwsgi重新启动500个错误

我偶尔会遇到数据库将重新启动或类似的问题。 在这些情况下,我需要进入并手动重新启动uwsgi。 可以设置uwsgi重启500错误吗? 理想情况下,我可以让工作人员重新启动500个错误,而不是每个错误。