Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: How best to update nginx
PostPosted: Fri Apr 08, 2011 3:54 pm 
Offline
Senior Newbie

Joined: Sun Jan 23, 2011 2:33 pm
Posts: 5
Due to ill health I haven't been keeping an eye on things, and I noticed last night, on my VPS, that Nginx is outdated; I currently use 0.8.53 and the latest version is 0.9.7.

I have Nginx installed in /opt/nginx/ with a dir tree of:

client_body_temp
conf
fastcgi_temp
html
logs
proxy_temp
sbin
scgi_temp
uwsgi_temp

I use nginx.conf for all my websites and their configurations, with each site given a folder in the html dir.

How best to update my current Nginx to the latest build?

Really would appreciate any advice.


Top
   
 Post subject:
PostPosted: Fri Apr 08, 2011 5:47 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Well, using your distribution's package manager is the proper way, but it seems you installed it from source (bad idea)...

If memory serves, copy the config.nice file from your previous build of it to get the same config options, pop that in with the latest source, build, install.

But it might be worth the effort to migrate to the distro package.


Top
   
 Post subject:
PostPosted: Fri Apr 08, 2011 6:03 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
Guspaz wrote:
Well, using your distribution's package manager is the proper way, but it seems you installed it from source (bad idea)...

Only if your distribution is up to date. On my Ubuntu 8.04 servers, compiling your own is really easiest overall. The official repositories aren't nearly up to date (even backports is 0.6.something), and while I tracked a private ppa at one point it disappeared without much fanfare.

Of course, some packages are easier than others, but nginx is pretty simple. Figure out the build config options you want, save it in a shell script and re-use over time. You really only need to transfer the single binary over to the resulting server.

I did borrow/update an init.d script though to tie it into normal startup.

To the OP, you should be able to run nginx manually with the -V option to see what options your current version was built with, and then use them (as is or as a starting point) for your own compilation. The nginx build process has a configure step, though it's not autoconf based, and in my experience it's quite easy to build.

This assumes you didn't do your own source build (which given that you have it in /opt may or may not be true). If you built it yourself and just want the update process, most of the time you just really need the nginx binary to be updated - configurations are generally compatible unless you want to use new features. If you haven't touched them you can update the various *_param and config files, or just diff yours with the source tree to see if anything changed.

Of course, you might also ask yourself if it's really necessary. Even though there is a later version available, unless you need a specific feature or it has a specific security fix, there's nothing forcing you to upgrade.

-- David


Top
   
 Post subject:
PostPosted: Fri Apr 08, 2011 8:50 pm 
Offline
Senior Member

Joined: Sun Mar 07, 2010 7:47 pm
Posts: 1970
Website: http://www.rwky.net
Location: Earth
the 0.9* build is the development build, the latest stable is 0.8.54 the changes between 53 and 54 are

Changes with nginx 0.8.54 14 Dec 2010

*) Bugfix: if there was a single server for given IPv6 address:port
pair, then captures in regular expressions in a "server_name"
directive did not work.

*) Bugfix: a segmentation fault might occur in a worker process, if the
"auth_basic" directive was used.
Thanks to Michail Laletin.

*) Bugfix: compatibility with ngx_http_eval_module; the bug had
appeared in 0.8.42.

So unless any of those effect you I wouldn't bother.

_________________
Paid support
How to ask for help
1. Give details of your problem
2. Post any errors
3. Post relevant logs.
4. Don't hide details i.e. your domain, it just makes things harder
5. Be polite or you'll be eaten by a grue


Top
   
 Post subject:
PostPosted: Mon Apr 11, 2011 10:21 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
db3l wrote:
Only if your distribution is up to date. On my Ubuntu 8.04 servers, compiling your own is really easiest overall. The official repositories aren't nearly up to date (even backports is 0.6.something), and while I tracked a private ppa at one point it disappeared without much fanfare.


Sure, but while 8.04 LTS is still supported on servers until 2013 (overlapping 11.04 LTS), 10.04 LTS has been out for a year. It's perfectly fine to run 8.04 LTS still, but if you're running 8.04 LTS and compiling packages from source to get newer versions, why stick with the old version of the distro? I mean, the whole point of running an LTS release for so long is to get stability in terms of packages, right?


Last edited by Guspaz on Mon Apr 11, 2011 5:24 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Mon Apr 11, 2011 11:11 am 
Offline
Senior Member

Joined: Sat Jun 05, 2004 12:49 am
Posts: 333
Guspaz wrote:
Well, using your distribution's package manager is the proper way, but it seems you installed it from source (bad idea)...


[citation needed]


Top
   
 Post subject:
PostPosted: Mon Apr 11, 2011 3:00 pm 
Offline
Senior Member

Joined: Wed May 13, 2009 1:18 am
Posts: 681
Guspaz wrote:
Sure, but while 8.04 LTS is still supported on servers until 2013 (overlapping 11.04 LTS), 10.04 LTS has been out for a year. It's perfectly fine to run 8.04 LTS still, but if you're running 8.04 LTS and compiling packages from source to get newer versions, why stick with the old version of the distro? I mean, the whole point of running an LTS release for so long is to get stability in terms of packages, right?

