阅读背景:

如何在AWS实例上保持持久性http-server打开

来源:互联网 

I set up a AWS Ubuntu instance running a http-server using node.js

我使用node.js设置了运行http-server的AWS Ubuntu实例

I was wondering if its possible to log out of my remote server while persistently keeping the http-server on.

我想知道是否有可能在持续保持http服务器的同时注销我的远程服务器。

3 个解决方案

#1


1  

This is a pretty good tutorial that deals with keeping a node.js server running, and amongst other things, deals with running it in the background.

这是一个非常好的教程,涉及保持node.js服务器运行,以及其他事项,处理在后台运行它。

https://blog.nodejitsu.com/keep-a-nodejs-server-up-with-forever/

#2


1  

Forever is a nice option (as suggested above).
Though, I recommend using AWS' Elastic Beanstalk over EC2 (that's the service you are using now, if I got it right), it provides you an easy interface to deploy you web-server with no ssh interference and keeps it alive at all times after deployment, and also gives you some other load balancing and auto scaling features with minimum effort.

永远是一个不错的选择(如上所述)。虽然,我建议使用AWS'Elastic Beanstalk over EC2(这是您现在使用的服务,如果我做对了),它为您提供了一个简单的界面来部署您的Web服务器,没有ssh干扰并始终保持活着部署之后,还可以轻松地为您提供其他一些负载平衡和自动缩放功能。

#3


0  

You could also use pm2 for this. Besides keeping your http-server online it also gives you the possibility to do load balancing and other tasks.

您也可以使用pm2。除了保持您的http服务器在线,它还为您提供了进行负载平衡和其他任务的可能性。

Run

npm install pm2 -g

on your server and start your app with

在您的服务器上启动您的应用程序

pm2 start app.js

As marekful points out, logging out of your Ubuntu server will not have any effect on your http-server.

正如marekful指出的那样,退出Ubuntu服务器不会对你的http服务器产生任何影响。


分享到: