The first thing is to find out which version are you on. Here’s how you do it

nginx -v

It should show you something like

nginx version: nginx/1.1.19

Now that we know that we need to upgrade, the first thing to do is to backup your configuration

sudo cp /etc/nginx/nginx.conf /etc/nginx/nginx.conf.1.1.19.backup

Ok, moving on, first stop the nginx service

sudo service nginx stop

Install the dependencies

sudo aptitude install python-software-properties

Add the repository for the stable version of Nginx

sudo add-apt-repository ppa:nginx/stable

Now the usual stuff, update aptitude and upgrade it

sudo aptitude update
sudo aptitude safe-upgrade

When it asks you if you want to keep using the old config or get the new config, please select Y(es) and get the latest config. Finally, restart nginx

sudo service nginx restart

If you ask nginx what version its on, here’s what it would say

nginx -v
nginx version: nginx/1.4.7

That’s it. Now you have the latest version of Nginx running on your servers.

Advertisements

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