Articles of wsgi

wsgi和python打印语句

我已经意识到,我的Django应用程序中的打印语句导致wsgi错误,并失败。 没有遍历所有我的代码和删除/注释打印语句,是否有办法我可以禁用他们在运行wsgi。 它需要尽可能简单。 谢谢

gunicorn + django + nginx unix://套接字失败(11:资源暂时不可用)

在configuration了django,gunicorn,supervisor和nginx的服务器上运行非常高的stream量。 但很多时候,我倾向于看到502错误。 所以我检查了nginx日志,看看是什么错误,这是logging: [错误] 2388#0:* 208027连接()到unix:/tmp/gunicorn-ourapp.socket失败(11:资源暂时不可用),同时连接到上游 任何人都可以帮助debugging可能会导致这种情况发生? 这是我们的nginxconfiguration: sendfile on; tcp_nopush on; tcp_nodelay off; listen 80 default_server; server_name imp.ourapp.com; access_log /mnt/ebs/nginx-log/ourapp-access.log; error_log /mnt/ebs/nginx-log/ourapp-error.log; charset utf-8; keepalive_timeout 60; client_max_body_size 8m; gzip_types text/plain text/xml text/css application/javascript application/x-javascript application/json; location / { proxy_pass http://unix:/tmp/gunicorn-ourapp.socket; proxy_pass_request_headers on; proxy_read_timeout 600s; proxy_connect_timeout 600s; proxy_redirect http://localhost/ http://imp.ourapp.com/; #proxy_set_header Host $host; #proxy_set_header X-Real-IP […]

Upstart vs Supervisord来pipe理WSGI进程

思考? 我正在运行Ubuntu 10.0.4

uWSGI无法使用Flask和Virtualenv查找“应用程序”

使用uWSGI服务一个简单的wsgi应用程序(一个简单的“Hello,World”)我的configuration工作,但是当我尝试运行一个Flask应用程序,我得到这个在uWSGI的错误日志: current working directory: /opt/python-env/coefficient/lib/python2.6/site-packages writing pidfile to /var/run/uwsgi.pid detected binary path: /opt/uwsgi/uwsgi setuid() to 497 your memory page size is 4096 bytes detected max file descriptor number: 1024 lock engine: pthread robust mutexes uwsgi socket 0 bound to TCP address 127.0.0.1:3031 fd 3 Python version: 2.6.6 (r266:84292, Jun 18 2012, 14:18:47) [GCC 4.4.6 20110731 […]

如何使用yum在CentOS上安装wsgi?

如何使用yum在CentOS上安装wsgi? 有没有任何与mod_wsgi的存储库?

我在哪里把WSGIPythonHome指令放在httpd.conf文件中?

我已经search了整个文件的地方放置指令,但我不知道该把它放在哪里,互联网似乎也没有很好的答案,或者我只是不善于寻找它呵呵。 有人知道这个指令在哪里?

如何让nginx将HTTP_AUTHORIZATION标头传递给Apache

我们使用Nginx作为使用HTTP Auth的Apache服务器的反向代理。 出于某种原因,我无法将HTTP_AUTHORIZATION头信息传递给Apache,它似乎被Nginx过滤掉了。 因此,没有请求可以authentication。 请注意,基本身份validation是dynamic的,所以我不想在我的nginxconfiguration中对它进行硬编码。 我的nginxconfiguration是: server { listen 80; server_name example.co.uk ; access_log /var/log/nginx/access.cdk-dev.tangentlabs.co.uk.log; gzip on; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_read_timeout 120; location / { proxy_pass http://localhost:81/; } location ~* \.(jpg|png|gif|jpeg|js|css|mp3|wav|swf|mov|doc|xls|ppt|docx|pptx|xlsx|swf)$ { if (!-f $request_filename) { break; proxy_pass http://localhost:81; } root /var/www/example; } } 任何人都知道这是为什么发生? 更新 – 事实certificate,这个问题是我原来的问题,我忽略了:mod_wsgi。 这里所讨论的网站是一个Django站点,事实certificate,Apache确实得到了通过的authvariables,但是mod_wsgi将它们过滤掉了。 […]

Apache / wsgi“脚本在返回标题之前超时”

我有一个自定义的Django应用程序,大约每5,000个请求就会变得不响应。 在Apache日志中,我看到以下内容: Apr 13 11:45:07 www3 apache2[27590]: **successful view render here** … Apr 13 11:47:11 www3 apache2[24032]: [error] server is within MinSpareThreads of MaxClients, consider raising the MaxClients setting Apr 13 11:47:43 www3 apache2[24032]: [error] server reached MaxClients setting, consider raising the MaxClients setting … Apr 13 11:50:34 www3 apache2[27617]: [error] [client 10.177.0.204] Script timed […]

Python / Django / WSGI / Apache – “ImportError:No module named site”

我想在我的本地ubuntu机器上使用django应用程序。 然而,该网站不工作,我的/var/log/apache2/errors.log充满了这样的消息: ImportError: No module named site 我的/var/log/apache2/error.log (今天)看起来像这样: $ cat error.log | uniq -c 1 [Wed Jun 29 09:37:37 2011] [notice] Apache/2.2.17 (Ubuntu) mod_wsgi/3.3 Python/2.7.1+ configured — resuming normal operations 12966 ImportError: No module named site 这是通知,它启动时,我打开我的机器,其次是12,966行都说no module named site消息 注意缺lessdate时间字段。 即使不进入网站(即使不进行networking请求),也会重复这些错误。 在浏览器中访问网站时,它只是挂起,仿佛在等待大量下载。 设置 Apache模块 我正在使用一个python 2.5 virtualenv与很多包(包括Django的1.1)与点安装。 我有mod_wsgi加载: $ ls -l /etc/apache2/mods-enabled/wsgi* lrwxrwxrwx […]

将uWSGI连接到Ubuntu 16.04上的Django和nginx

我正在试图按照这个教程来设置Ubuntu 16.04上的Django和nginx uWSGI 。 这一切工作正常,直到最后一步(哦,讽刺…),我试图执行此命令: sudo service uwsgi start 如果失败,出现以下错误: 无法启动uwsgi.service:找不到单位uwsgi.service。 其他人似乎也得到了类似的错误: 无法启动uwsgi.service:单位uwsgi.service未能加载:没有这样的文件或目录。 这个问题似乎与Ubuntu的版本有关。 虽然这个教程是针对Ubuntu 14.04的,但它似乎不适用于较新的版本,因为在版本15中,Ubuntu从upstart init守护进程切换到了systemd init守护进程 。 我怎样才能使用systemd来启动uWSGI,以便它与nginx和Django一起工作?