Nginx 和 pm2

  1. nginx 前端配置, /etc/nginx/nginx.conf 只需要在 http中添加 server,文件中的其他内容无须修改

    http { // http 中包含 多个 server
    server {
    listen 8100; // 监视端口
    server_name localhost;
    #charset koi8-r;
    #access_log /var/log/nginx/log/host.access.log main;
    location / {
    root /root/ckq/dist; # 工程 位置
    index index.html;
    autoindex on;
    try_files $uri $uri/ /index.html;
    }
    }
    server {
    listen 8101; # 监视端口
    server_name localhost;
    #charset koi8-r;
    #access_log /var/log/nginx/log/host.access.log main;
    location / {
    root /home/lab421/Documents/cxb/dist;
    index index.html;
    autoindex on;
    try_files $uri $uri/ /index.html;
    }
    }
    }

  2. nginx 操作

    sudo nginx -c /etc/nginx/nginx.conf // 重启 nginx
    sudo nginx -s stop // 关闭nginx
    sudo nginx -s reload 重新加载nginx (配置文件修改后)

  3. 启动出现的错
    参考网站 https://blog.csdn.net/a1007720052/article/details/82255226

  4. pm2
    http://pm2.keymetrics.io/docs/usage/quick-start/#cheatsheet pm 官网

  5. pm2 操作
    pm2 list // 查看当前后台运行进程以及状态
    pm2 stop all # 停止所有进程
    pm2 restart all #重启所有进程
    pm2 reload all # 重新读取配置文件
    pm2 stop 0 # 停止 id = 0 的进程
    pm2 restart 0 # 重新启动 id = 0的进程
    pm2 delete 0 # 删除 id = 0 的进程
    pm2 delete all # 删除所有进程

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值