我已将 hastebin 安装在/var/www/paste/hastebin/
要启动 NPM 服务器,我必须导航到 hastebin 位置,然后输入:
npm start
这会让服务器运行起来
# npm start
> haste@0.1.0 start /var/www/paste/hastebin/
> node server.js
info: compressed application.js into application.min.js
info: loading static document name=about, path=./about.md
info: listening on 0.0.0.0:7777
debug: loaded static document success=true
如果我断开与 ssh session 的连接,我将无法再访问 example:7777
断开连接后我该怎么做才能保持其运行。
最佳答案
为了保持 session 打开,我建议安装 screen
运行 screen
打开“幕后”的终端 session - 然后,一旦运行 npm start
命令,只需按 CTRL+AD 即可与 screen session “断开连接”。
现在该服务应该在后台运行。
希望这有帮助!
关于node.js - Hastebin 服务器的 NPM 保持运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27496823/