How get latest NGINX and build deb package on Ubuntu


I use Ubuntu Natty 11.04 in this installation which use nginx 0.8.54 as default package. Now, i try to build and install nginx 1.1.3 development into my Ubuntu.

1. Enable NGINX source
Edit “/etc/apt/source.list” and uncomment :

1
deb-src http://archive.ubuntu.com/ubuntu/ natty multiverse

Then you need to reload repository by “sudo apt-get update”

2. Installing Dependencies

1
2
3
4
5
6
sudo apt-get install build-essential debhelper fakeroot libpcre3 libpcre3-dev libpcrecpp0 libssl-dev zlib1g-dev autotools-dev libgeoip-dev libgd2-noxpm-dev liblua5.1-dev libmhash-dev libperl-dev libxslt1-dev
cd ~/ && mkdir nginx && cd nginx && wget -c http://nginx.org/download/nginx-1.1.3.tar.gz
tar -xvvf nginx-1.1.3.tar.gz
apt-get source nginx
cp -r nginx-FROM-UBUNTU-VE/debian nginx-1.1.3
rm -rf nginx-1.1.3/debian/patches/*

3. Compile NGINX on “nginx-1.1.3” folder by

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
./configure –prefix=/etc/nginx
    –conf-path=/etc/nginx/nginx.conf
    –error-log-path=/var/log/nginx/error.log
    –http-client-body-temp-path=/var/lib/nginx/body
    –http-fastcgi-temp-path=/var/lib/nginx/fastcgi
    –http-log-path=/var/log/nginx/access.log
    –http-proxy-temp-path=/var/lib/nginx/proxy
    –http-scgi-temp-path=/var/lib/nginx/scgi
    –http-uwsgi-temp-path=/var/lib/nginx/uwsgi
    –lock-path=/var/lock/nginx.lock
    –pid-path=/var/run/nginx.pid
    –with-debug
    –with-http_dav_module
    –with-http_flv_module
    –with-http_geoip_module
    –with-http_gzip_static_module
    –with-http_realip_module
    –with-http_stub_status_module
    –with-http_ssl_module
    –with-http_sub_module
    –with-ipv6
    –with-mail
    –with-mail_ssl_module
    $(CONFIGURE_OPTS)

4. Create deb packages

1
dpkg-buildpackage -b

5. Install deb packages
Got to upper “nginx-1.1.3” folder and you will see *.deb packages. Install nginx-common and nginx-full using “sudo dpkg -i


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.