ubuntu+web.py+fastcgi+nginx

  1. 安裝環境
add-apt-repository ppa:stevecrozz/ppa 
 apt-get update 
 apt-get install uwsgi
  1. 配置web.py
app = web.application(urls, globals()) 
 application = app.wsgifunc()
  1. 配置nginx
server {
     listen 80;
     server_name localhost;
     ...
     location / {
         include uwsgi_params;
         uwsgi_pass 127.0.0.1:9090;
     }

     location /static/ {
         root D:\Projects\PYTHON\webpy\nginxdemo;
         if (-f $request_filename) {
             rewrite ^/static/(.*)$ /static/$1 break;
         }
     }
     ...
 }
  1. 啓動web.py
uwsgi -s :9090 -w myapp -p 4 #併發4個線程:
  1. 啓動nginx
> service nginx start
> service nginx stop
> service nginx reload
相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息