一 .centos的相关依赖安装html
二.数据库服务的安装python
三.python虚拟环境mysql
四.安装及测试nginx
def application(env, start_response): start_response('200 OK', [('Content-Type','text/html')]) return [b"Hello World"]
[uwsgi] socket = 服务器IP:8001 #注如在同一服务器上能够使用127.0.0.1 chdir = /home/foobar/myproject/ wsgi-file = myproject/wsgi.py master = true processes = 4 threads = 2
upstream django { server IP:8001; #对应uwsgi.ini中socket,也可一写为127.0.0.1 } # configuration of the server server { listen 8000; #对应浏览器 server_name IP; charset utf-8; access_log /var/log/nginx/blog_access.log; client_max_body_size 8M; # adjust to taste location /media { #配置上传文件 alias /usr/local/site/demo/project-blog/media; } location /static { #配置静态文件 alias /usr/local/site/demo/project-blog/static; } location / { uwsgi_pass django; #对应upstream django include /etc/nginx/uwsgi_params; } }