uwsgi

nginx serving Django in a subdirectory through uWSGI

旧城冷巷雨未停 提交于 2019-12-04 02:53:50
I have already gone through some previous threads: How do I set subdirectory in nginx with Django how to deploy django under a suburl behind nginx Serving flask app on subdirectory nginx + uwsgi The basic lesson is that you should only need to configure your site(s-available) to achieve this. I have now tried various permutations of server { listen 80; server_name www.example.com; location = /favicon.ico { access_log off; log_not_found off; } location /static/ { root /path/to/project; } location /project/ { root /path/to/project; include /etc/nginx/uwsgi_params; uwsgi_param SCRIPT_NAME

How to create one uwsgi log file per day?

感情迁移 提交于 2019-12-04 02:49:11
I use uwsgi with the parameter --daemonize /logs/uwsgi.log This file is however becoming large and I would like to split it into smaller pieces. One per day would be preferable. I have done that for nginx where it was easy to specify the log file name using date variables. Is it possible to do the same for uwsgi? Something like: [uwsgi] daemonize=/logs/uwsgi-$year-$month-$day.log Or is there another way to get the same result, without too much involvement of other processes? uWSGI by itself can only "split by size", with the --log-maxsize option. Time-based approaches are using classic

FLASK 部署

馋奶兔 提交于 2019-12-04 02:24:38
一、介绍   最近开发要用一个测试环境,是这样的Nginx+uwsgi+flask 的一个结构。下面是一些记录,在Centos 系统上使用Flask 架构部署一个简单的Python应用。然后使用Nginx作为前端反向代理,设置uWSGI应用网关处理web应用程序。 二、条件 1) 环境要求 Server OS:最小化安装 Centos 6.8 Nginx :反向代理 Python2.6~2.7:开发语言 Flask/uWSGI:框架 Pip:python包管理工具 iptables&selinux:开放用到的端口,关闭selinux。 2) 安装必备的开发工具以及环境 更新系统: [root@hcloud ~]# yum update -y [root@hcloud ~]# yum groupinstall "Development tools" -y 更新完成后,记得重启系统,然后安装工具: [root@hcloud ~]# yum install wget vim telnet python-devel zlib-devel openssl-devel bzip-devel -y [root@hcloud ~]# yum install zlib-devel bzip2-devel pcre-devel openssl-devel ncurses-devel sqlite

Django App Improperly Configured - The app module has multiple filesystem locations

眉间皱痕 提交于 2019-12-03 23:50:50
I think I've really screwed something up. On my django app (the production one) I pushed a major update and am get an "Internal Server Error" whenever I try to go to my domain. I am getting an error in my uwsgi logs: *** Starting uWSGI 2.0.8 (64bit) on [Thu Jan 29 00:36:43 2015] *** compiled with version: 4.8.2 on 11 December 2014 17:29:38 os: Linux-3.13.0-41-generic #70-Ubuntu SMP Tue Nov 25 14:40:34 UTC 2014 nodename: ip-172-31-9-208 machine: x86_64 clock source: unix detected number of CPU cores: 1 current working directory: / detected binary path: /usr/local/bin/uwsgi !!! no internal

Linux--部署Django项目

我是研究僧i 提交于 2019-12-03 23:42:56
简单部署 1.安装虚拟环境virtualenvwrapper,创建虚拟环境目录,进入虚拟环境,我的虚拟环境目录叫venv2 [root@HH ~]# workon venv2 (venv2) [root@HH ~]# ls 2.cd进入到项目目录里面,安装项目必须的模块,例如django,djangorestframework,pymysql等等。 3.修改settings.py的配置文件 修改数据库配置 DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'mydjango', #数据库名 'HOST': '127.0.0.1', #这里服务器的ip地址 'PORT': 3306, #端口 'USER': 'root', #用户名 'PASSWORD': 'zou123456', #用户密码 } } 更改允许主机 ALLOWED_HOSTS = ['*'] 关闭debug debug=True 4.进入数据库创建mydjango数据库 5.启动项目 python manage.py runserver 0.0.0.0:8008 注意点:检查mysql数据库是否启动,启动时加0.0.0.0,关闭防火墙,如果时云服务器,检查安全组 什么是wsgi WSGI是web服务器网关接口,它是一个规范

