By macbroadcast
Hello everybody , i just installed mean on my droplet , is it nessesary to configure “forever” or what other workaround is required in order to make it run permanently.
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The MEAN image simply provides you with a good starting point to build your project. It comes with Node and MongoDB preinstalled. In order to keep your project running, there are a number of approaches that you can take. Personally, I like to use the native init system as it allows you to manage your project like any other service on your server using commands like sudo service myapp restart
On Ubuntu 14.04, the init system is Upstart. You can use it to start and keep running Node apps. For example, DigitalOcean’s one-click Ghost app uses an Upstart script to have Ghost start on boot. It looks like:
description "Ghost: Just a blogging platform"
start on (local-filesystems and net-device-up IFACE=eth0)
stop on runlevel [!12345]
# If the process quits unexpectedly trigger a respawn
respawn
setuid ghost
setgid ghost
env NODE_ENV=production
chdir /var/www/ghost
exec /usr/local/bin/npm start --production
pre-stop exec /usr/local/bin/npm stop --production
and it is installed to /etc/init/ghost.conf Of course, you’ll need to update it to reflect your project, but hopefully that points you in the right direction.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.