阿里云服务器ubuntu部署django

通过guhuangwudi@gmail.com

阿里云服务器ubuntu部署django

参考资料

http://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html#configuring-uwsgi-to-run-with-a-ini-file

http://www.runoob.com/linux/linux-command-manual.html(Linux 命令大全)

Ubuntu 命令大全

http://www.ziqiangxuetang.com/django/django-views-urls.html (自强学堂 django)

https://yq.aliyun.com/articles/36339?spm=5176.100239.blogcont45104.14.FsG1Ve(阿里云栖社区 通过Nginx部署Django(基于ubuntu))

http://www.liaoxuefeng.com/wiki/0014316089557264a6b348958f449949df42a6d3a2e542c000 (廖雪峰python教程)

http://www.jianshu.com/p/e6ff4a28ab5a(简书 基于nginx和uWSGI在Ubuntu上部署Django)

http://tengine.taobao.org/book/index.html(Nginx开发从入门到精通)

http://www.cnblogs.com/chenjiahe/p/5956002.html(/etc/nginx/nginx.conf配置文件详解)

http://www.cnblogs.com/usergaojie/p/4583796.html(vim命令详解)

一些有用的参考教程:

Django 官网部署教程:

https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/gunicorn/

https://docs.djangoproject.com/en/dev/howto/deployment/wsgi/uwsgi/

nginx 与 socket

http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html#configure-nginx-for-your-site

防火墙:

iptables: https://www.digitalocean.com/community/tutorials/how-to-setup-a-basic-ip-tables-configuration-on-centos-6

centos 7 FireWalld: http://stackoverflow.com/questions/24756240/how-can-i-use-iptables-on-centos-7

ubuntu ufw 防火墙:http://wiki.ubuntu.org.cn/Ufw%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8D%97

uwsgi ini 配置文件:http://uwsgi-docs.readthedocs.org/en/latest/tutorials/Django_and_nginx.html#configuring-uwsgi-to-run-with-a-ini-file

1 . sudo apt-get install nginx  #安装

如果提示:Unable to locate package错误,解决方法非常简单,终端输入以下命令即可: 

sudo apt-get update
2.启动Nginx:
/etc/init.d/nginx start  #启动
/etc/init.d/nginx stop  #关闭
/etc/init.d/nginx restart  #重启

3.修改Nginx配置文件,打开/etc/nginx/nginx.conf 文件

vim /etc/nginx/nginx.conf

4.安装uwsgi   用python的pip安装最简单:

apt-get install python-dev#不安装这个,下面的安装可能会失败
pip install uwsgi

5.安装django

pip install django

关于作者

guhuangwudi@gmail.com administrator

孤皇吾帝