Interesting. I'd love to pick your brain about best practices with ensuring delivery of my NGINX and Node Apps.
My production environment is running Ubuntu 14.04, and my local development environment is running Ubuntu 14.04 emulated on VirtualBox on a Windows 7 Pro x64 host machine. Recently I learned how to parse command line arguments given to the node process so that I can indicate to my node app whether I want to run it in a set environment (development/staging/production) or to let it look for the NODE_ENV local environment variable, or default to development if not specified. But ensuring that NGINX and the Node apps auto run on server start; I never even gave that much thought! I've recently downloaded PM2 and am reading up on documentation for it to ensure that specified Node apps are run when the server starts. It also ensures that if the apps crash, they are restarted (go availability!). But as for NGINX. My OSX laptop is mostly for development when I'm out of the house. Otherwise I'm developing "through" Windows on Ubuntu (I gave my virtual machine 2 of 6 cores, 4 of 16GB RAM and 100GB of 500GB as far as resources go, so it more than emulates my hosts's 2-core, 1GB, 30GB instance. But if you have information on how to setup NGINX to auto-start on server boot, I'd love to hear that. On Mon, Sep 14, 2015 at 12:07 AM, Ryan Schmidt <[email protected]> wrote: > > On Sep 9, 2015, at 8:53 AM, Aaron Martone wrote: > > > And for clarification, what you're saying about the Node/App side of > things, can you throw me a hint or 2 about some tech used for more > automated assurances to run my apps? Are we talking about things like > Forever, or services that work to constantly ensure that if the Node > process dies, it is spun back up without my need to manually do it? > > If you're just testing a node app, you can start it on the command line, > no problem. > > If you want that app to run a production web site, you'll want to take > care of two things: > > 1. starting your node app when the your boots (even if you don't plan to > reboot your vps ever, it might reboot for reasons outside of your control, > including the whims of your hosting provider and unexpected power loss) > > 2. restarting your node app if it quits (most node apps are designed to > quit when they encounter an unexpected situation, and also your app might > crash) > > On OS X, launchd would handle both of those things, if asked to do so via > a config file (plist) that you would write. On Linux variants that use > systemd, it would handle both, again if so configured. AFAIK the majority > of Linux variants do not use systemd, so you may need to handle these two > things separately, using whatever facilities are built into your flavor of > Linux, or using other tools. I don't use Linux so I can't guide you > specifically. > > -- > Job board: http://jobs.nodejs.org/ > New group rules: > https://gist.github.com/othiym23/9886289#file-moderation-policy-md > Old group rules: > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines > --- > You received this message because you are subscribed to a topic in the > Google Groups "nodejs" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/nodejs/8yH6BbvHBrw/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/nodejs/A1310D89-008C-4E95-A1E6-07996A3734EC%40ryandesign.com > . > For more options, visit https://groups.google.com/d/optout. > -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You received this message because you are subscribed to the Google Groups "nodejs" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/CAA05c7%2BGKvchBCu_vdqQHxHv9-N9H6hYU0KzyiRBmeWnsORFHQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