Well, there's a vast difference between a single package and the entire distribution, and in my case at the moment I've chosen just to bring nginx (which is just about the only externally communicating bit of code on the node, and the only thing I've built from source) more up to date than to change the entire platform of packages. In some other cases (like PostgreSQL) there are nicely maintained backports to let me do that, but it just happens nginx isn't in that category.

That's not to say I'm not testing and preparing for a shift to a later LTS at some point in advance of 8.04's end of life, but that process is orthogonal to managing packages on my current stable platform.

In any event, I merely wanted to point out that there are some times when it's a valid choice to build from source, even with today's distributions and packaging systems.

-- David


Last edited by db3l on Mon Apr 11, 2011 3:29 pm, edited 1 time in total.

Top
   
 Post subject:
PostPosted: Mon Apr 11, 2011 3:19 pm 
Offline
Senior Member

Joined: Mon Oct 27, 2008 10:24 am
Posts: 173
Website: http://www.worshiproot.com
Guspaz wrote:
Sure, but while 8.04 LTS is still supported on servers until 2013 (overlapping 11.04 LTS)...


11.04 won't be an LTS release, 12.04 will be (which still overlaps).


Top
   
 Post subject:
PostPosted: Mon Apr 11, 2011 5:24 pm 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
Sorry, yes, a typo.


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 8:10 am 
Offline
Senior Member

Joined: Sat Mar 12, 2011 3:43 am
Posts: 76
Location: Russia
nginx 1.0.0 stable version has been released! :)


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 11:09 am 
Offline
Senior Newbie

Joined: Wed Mar 02, 2011 9:56 pm
Posts: 7
Guspaz wrote:
Well, using your distribution's package manager is the proper way, but it seems you installed it from source (bad idea)...

If memory serves, copy the config.nice file from your previous build of it to get the same config options, pop that in with the latest source, build, install.

But it might be worth the effort to migrate to the distro package.


Why is it a bad idea to compile from source? I updated my nginx installation from 0.8.54 to 1.0 just now from source in about 2 minutes.


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 11:54 am 
Offline
Senior Member
User avatar

Joined: Tue May 26, 2009 3:29 pm
Posts: 1691
Location: Montreal, QC
texascrane wrote:
Guspaz wrote:
Well, using your distribution's package manager is the proper way, but it seems you installed it from source (bad idea)...

If memory serves, copy the config.nice file from your previous build of it to get the same config options, pop that in with the latest source, build, install.

But it might be worth the effort to migrate to the distro package.


Why is it a bad idea to compile from source? I updated my nginx installation from 0.8.54 to 1.0 just now from source in about 2 minutes.


Because people often compile from source when they don't have to, and then don't update from source as often as they should. Distributions provide a quick and easy way to update every single package on a system to the latest version, or between different versions of the distro. When people start compiling stuff from source, they need to individually update anything they compiled. They're also probably not doing that as often as their distro, and they're certainly not backporting fixes.

The packages compiled from source are also probably not using the same paths/configuration/etc that the distro package would, which may make it incompatible with packaged versions of dependent or related software, adding further complexity and room for error.


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 12:09 pm 
Offline
Senior Newbie

Joined: Wed Mar 02, 2011 9:56 pm
Posts: 7
Guspaz wrote:
Because people often compile from source when they don't have to, and then don't update from source as often as they should. Distributions provide a quick and easy way to update every single package on a system to the latest version, or between different versions of the distro. When people start compiling stuff from source, they need to individually update anything they compiled. They're also probably not doing that as often as their distro, and they're certainly not backporting fixes.

The packages compiled from source are also probably not using the same paths/configuration/etc that the distro package would, which may make it incompatible with packaged versions of dependent or related software, adding further complexity and room for error.


All of that makes sense and I use APT for everything... except nginx. From my perspective, I like to have granular control over what modules are installed on something as important as my web server (and make sure that I'm running the latest version). Nginx has no dependencies (unless you add them) and compiling from source is very easy.

If updating to the latest stable version of nginx every few months (or making a decision not to update) is too much trouble for a system admin, well...


Top
   
 Post subject:
PostPosted: Tue Apr 12, 2011 5:49 pm 
Offline
Senior Member

Joined: Wed Jan 21, 2009 7:13 pm
Posts: 126
Location: Portugal
There is an official repository at launchpad:

http://wiki.nginx.org/Instal

https://launchpad.net/~nginx

By the way ... nginx 1.0 is now the stable release and was launched today!


Top
   
 Post subject:
PostPosted: Wed Apr 13, 2011 11:33 pm 
Offline
Senior Member

Joined: Fri Dec 10, 2010 6:45 pm
Posts: 63
If you're using Ubuntu the official PPA is the easiest way to install and keep current.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group