linux 服务器部署

1.apt-get update 更新软件源

2.确保安装ssh服务,方便从本地连接服务器

3.sudo apt-get install nginx gunicorn python-gevent supervisor mysql-server

4. sudo apt-get install python-jinja2 python-mysql.connector

5.mysql -u root -p < schema.sql

6.sudo easy_install(pip install) supervisor==3.0b2

7.echo_supervisord_conf > /etc/supervisord.conf

配置:

[program:xxx]

command     = /usr/bin/gunicorn --bind 127.0.0.1:9000 --workers 1 --worker-class gevent wsgiapp:application

directory   = /srv/xxx/www

user        = root

startsecs   = 3

 

redirect_stderr         = true

stdout_logfile_maxbytes = 50MB

stdout_logfile_backups  = 10

stdout_logfile          = /srv/xxx/log/app.log

 

command:

sudo supervisord sudo supervisorctl

link:http://tuzii.me/diary/522dc528848eea683d7724f2/%E8%A7%A3%E5%86%B3ubuntu-supervisor-unix:var-run-supervisor.sock-no-such-file.%E7%9A%84%E6%96%B9%E6%B3%95

其他:

$ sudo supervisorctl reload
$ sudo supervisorctl start awesome
$ sudo supervisorctl status

8.应用打包发布

9.依赖模块安装

10。/etc/nginx/sites-available/目录下放入配置文件

server {

    listen      80; 

 

    root       /srv/xxx/www;

    access_log /srv/xxx/log/access_log;

    error_log  /srv/xxx/log/error_log;

 

 

    location /favicon.ico {

        root /srv/xxx/www;

    }

 

  

    location ~ ^\/static\/.*$ {

        root /srv/xxx/www;

    }

 

   

    location / {

        proxy_pass       http://127.0.0.1:9000;

        proxy_set_header X-Real-IP $remote_addr;

        proxy_set_header Host $host;

        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

        client_max_body_size    100m;

    }

}

11./etc/nginx/sites-enabled/目录下创建软链接:sudo ln -s /etc/nginx/sites-available/awesome .

12.重启nginx:  sudo /etc/init.d/nginx reload

13.filezile上传文件:

http://jingyan.baidu.com/article/3d69c5516f4b82f0cf02d7a2.html

 

转载于:https://my.oschina.net/u/1474965/blog/787237

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值