分类: 系统运维
2015-04-16 18:37:51
参考:http://www.cnblogs.com/xiongpq/p/3381069.html
wget 或
easy_install uwsgi
tar zxf Django-1.6.5.tar.gz
python setup.py install
django-admin.py startproject monitor
cd monitor/
chmod a+x manage.py
django-admin.py startapp app01
yum -y install zlib-devel bzip2-devel pcre-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel
[/conf]# more /etc/uwsgi9090.ini
[uwsgi]
socket = 127.0.0.1:9090
master = true
vhost = true
no-stie = true
workers = 2
reload-mercy = 10
vacuum = true
max-requests = 1000
limit-as = 512
buffer-sizi = 30000
pidfile = /var/run/uwsgi9090.pid
daemonize = /var/www/monitor/uwsgi9090.log
more nginx.conf
server {
listen 80;
server_name localhost;
location /static {
alias /var/www/monitor/static ;
}
location / {
include uwsgi_params;
#必须和uwsgi中的设置一致
uwsgi_pass 127.0.0.1:9090;
#入口文件,即wsgi.py相对于项目根目录的位置,“.”相当于一层目录
uwsgi_param UWSGI_SCRIPT monitor.wsgi;
#项目根目录
uwsgi_param UWSGI_CHDIR /var/www/monitor;
index index.html index.htm;
client_max_body_size 35m;
}
}