26 May 2013

Upgrading passenger and nginx

I deploy code to production servers on a daily basis, however when I have to upgrade system components I feel uneasy.

I had a couple of servers still running an ancient version of nginx, 1.2.0 or somethig like that. It was upgrade time…

Better be safe than sorry

Instead of go ahead and update directly on the production machine, I launch a new linode and restore the last backup to it. This way I can see if there will be any problem with the upgrading process.

Passenger makes installing / updating nginx easy

The process can’t get easier than this:

gem update passenger
rvmsudo passenger-install-nginx-module

I choose to let it download and install nginx itself.

The last step is to edit your nginx.conf and update the passenger root folder.

Adding SPDY support

If you want to activate additional modules other than the defaults, you need to download the nginx source code first. Again the install is very simple thanks to passenger.

First download and untar the nginx source code:

wget http://nginx.org/download/nginx-1.4.1.tar.gz
tar xvzf nginx-1.4.1.tar.gz


rvmsudo passenger-install-nginx-module

This time you want to choose option 2. You simply have to type where the nginx source code is located and pass addtional compile options.

In my case to activate the SPDY module: _–with-http_spdymodule