1、nginx文件的配置

路径:/etc/nginx/conf.d/

example.conf

启动:service nginx [start]/[restart]/[stop]

upstream django {
# server unix:///path/to/your/mysite/mysite.sock; # for a file socket
server 127.0.0.1:8000; # for a web port socket (we'll use this first)
} # configuration of the server
server {
# the port your site will be served on
listen 8080;
# the domain name it will serve for
server_name django; # substitute your machine's IP address or FQDN
charset utf-8; # max upload size
client_max_body_size 75M; # adjust to taste
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include uwsgi_params; # the uwsgi_params file you installed
} location /static{
alias /var/www/learning_web/static;
}
location /static/admin {
alias /usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin;
} }

2、uwsgi文件的配置

在项目的根目录下面,与manage.py同目录

example_uwsgi.ini

启动:uwsgi --ini example_uwsgi.ini

# uwsgi.ini file
[uwsgi] # Django-related settings
# the base directory (full path)
chdir = /var/www/learning_web
# Django's wsgi file
wsgi-file = /var/www/learning_web/learnchinese/wsgi.py
# module = index.wsgi:application
# the virtualenv (full path)
# home = /path/to/virtualenv
daemonize = /var/www/learning_web/learnchinese/uwsgi.log
# process-related settings
# master
master = true
pidfile = /tmp/learnchinese_master.pid
# maximum number of worker processes
processes = 1
# the socket (use the full path to be safe
# socket = /home/python/ocean_monitor/ocean_monitor.sock
socket = 127.0.0.1:8000
# ... with appropriate permissions - may be needed
chmod-socket = 664
# clear environment on exit
vacuum = true

停止:

ps -aux | grep 'ecs_uwsgi.ini' | grep -v grep |cut -c 9-15|xargs kill -9

(慎用,看清杀死的进程)

最新文章

  1. CuPlayer
  2. CSS-学习笔记一
  3. MATLAB中plot()画图的颜色线型和希腊字母参数设置
  4. 基于UDP协议的程序设计
  5. flexigrid随手记
  6. 2-SAT开坑
  7. 【leetcode❤python】235. Lowest Common Ancestor of a Binary Search Tree
  8. Oracle数据库编程:在JDBC中应用Oracle
  9. Hibernate中的事务隔离
  10. Android应用程序请求SurfaceFlinger服务创建Surface的过程分析
  11. Linux好书、经典书籍推荐
  12. 至linuxNIC添加多个IP
  13. dubbo 入门
  14. vue零基础学习--搭建项目
  15. POJ:1833 按字典序找到下一个排列:
  16. Atcoder Beginner Contest 070 D - Transit Tree Path
  17. 【ML】ICLR2016_Delving Deeper into Convolutional Networks
  18. Codeforces 444 C - DZY Loves Colors
  19. 【sping揭秘】9、容器内部事件发布(二)
  20. Java 基本语法---流程控制

热门文章

  1. Day13_74_守护线程
  2. 浅析 Find My 原理
  3. 代码安全丨第二期:URL重定向(跳转)漏洞
  4. Kubernetes 普及系列:容器基础入门
  5. 1109 Group Photo (25分)
  6. C - Harmonic Number(调和级数+欧拉常数)
  7. 功能:Java8新特性steam流
  8. 关于CSS3背景渐变色无效问题
  9. UVA11549计算器谜题
  10. Error starting userland proxy: /forwards/expose/port returned unexpected status: 500.