一个KOA2 项目 从 上传 到pm2运行 所有命令
root@iZrw6ygjfli2j3Z:~# ls -a. .bashrc.dbshell node-v8.9.3-linux-x64 .pip .pydistutils.cfg.ssh
.. .cache .distlib node-v8.9.3-linux-x64.tar.pm2 .python-eggs .viminfo
.bash_history.config.mongorc.js.npm .profile.rnd
root@iZrw6ygjfli2j3Z:~# cd www
-bash: cd: www: No such file or directory
root@iZrw6ygjfli2j3Z:~# cd /www
root@iZrw6ygjfli2j3Z:/www# cd wwwroot/
root@iZrw6ygjfli2j3Z:/www/wwwroot# cd a.wangjingting.top/
root@iZrw6ygjfli2j3Z:/www/wwwroot/a.wangjingting.top# npm install
> nodemon@1.18.9 postinstall /www/wwwroot/a.wangjingting.top/node_modules/nodemon
> node bin/postinstall || exit 0
sh: node: command not found
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 409 packages from 281 contributors and audited 2607 packages in 11.395s
found 1 low severity vulnerability
run `npm audit fix` to fix them, or `npm audit` for details
root@iZrw6ygjfli2j3Z:/www/wwwroot/a.wangjingting.top# pm2 start ./bin/www
Starting /www/wwwroot/a.wangjingting.top/bin/www in fork_mode (1 instance)
Done.
┌──────────┬────┬─────────┬──────┬───────┬────────┬─────────┬────────┬─────┬───────────┬──────┬──────────┐
│ App name │ id │ version │ mode │ pid │ status │ restart │ uptime │ cpu │ mem │ user │ watching │
├──────────┼────┼─────────┼──────┼───────┼────────┼─────────┼────────┼─────┼───────────┼──────┼──────────┤
│ www │ 0│ 0.1.0 │ fork │ 6900│ online │ 27 │ 17D │ 0%│ 63.0 MB │ root │ disabled │
│ www │ 1│ 0.1.0 │ fork │ 17277 │ online │ 0 │ 0s │ 0%│ 17.4 MB │ root │ disabled │
└──────────┴────┴─────────┴──────┴───────┴────────┴─────────┴────────┴─────┴───────────┴──────┴──────────┘
Use `pm2 show <id|name>` to get more details about an app
root@iZrw6ygjfli2j3Z:/www/wwwroot/a.wangjingting.top#
比较奇怪的 就是 根目录 的进入 与选择
本帖最后由 周大胖子 于 2019-1-28 16:14 编辑
这一大串搞定之后 下面这么做:
1. 跑去 bin/www文件改掉端口号
2. 跑去 网站-》设置 反向代理 中 目标URL 输入http://a.wangjingting.top:39002 发送域名输入 http://a.wangjingting.top然后 启用
3. 再跑去 执行PM2启动项目
页:
[1]