Installing Node.js application on CentOS

I have OpenVZ VPS with pre-installed CentOS 6.2 blank (32-bit) and domain name mysite.com. I would like to install Node.js and my javascript application on CentOS that in result should be accessible at mysite.com. So, what steps should I do to implement this? Please, describe process from zero in details. I'm Java developer and have never worked with unix systems :(

Best Regards

"Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications" outside of the browser.

Installing node it self on a system is pretty straight forward. You can simple go to http://nodejs.org and download the correct binary corresponding to your system, or download the source.tar.gz and compile it yourself.

There is a set of installation instructions under the wiki at github.com that will take you through the steps of compiling node on the big three platforms.

I usually will add a prefix when I'm compile so the binaries get moved into the directory I want to store them in. This can be a local directory (ex. $HOME/bin) of the user you want node to be run under or you can make it a system directory where node will be accessible by every user on the system.

$ tar -zxf node-v0.10.3.tar.gz #Download this from nodejs.org
$ cd node-v0.10.3
$ ./configure --prefix=/usr/local/bin
$ make
$ sudo make install

You should now have node and npm installed on the system. From here you can check to make sure everything is working.

$ which node
$ /usr/local/bin/node
$ node -v
$ 0.10.3
$ which npm
$ /usr/local/bin/npm
$ npm -v
$ 1.2.11

With node you will be building your server from the ground up. There are a lot of libraries to help you do this. The main built in one would be http which is built on top of net.

To get your application accessible from your domain you simply need to start your node application and tell it to listen on a port (assuming http, or some networked app). On the linux side you also need to make sure what ever port your node process is listing on is open so connections can be made to your server. The most common firewall on linux system is Iptables.

I'm not a Java developer so I don't know the normal work flow for deploying a Java applet is or how its served so I can't help you bridge the cap there.

This should get you started.