How to always have the latest nginx version in Ubuntu/Debian

Merlin merlin at mahalo.com
Tue Mar 24 00:48:25 MSK 2009


Mark,

Why not just use apt-get source to get the source package of nginx; wget the
latest nginx; copy the debian/ directory from the source package into the
new nginx directory; edit the (dch) changelog, control file, etc; rebuild
the package (debuild -rfakeroot), and install with dpkg?

That's what I do, anyway.  I recommend similar procedure with any software
package -- you can even use dh_make to create the debian/ directory for any
particular source directory.  Try this guide out:
http://david415.wordpress.com/2008/09/10/customdebianopensshpackagebuild/which
tells you how to make the debian package for latest openssl from
scratch - what I mentioned above is how to do it from the existing package,
which is what you want in this case because it has all the init.d files and
such for you!

There should be plenty of information around the net on building custom
debian packages, if you have trouble finding it, try checking out
debian-mentors (they have mailing list and IRC).

- Merlin

On Mon, Mar 23, 2009 at 1:42 PM, Mark Alan <varia at e-healthexpert.org> wrote:

> I am attaching the procedure that we use to to always have the latest nginx
> version in Ubuntu/Debian.
>
> M.
>
> ## -- start-of-procedure
>
> # Install the current Nginx (Ubuntu 8.10 = Nginx/0.6.34 @ backports)
> sudo aptitude -R install nginx= ; # the ending = means install & hold to
>  prevent automatic upgrades
>
> # install needed ubuntu/debian compiling tools
> sudo aptitude -R install build-essential libpcre3 libpcre3-dev libpcrecpp0
> libssl-dev zlib1g-dev
>
> # build & replace by the latest "debianized" Nginx 0.7.44
> test -x $HOME/src/ || mkdir -p $HOME/src/ && cd $HOME/src/
> # nginx's latest version: <http://sysoev.ru/nginx/download.html>
> wget http://sysoev.ru/nginx/nginx-0.7.44.tar.gz
> tar zxvf nginx-0.7.44.tar.gz
>
> cd nginx-0.7.44
> ./configure --prefix=/etc/nginx \
>        --sbin-path=/usr/sbin/nginx \
>        --conf-path=/etc/nginx/nginx.conf \
>        --error-log-path=/var/log/nginx/error.log \
>        --pid-path=/var/run/nginx.pid \
>        --lock-path=/var/lock/nginx.lock \
>        --user=www-data \
>        --group=www-data \
>        --http-log-path=/var/log/nginx/access.log \
>        --http-client-body-temp-path=/var/lib/nginx/body \
>        --http-proxy-temp-path=/var/lib/nginx/proxy \
>        --http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
>        --with-cc-opt=-O2 \
>        --with-http_gzip_static_module \
>        --with-http_ssl_module
>
> # ensure that there is only one -O in CFLAGS and that it is -O2
> sed -i '/CFLAGS/s/ \-O //g' objs/Makefile
>
> make
>
> # debian policy: use 'install' instead of 'cp' or 'mv'
> sudo /usr/bin/install -s -m 755 -o root objs/nginx /usr/sbin/nginx.new &&
> sudo mv /usr/sbin/nginx /usr/sbin/nginx.old-"$(date +%Y%m%d-%H%M-%S)" &&
> sudo mv -v /usr/sbin/nginx.new /usr/sbin/nginx
>
> sudo kill -15 $(pidof nginx) ; sudo /etc/init.d/nginx restart
>
> ## -- end-of-procedure
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://nginx.org/pipermail/nginx/attachments/20090323/fd4782bf/attachment.html>


More information about the nginx mailing list