老莫的笔记本  
  
查看: 1234|回复: 1

一个KOA2 项目 从 上传 到pm2运行 所有命令

[复制链接]

662

主题

878

帖子

5143

积分

超级版主

Rank: 8Rank: 8

积分
5143
发表于 2019-1-28 14:13:17 | 显示全部楼层 |阅读模式
  1. root@iZrw6ygjfli2j3Z:~# ls -a
  2. .              .bashrc  .dbshell     node-v8.9.3-linux-x64      .pip      .pydistutils.cfg  .ssh
  3. ..             .cache   .distlib     node-v8.9.3-linux-x64.tar  .pm2      .python-eggs      .viminfo
  4. .bash_history  .config  .mongorc.js  .npm                       .profile  .rnd
  5. root@iZrw6ygjfli2j3Z:~# cd www
  6. -bash: cd: www: No such file or directory
  7. root@iZrw6ygjfli2j3Z:~# cd /www
  8. root@iZrw6ygjfli2j3Z:/www# cd wwwroot/
  9. root@iZrw6ygjfli2j3Z:/www/wwwroot# cd a.wangjingting.top/
  10. root@iZrw6ygjfli2j3Z:/www/wwwroot/a.wangjingting.top# npm install
  11. > nodemon@1.18.9 postinstall /www/wwwroot/a.wangjingting.top/node_modules/nodemon
  12. > node bin/postinstall || exit 0
  13. sh: node: command not found
  14. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
  15. npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
  16. added 409 packages from 281 contributors and audited 2607 packages in 11.395s
  17. found 1 low severity vulnerability
  18.   run `npm audit fix` to fix them, or `npm audit` for details
  19. root@iZrw6ygjfli2j3Z:/www/wwwroot/a.wangjingting.top# pm2 start ./bin/www
  20. [PM2] Starting /www/wwwroot/a.wangjingting.top/bin/www in fork_mode (1 instance)
  21. [PM2] Done.
  22. ┌──────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬──────┬──────────┐
  23. │ App name │ id │ version │ mode │ pid   │ status │ restart │ uptime │ cpu │ mem       │ user │ watching │
  24. ├──────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼──────┼──────────┤
  25. │ www      │ 0  │ 0.1.0   │ fork │ 6900  │ online │ 27      │ 17D    │ 0%  │ 63.0 MB   │ root │ disabled │
  26. │ www      │ 1  │ 0.1.0   │ fork │ 17277 │ online │ 0       │ 0s     │ 0%  │ 17.4 MB   │ root │ disabled │
  27. └──────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴──────┴──────────┘
  28. Use `pm2 show <id|name>` to get more details about an app
  29. root@iZrw6ygjfli2j3Z:/www/wwwroot/a.wangjingting.top#
复制代码
比较奇怪的 就是 根目录 的进入 与选择
回复

使用道具 举报

662

主题

878

帖子

5143

积分

超级版主

Rank: 8Rank: 8

积分
5143
 楼主| 发表于 2019-1-28 16:05:48 | 显示全部楼层
本帖最后由 周大胖子 于 2019-1-28 16:14 编辑

这一大串搞定之后 下面这么做:
1. 跑去 bin/www文件  改掉端口号  
2. 跑去 网站-》设置 反向代理 中 目标URL 输入  http://a.wangjingting.top:39002   发送域名输入 http://a.wangjingting.top  然后 启用
3. 再跑去 执行PM2  启动项目
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表