项目目录:/root/app
Uwsgi的配置文件
[uwsgi]
pythonpath=/usr/local/src/python3/lib/python3.5/site-packages
chdir=/root/app
wsgi-file=app/wsgi.py
env = DJANGO_SETTINGS_MODULE=app.settings
module=app.wsgi:application
chmod-socket = 664
socket=:8081
master=true
processes=2
py-autoreload=1
lazy-apps=true
buffer-size = 32768
enable-threads = true
vhost=true
no-site=true
workers=2
reload-mercy=10
vacuum=true
harakiri = 60
max-requests=1000
limit-as=512
buffer-size=30000
listen = 120
pidfile=/var/run/uwsgi_8081.pid
daemonize=/var/run/uwsgi_8081.log
log-maxsize = 5000000
disable-logging = true
启动命令:uwsgi --ini /root/app/uwsgi.ini
目录结构
├── app
│ ├── init.py
│ ├── pycache
│ │ ├── init.cpython-35.pyc
│ │ ├── settings.cpython-35.pyc
│ │ ├── urls.cpython-35.pyc
│ │ └── wsgi.cpython-35.pyc
│ ├── settings.py
│ ├── urls.py
│ └── wsgi.py
├── appv1
│ ├── admin.py
│ ├── apps.py
│ ├── init.py
│ ├── migrations
│ │ └── init.py
│ ├── models.py
│ ├── pycache
│ │ ├── admin.cpython-35.pyc
│ │ ├── init.cpython-35.pyc
│ │ └── models.cpython-35.pyc
│ ├── tests.py
│ └── views.py
├── manage.py
└── uwsgi.ini
nginx配置
upstream apachephp {
server 127.0.0.1:8081;
}
server {
listen 80;
server_name luffy.cyqit.com;
root html;
index index.html index.htm index.php;
include /application/nginx/conf/conf.d/gzip/gzip.conf;
## send request back to apache ##
location / {
include uwsgi_params;
uwsgi_pass apachephp;
uwsgi_param UWSGI_SCRIPT app.wsgi;
uwsgi_param UWSGI_CHDIR /root/app/;
index index.html index.htm;
client_max_body_size 35m;
}
}
手机扫一扫
移动阅读更方便
你可能感兴趣的文章