Run nodejs server continuously using forever


By last Friday morning the open bugs count raised above 150 mark and we managed to take it down to under 25 by the end of the day, thanks to the dedicated effort by the team. Among them, one was to make the Nodejs server run continuously. In our application we are using the Nodejs to implement a near-realtime notification module, which involved pushing notifications and updates to the Web application as well to the Mobile application. Faye module was used to implement the identified channel patterns required to identify different user types and their respective activities each user type executes.

Nodejs is a powerful, Event-driven, I/O based or JavaScript based server that can be used to develop interactive applications. It was developed on top of the V8 JavaScript engine.

Installing Nodejs on Ubuntu

I came across an easier approach to install Nodejs via the Ubuntu Package Manager.

$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:chris-lea/node.js
$ sudo apt-get update
$ sudo apt-get install nodejs npm

Install Forever

In the last command it installed the Node Package Manager(npm). The npm provides the facility to install any module to Nodejs in a manner similar to installing application on Ubuntu via apt-get.

$ sudo npm install forever --global

Setting the –global parameter makes the module accessible globally

Updating Nodejs & the modules to latest stable release

Nodejs comes with a module called n aka node version manager provides the facility to update the module to its latest or stable release.

Install n

$ sudo npm install --global n

Updating Nodejs using n

$ sudo n --global latest/stable
    or
$ sudo n --global custom v0.x.x

Updating Nodejs modules using n

$ sudo n --global npm
    or
$ sudo n --global forever

1 Comment

  1. August 26, 2012 at 6:17 am

    Thanks a bunch for sharing this with all of us you really know what you’re talking approximately! Bookmarked. Please additionally talk over with my site =). We can have a link trade arrangement among us


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: