qwerty-learner icon indicating copy to clipboard operation
qwerty-learner copied to clipboard

如何部署在Ubuntu后台长期运行

Open lixun2015 opened this issue 1 year ago • 2 comments

第一次接触nodejs,部署在内网的Ubuntu上给学生做课前练习,通过ssh登录服务器启动网站,现在发现ssh客户端一断开,网站就访问不了

lixun2015 avatar Mar 28 '24 12:03 lixun2015

@lixun2015

linux screen by gnu 更新apt和安装screen: sudo apt update && sudo apt install screen 然后启动一个screen screen -S qwerty-server 启动完服务器后 ctrl-a + d detach screen就好了

Sma1lboy avatar Mar 31 '24 22:03 Sma1lboy

用 pm2 对 nodejs 进行进程守护

https://pm2.io/docs/runtime/guide/installation/

https://pm2.io/blog/2018/04/20/Node-js-clustering-made-easy-with-PM2

luojiyin1987 avatar Apr 05 '24 04:04 luojiyin1987