Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm on Ububtu and I'm trying upgrade Nginx 1.0.5 to the latest version 1.2.6. Here's what I did and what didn't work.

$ nginx -v
nginx: nginx version: nginx/1.0.5
$ curl -O
$ tar xvzf nginx-1.2.6.tar.gz
$ cd nginx-1.2.6/
$ ./configure
$ make && sudo make install

$ nginx -v
nginx: nginx version: nginx/1.0.5 <<< still old version!!!

Any ideas would be much appreciated. Thanks.

share|improve this question
As gertvdijk says, use the PPA and install it as a package instead of compiling it yourself: – cjc Dec 14 '12 at 16:36

Please, please, don't compile from source if you don't have to. make install overwrites files on your system and may confuse your package management. Besides, Nginx provides official repositories for Ubuntu for your convenience on their website1. Also, the Nginx team on Launchpad provides PPAs for Ubuntu (both stable & development).

1 Thanks to VBart for pointing this out.

share|improve this answer
The official nginx repository for Ubuntu is here: – VBart Dec 14 '12 at 16:57
@VBart thanks - updated my answer. – gertvdijk Dec 14 '12 at 17:16

You probably have Nginx in two different places and your $PATH env is picking up the old one. Run which nginx to find out which it's picking up.

My guess is it is picking up one in /usr/sbin/nginx and since you didn't put a --prefix=/usr in your ./configure line it is installing 1.2.6 in /usr/local/sbin/nginx

share|improve this answer
My current version is installed at /usr/sbin/nginx but it didn't install anything in /usr/local/sbin. – jwerre Dec 14 '12 at 16:19
Ahh... found it. It's in /usr/local/nginx/sbin/nginx. If I just rm -rf /usr/local/nginx/sbin/nginx will that take care of that, or is there anything else I need to remove? – jwerre Dec 14 '12 at 16:25
I expect the whole /usr/local/nginx tree can go if you want to remove it rather than use it. Personally I'd go with the PPA method (see other answer), but if you do want a custom compile then using it from where it is should be fine, just need to specify the full path. – Shish Dec 14 '12 at 16:29
So I basically need to remove my current version and install with apt-get. Is that what you're saying? – jwerre Dec 14 '12 at 16:37
yes, but probably need to activate the ppa first if you want v 1.2.6. On 12.04 you will get v 1.1.19 without the ppa. No idea which version you will get in the ppa or on 12.10. – laurent Dec 14 '12 at 16:42

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.