我怎样才能自动启动在亚马逊的Linux AMI上AWS使Node.js应用程序? [英] How can I automatically start a node.js application in Amazon Linux AMI on aws?
问题描述
有一个简短的指南,解释了如何在实例启动和运行启动一个应用程序?如果它是通过百胜
安装服务,那么我想我可以用一个 / sbin目录/ chkconfig的
将其添加到服务。 (为了可以肯定的,是正确的吗?)
Is there a brief guide to explain how to start up a application when the instance starts up and running? If it were one of the services installed through yum
then I guess I can use /sbin/chkconfig
to add it to the service. (To make it sure, is it correct?)
不过,我只是想运行这是不是通过百胜
安装该程序。要运行的node.js程序,我将要运行脚本 sudo的节点app.js
在主目录每当系统启动。
However, I just want to run the program which was not installed through yum
. To run node.js program, I will have to run script sudo node app.js
at home directory whenever the system boots up.
我不习惯亚马逊的Linux AMI所以我有一点很难找到一个正确的方式,在每次启动时自动运行一些脚本。
I am not used to Amazon Linux AMI so I am having little trouble finding a 'right' way to run some script automatically on every boot.
有一种优雅的方式来做到这一点?
Is there an elegant way to do this?
推荐答案
这可以通过的的init.d 脚本。
这篇关于我怎样才能自动启动在亚马逊的Linux AMI上AWS使Node.js应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!