uwsgi

How can I configure allowed number of GET parameter characters in uWSGI?

淺唱寂寞╮ 提交于 2019-12-05 09:47:44
I am running Django with nginx + uWSGI. Having just moved from local dev to a staging server, I have discovered that a particular GET request we make has a long query string. Trying to debug, it seems that uWSGI is not accepting this query string based on length - I can pass short strings and it works, over a certain length I start getting 502 bad gateway errors. I couldn't find anything about this on the uWSGI site or via google searching. Does anyone know what could be the issue? Found the solution, it is easy enough. Just need to increase uWSGI buffer-size, eg: buffer-size = 32768 来源: https

Flask+Nginx+uWSGI : ImportError: No module named site

给你一囗甜甜゛ 提交于 2019-12-05 09:21:40
I installed as the http://www.reinbach.com/uwsgi-nginx-flask-virtualenv-mac-os-x.html link's tutorial and when executing the command uwsgi --ini deploy/deploy.ini , the terminal says there was an import error: Set PYTHONHOME to /virtualenv/sample/ ImportError: No module named site I have set my PYTHONHOME and PYTHONPATH as export PYTHONPATH=$PYTHONPATH:/Library/Python/2.7/site-packages export PYTHONHOME=$PYTHONHOME:/Library/Python/2.7 I cannot figure out what wrong with it. Could someone help me with the problem? The whole info in the terminal is shown as below if it is helpful: (env)ios

How to make uwsgi --emperor run as daemon

北城余情 提交于 2019-12-05 08:37:32
I'm using yaml. It has a line says : daemonize : /var/www/apps/myapp.log If uwsgi -y vassals/myappconfig.yaml , the website runs in background. I can do other things in terminal, even logout. This is the effect I'm expecting. If uwsgi --emperor vassals , the website can run, but it stuck up in terminal. I must use ctrl + c to end it to return to terminal. Then the website is down. That's not what I'm expecting. I don't want to use things like nohup . If uwsgi --emperor is not the right solution, I'd rather to load websites one by one, all run daemonized. you can pass --daemonize <logfile> to

linux上使用nginx、uwsgi不是django项目

ぐ巨炮叔叔 提交于 2019-12-05 08:35:15
参考:https://www.django.cn/article/show-4.html#buzhou 注意事项: 在虚拟环境中操作,虚拟环境中安装nginx、uwsgi,虚拟环境外需安装uwsgi -- 临时关闭防火墙:systemctl stop firewalld.service -- 永久关闭防火墙:systemctl disable firewalld.service 启动nginx或者uwsgi不成功: -- 在centos下启动nginx出现Failed to start nginx.service:unit not found: 错误的原因就是没有添加nginx服务,所以启动失败: https://www.cnblogs.com/ansibee/p/8087476.html --端口被占用或者已经有进程在运行: #查看Uwsgi进程 ps -ef|grep uwsgi #用kill方法把uwsgi进程杀死,然后启动uwsgi killall -9 uwsgi 来源: https://www.cnblogs.com/yangyangming/p/11915462.html

nginx+uwsgi介绍

偶尔善良 提交于 2019-12-05 06:19:44
一、nginx+uwsgi介绍 pip list # 查看安装过的模块 rpm -q nginx # 查看是否安装某款服务 pip install django == 1.11.11 # 安装django并指定版本 yum install -y nginx # 安装nginx """单独在一台被控机上测试""" mkdir /data cd /data/ # 命令行创建django项目 django-admin startproject mysite cd mysite/ python manage.py startapp app01 # 修改配置文件 ALLOWED_HOSTS = ["*"] DEBUG = False 注册app01 # 启动访问 python manage.py runserver 0.0.0.0:8080 # 需要关闭防火墙 iptables -F # django默认使用的wsgiref并发量太小 换成uwsgi pip install uwsgi # 可保持django运行 重新开设xshell窗口安装即可 # 报错 需要下载python-devel(开发必备的包) 秉持原则:缺什么装什么不用的别装 然后重新安装即可 yum install -y python-devel # 启动uwsgi 需要切换到项目目录下 uwsgi --http :8090

