The node program can consider installing forever on the server, and then start it with forever start your_js_file.js. After that, you can use forever list to view the running programs, and use forever stop to stop the process.
The more common method is to use the nohup command to start the process. The disadvantage is that the program will not automatically restart when it stops.
The node program can consider installing forever on the server, and then start it with
forever start your_js_file.js
. After that, you can use forever list to view the running programs, and use forever stop to stop the process.The more common method is to use the nohup command to start the process. The disadvantage is that the program will not automatically restart when it stops.
pm2, or forever, are both open source on github, search them
supervisord
screen
I happened to see something about this when I was reading Ghost’s documentation a few days ago. You can refer to it:
Excerpted from
http://docs.ghostchina.com/zh/installation/deploy/
It is recommended to use pm2, it is very easy to use, nodejs process manager
Thank you everyone above, I just encountered this problem too.
Use
forever
to managenode.js
processesOff topic,
nginx
It’s really useful.