Error: upstream prematurely closed connection while reading response header from upstream [uWSGI/Django/NGINX]

泪湿孤枕 提交于 2019-12-03 22:17:44
I am currently ALWAYS getting a 502 on a query my users are doing... which usually returns 872 rows and takes 2.07 to run in MySQL. It is however returning a LOT of information. (Each row contains a lot of stuff). Any ideas? Running the Django (tastypie Rest API), Nginx and uWSGI stack. Server Config with NGINX # the upstream component nginx needs to connect to upstream django { server unix:///srv/www/poka/app/poka/nginx/poka.sock; # for a file socket } # configuration of the server server { # the port your site will be served on listen 443; # the domain name it will serve for server_name xxxx

Error while installing uWSGI on mac

你说的曾经没有我的故事 提交于 2019-12-03 22:16:12
I need uWSGI for running a django project. So when i'm trying to install uWSGI, its giving me an error saying "Exception: you need a C compiler to build uWSGI". But mac comes with gcc compiler. I've downloaded uWSGI from " http://projects.unbit.it/uwsgi/wiki/WikiStart#Getit " and tried to install by the command "python setup.py install" This is the error i got while installing uWSGI running install using profile: buildconf/default.ini detected include path: ['/usr/local/include', '/Developer/usr/llvm-gcc-4.2/lib/gcc/i686-apple darwin11/4.2.1/include', '/usr/include', '/System/Library

阿里云ECS-Linux--CentOS7.3--乱七八糟,回头在整理

a 夏天 提交于 2019-12-03 18:06:05
常用命令: iptables -P INPUT ACCEPT 允许所有 iptables -L -n 查看iptables现有规则 iptables -F 清空所有自定义规则 iptables -P OUTPUT ACCEPT 所有出站一律绿灯 iptables -P FORWARD DROP 所有转发一律丢弃 iptables -I INPUT -s ***.***.***.*** -j DROP 封掉一个IP iptables -D INPUT -s ***.***.***.*** -j DROP 解封一个IP service iptables save 保存iptables配置信息 netstat -lnp|grep 88 查看端口占用 ps -aux|grep <进程号> 查看进程详细信息 rpm -q pkgname 查看软件是否安装 说在前面,如果不是root账号,命令前要加sudo。 安装软件的方法: 一、安装iptables 关闭firewall,请务必使用sudo 否则关闭不上。 # systemctl stop firewall.service # sudo systemctl stop firewalld.service 禁止firewall自启动,请务必使用sudo 否则关闭不上。 # systemctl disablefirewall.service #

After pip installing uWSGI there's no /etc/uwsgi/ directory - how can I use apps-enabled?

好久不见. 提交于 2019-12-03 17:50:21
问题 I've been using apt-get install uwsgi to install uWSGI for my Django application. Today, I realized I needed a feature that's not available until uWSGI 1.1, and Ubuntu 12.04.1 doesn't have anything after 1.0.x, at least according to my apt-get install uwsgi=1.1 attempt. So, I used: pip install http://projects.unbit.it/downloads/uwsgi-lts.tar.gz After doing so, I get a message prescribing the use of /usr/local/bin/uwsgi to launch the program. I'm not a guru when it comes to compiling from

Multiple server processes using nginx and uWSGI

自闭症网瘾萝莉.ら 提交于 2019-12-03 17:33:24
问题 I've noticed that you can start multiple processes within one uWSGI instance behind nginx: uwsgi --processes 4 --socket /tmp/uwsgi.sock Or you can start multiple uWSGI instances on different sockets and load balance between them using nginx: upstream my_servers { server unix:///tmp.uwsgi1.sock; server unix:///tmp.uwsgi2.sock; #... } What is the difference between these 2 strategies and is one preferred over the other? How does load balancing done by nginx (in the first case) differ from load