Thanks Graham. Sadly, not too familiar with shell scripting (but I am getting into it, and can see how powerful it is) Right now, since I'm so new to Ubuntu, just learning the filesystem is a bit disorientating at first; but slowly I am finding articles and resources that are clarifying. It's true that an OS like this is really a configuration that loads a configuration which loads a configuration, lol. As confusing as that can be to someone new, I do know that it also leverages a level of customization that is probably one of the main reasons people herald the OS in the first place.
So far, I've custom installed NGINX, Node/NPM and Mongo via apt-get; I have my Node apps running automatically via PM2, and now just have to find a resource to find how Ubuntu loads NGINX, so I can pass it the -c switch along with the path to my new .nginx.conf. But as I'm sure we all here know, this field is a never-ending battle of learning new skills. That sense of challenge (and triumph once you figure it out) is rewarding on the pro side, but very time consuming on the con, lol. Thanks to all for the push in the right direction! On Mon, Sep 14, 2015 at 11:51 AM, Ryan Graham <[email protected]> wrote: > The Ubuntu package for nginx would have set it to start automatically, if > I recall correctly. I don't recall off the top of my head if it uses sysv > init scripts or Upstart, though. > > Since you are on Digital Ocean, you may have noticed that they offer > credits for users who write how-to guides. As a result, there are actually > a large number of step by step guides specifically for what you are doing. > There is literally a guide for setting up node + nginx on Ubuntu 14.04. > Please don't take that as an RTFM, more as a reference to a source of > information that doesn't involve waiting for a someone to reply and that > reply to go through moderation ;-) > > I'm not sure how familiar you are with shell scripting, so this may or may > not be obvious to you. If you keep notes on what commands you run in your > local VM so that you can copy/paste them into your remote VM, there are > decent odds that the file you are storing those notes in could be run > directly as a shell script instead of one line at a time. > > ~Ryan > > On Mon, Sep 14, 2015, 8:31 AM Aaron Martone <[email protected]> > wrote: > >> 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 >> <https://groups.google.com/d/msgid/nodejs/CAA05c7%2BGKvchBCu_vdqQHxHv9-N9H6hYU0KzyiRBmeWnsORFHQ%40mail.gmail.com?utm_medium=email&utm_source=footer> >> . >> 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 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/CAGjmZGz%3D%2BkjY87iD3h%2BgqRauoBuysqr6ZN8RcYzaz148cYuJiA%40mail.gmail.com > <https://groups.google.com/d/msgid/nodejs/CAGjmZGz%3D%2BkjY87iD3h%2BgqRauoBuysqr6ZN8RcYzaz148cYuJiA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > > 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/CAA05c7KETUPnSwf26ipjFD_NHdccqtcn7J55YWQtm6SkffrVgA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
