1.安装nginx并添加脚本
yum install nginx
脚本参考资料:centos下nginx启动脚本和chkconfig管理
2.编译uwsgi
wget http://projects.unbit.it/downloads/uwsgi-2.0.6.tar.gz tar zxvf uwsgi-2.0.6.tar.gz cd uwsgi-2.0.6 make
然后将编译出来的 uwsgi 复制到系统目录
立即学习“Python免费学习笔记(深入)”;
cp ./uwsgi /usr/bin/
3.配置nginx
vim /etc/nginx/nginx.conf
在末尾添加 include /etc/nginx/sites-enabled/*.conf;
然后新建 sites-enabled 文件夹,并创建 tzw0745.cn.conf
参考资料:Nginx+uWSGI安装与配置
参考配置文件:
server {
listen 80;
server_name tzw0745.cn;
location / {
include uwsgi_params;
uwsgi_pass 127.0.0.1:9090;
}
}4.配置uwsgi站点
在站点根目录建立uwsgi启动配置文件,如
<uwsgi><pythonpath>/var/www/tzw0745</pythonpath> #网站根目录 <module>run</module> #主文件 <callable>app</callable> #程序入口 <socket>127.0.0.1:9090</socket> #监听端口 <processes>1</processes> #线程数 <py-autoreload>1</py-autoreload> #自动重载 </uwsgi>
5.其他
uwsgi -x abc.xml -d uwsgi.log killall -9 uwsgi #接结束进程
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });
以上就介绍了nginx+uwsgi+Python,包括了python,nginx方面的内容,希望对PHP教程有兴趣的朋友有所帮助。











