Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Is there a Node.js Server Guide?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Is there a Node.js Server Guide?

Im trying to set up a small node js server for testing purposes. Im curious, is there a quick guide that anyone recommend that i should follow?

What i need is some clear instructions to setup a nodejs website on a blank VPS (running centos, debian or ubuntu). Need to be able to somehow upload files to the server (maybe a method of ftp, git etc), and to be able to map a domain name to each app/website (mydomain.com). Im guessing there arnt very easy control panels like those for php stacks.

Would be great if the guide is production ready. As in, i can finish the guide and then that would ensure the website(s) is/are running properly without any issue. Mainly, in case of a server restart, i would assume the websites/apps/processed would start up again and continue to run as before?

There are a lot of guides online, but i cannot really easily narrow down where to start and whats good/bad. Any suggestions welcome. :)

Comments

  • Okay, this doesn't make much sense. Node.js is a programming language, not a server in the sense of "lighttpd" or "apache".

  • @0xdragon said:
    Okay, this doesn't make much sense. Node.js is a programming language, not a server in the sense of "lighttpd" or "apache".

    Wellllll some see it differently since you can write around 4 lines of code to get a web server up and running ;)

    I believe this is the first example on the homepage http://nodejs.org

  • 0xdragon0xdragon Member
    edited January 2015

    @ATHK said:
    I believe this is the first example on the homepage http://nodejs.org

    Python is exactly the same, lol: python -m SimpleHTTPServer 8080

    You can write a web server in almost any programming language.

  • 0xdragon said: Okay, this doesn't make much sense. Node.js is a programming language, not a server in the sense of "lighttpd" or "apache".

    Ok, let me be very very specific. I thought what i wrote was clear, but guess not.

    i have a hello world node js App (or if you want more complicated example, i have a web site written in express.js). I also have a vps (pick OS: centos, debian, ubuntu). Now, how can I put my website (or app) visible to the world on example.com (which i also own and has access to the DNS).

    Now extend this a little further, by adding a 2nd or a 3rd website (also requires to be hosted on the same server).

    Then extend this also a little further by making it somewhat production ready (by making sure i have an ability to upload, ftp maybe, way to auto start up the node apps when server restarts, any other settings? admin panel if one exists?).

    Sorry if it confused you. When i say "Node.js Server", i mean a server that hosts a node.js application. Same way when you say a "Php server", you dont actually mean a server written in php. In my case, i dont really care about the OS (so long as its a commonly offered OS on a LET VPS providers). Maybe we use different terminology (im just trying to be noob friendly), but atleast this clarifies things?

    Currently i can use heroku, but im looking for a solution that i have more control over on a VPS i control.

  • @decay said:
    Currently i can use heroku, but im looking for a solution that i have more control over on a VPS i control.

    for deploying multiple nodejs apps on single server you can use nginx for reverse proxy. if your node js apps are some of the popular apps you could easily deploy it using docker, all you need is kvm based vps

  • Ryan22 said: for deploying multiple nodejs apps on single server you can use nginx for reverse proxy. if your node js apps are some of the popular apps you could easily deploy it using docker, all you need is kvm based vps

    Im using popular test apps as an example, but my main purpose of this question is to learn how a custom written nodejs application gets setup in production.

    For the sake of conversation, here are some applications/websites (essentially they are websites) that are similar to what i want to host: http://amirrajan.net/nodejs-by-example/

    Thanks for suggestions, im still looking for some detailed guide that i can follow to get things like this setup for production.

  • ATHKATHK Member
    edited January 2015

    Reverse proxy will definitely help when having multiple sites, the second thing you need is some sort of demonized script or a keep me alive type script. If NODEJS fails you need to manually restart it, unless you have one of those scripts of course...

  • it sucks when Apache and Nginx dont naturally play well with other languages except PHP. why cant we just install Apache and install nodejs and then just start coding without worrying about setup a reverse proxy or CGI or whatever. this is all politics where PHP bribe everyone. just like Centos bribe Cpanel to be only used in centos.

  • frankfrank Member
    edited January 2015

    @ATHK said:
    Reverse proxy will definitely help when having multiple sites, the second thing you need is some sort of demonized script or a keep me alive type script. If NODEJS fails you need to manually restart it, unless you have one of those scripts of course...

    Its will definitely help but its kind of mandatory. Never allow an App to be forward facing to the net, always put it behind a proxy, both for speed and security.

    Tons of NodeJS guides out there, other key thing to remember is to use a tool to restarting the NodeJS instance in case it crashes and dies. Think there are a few ways out there to do that, but easiest is with Forever (install it via npm, or think you can just add it to your project and it will do its stuff).

    edit: gah just saw @perennate's answers he covered it, and with links :)

  • @creep said:
    it sucks when Apache and Nginx dont naturally play well with other languages except PHP. why cant we just install Apache and install nodejs and then just start coding without worrying about setup a reverse proxy or CGI or whatever. this is all politics where PHP bribe everyone. just like Centos bribe Cpanel to be only used in centos.

    McDonalds is hiring, you'll impress them with your capacity for in-depth understanding of things.

  • @frank said:
    Its will definitely help but its kind of mandatory. Never allow an App to be forward facing to the net, always put it behind a proxy, both for speed and security.

    For speed, yes, in some cases (e.g. static file serving). For security, only if the app is not meant to be serving in the public facing net.

  • Thanks a lot guys. I will go through the list tomorrow, I think there's enough info on the links to do what I need :)

Sign In or Register to comment.