How to separate logs of uWSGI?

妖精的绣舞 提交于 2019-12-05 06:14:56
I want to separate the logs of uwsgi like access logs, request logs, error logs in individual files. At the moment these all are in same file and not well formatted. There are configuration directives to specify different loggers for requests and all other messages: logger and req-logger . Example: # uwsgi.ini req-logger = file:/var/log/uwsgi/uwsgi-req.log logger = file:/var/log/uwsgi/uwsgi.log If you want nondefault formatting, filtering or a peculiar output location, you could write your own logging plugin. Here's a link the relevant page: http://uwsgi-docs.readthedocs.org/en/latest/Logging

some django's logs are missing when host in uwsgi with multiple process

∥☆過路亽.° 提交于 2019-12-05 05:40:42
I'm using django+uwsgi for a web project. But I found some django logs would be missing after uwsgi is running for a while! The situation is that: I config the uwsgi with 8 process. When I start the uwsgi, all the django logs would be written in single log file. But after a few hours, some logs are not written in file. I compared the django log file to uwsgi log file. I found only one uwsgi process's requests were written in django file. The other 7 process's django logs were missing. When I restart the uwsgi, it is the same result. Does anyone know about this? Thanks, my django logging config

how can I use uwsgi web.py to run background function?

自古美人都是妖i 提交于 2019-12-05 05:34:36
问题 Say I need to send an email to myself when there is new comment. and I don't want to block web.py presenting HTML to browser. and Threading seems don't work here. class comment: def POST(self): ... sender = Thread(target=_sendmail,args=('New Comment',msg)) sender.start() referer = web.ctx.get('HTTP_REFERER', 'http://www.domain.com') raise web.SeeOther(referer) the problem when using threading is that once POST function is finished.. the sender within it would be freezed..usually sender didn't

centos下django1.9部署

こ雲淡風輕ζ 提交于 2019-12-05 04:15:55
环境说明: 环境为阿里云服务器,系统版本为centos6.5 默认python版本为2.6 第一步:更新python版本 去python官网下载python2.7.11的源码包 https://www.python.org/downloads/release/python-2711/ 。 在安装python2.7之前,我们需要安装一些之后需要的依赖库,不然的话,之后还需要的时候还需要重新编译安装python。 这里我们用yum安装上zlib, ssl: 安装zlib : yum install zlib zlib-devel 安装openssl : yum install openssl openssl-devel 之后安装python。解压我们之前下载的python2.7的包,进入目录后, 指定安装目录方便之后寻找相关文件。然后make , makeinstall. ./configure --prefix=/usr/local/python27 make make install make install成功后,需要覆盖/usr/bin/python cp /usr/bin/python /usr/bin/python26.old ln -s /usr/local/python27/bin/python /usr/bin/python 这样,python2.7我们已经安装好了

flask uwsgi和nginx配置信息

时光怂恿深爱的人放手 提交于 2019-12-04 20:22:15
1. 安装 pip3 install uwsgi 2. uwsgi配置信息 创建一个uwsgi.ini文件 [uwsgi] socket=/opt/script/uwsgi.sock #启动程序时所使用的地址和端口,通常在本地运行flask项目 http=127.0.0.1:5002 callable = app # 程序内启用的application变量名 chdir=/opt/ssologin # 部署的项目目录 wsgi-file =../ssologin/manage.py # flask程序的启动文件 workers=4 #进程数 master=true #启动主线程 vacuum=true #自动移除unix Socket和pid文件当服务停止的时候 threads=2 #线程数 pidfile=uwsgi.pid #设置pid文件 daemonize=/opt/script/uwsgi.log #设置日志文件 3. 启动uwsgi uwsgi --ini uwsgi.ini 4. 安装nginx wget -c https://nginx.org/download/nginx-1.12.2.tar.gz tar -zxvf nginx... 进入解压后的文件夹 ./configure make && make install 5.启动 首先创建软连接 ln -s