On Jan 16, 2015, at 5:21 PM, Bruce Whealton wrote: > I'm trying to figure out how to deploy and run a node.js app on > my vps server. I have vps hosting. I have been using NGINX... previously I > was using Apache but decided NGINX would work better. Anyway, I'm trying to > figure out how to run a Full Stack JavaScript environment in addition to the > regular LAMP stack - I guess it is a LEMP stack, actually. > I've done some searches on this but it is hard to find an answer > to what I am trying to do. I hear about platforms for hosting node.js apps > but since I already pay for a VPS hosting plan, I'd like to see if it is > possible to run a node.js server somehow. Would I need to run it on a > different port? I read somewhere about using a configuration that would > direct a sub-domain to use a node server. Maybe I need to get a different IP > address from my provider. The other IP address would be used for the node > server. I guess in this scenario, I'd need to setup my DNS to map the > different IP to the sub-domain. Even as I write this right now, this doesn't > make sense really. I do have an extra domain that I could use for my node > based server (which would use the MEAN stack). > Can anyone provide any tips or directions for this?
Often, people use nginx in front of nodejs. In other words, nginx will run on port 80 on your public IP address and that's what users will communicate with. In addition, you run nodejs on a private port number, such as 3000, open only to localhost, and nginx is configured to talk to that when necessary to reach your app. You can run any number of such apps, each on their own ports (e.g. 3001, 3002), and the single nginx instance talks to them as needed. You can additionally configure nginx to handle the static content (e.g. images, stylesheets) while passing dynamic requests to your app. nginx can handle compression and tls encryption for you. nginx can even cache dynamic requests from your app, if your app sends applicable caching headers allowing it to do so. You can restart your node apps independently of one another as needed to reload them with new code, without affecting the other apps. Each app can use the cluster module and spawn as many instances as you think are likely to be needed by that particular app. By searching Google for "nginx node" you should be able to find many guides showing how this kind of thing can be set up. -- 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/1C854B46-AAAC-44D6-8F3B-7DDA4B8C3BBB%40ryandesign.com. For more options, visit https://groups.google.com/d/optout.
