• Zur Hauptnavigation springen
  • Skip to main content
  • Zur FuĂźzeile springen

Sebastian Mogilowski's Blog

Just another blog about administration, linux and other stuff

  • Home
  • Contact
  • Imprint
  • Projects & HOWTOs
  • Publications

Building a nginx debian package with third party modules

14. Mai 2011 by sebastian 4 Kommentare

I created this manual on Debian Squeeze (amd64) with the latest version of nginx (stable) an one third party module as example.
If you want to build your own package, check for the latest versions of the modules and nginx and modify the version numbers in this manual.

1. Install build debian tools and depending packages

aptitude install build-essential dpkg-dev debhelper autotools-dev libgeoip-dev libssl-dev libpcre3-dev zlib1g-dev

2. Download latest nginx and unpack the tarball

wget http://nginx.org/download/nginx-1.0.2.tar.gz
tar xvzf nginx-1.0.2.tar.gz

3. Download additional modules

I use the nginx purge module in this example. Download the module:

wget http://labs.frickle.com/files/ngx_cache_purge-1.3.tar.gz

and create a „module“ directory if it not exists and untar the module to this directory:

mkdir nginx-1.0.2/modules
tar vfx ngx_cache_purge-1.3.tar.gz -C nginx-1.0.2/modules/

4. Get latest debian package

apt-get source nginx

You get a directory with the latest nginx source (nginx-0.7.67). We only need the „debian“ folder.

5. Copy the debian folder to the new nginx folder

cp -r nginx-0.7.67/debian/ nginx-1.0.2
rm nginx-1.0.2/debian/patches/*

Don’t forget to remove the old patches !

Edit „nginx-1.0.2/debian/changelog“ and prepend:

nginx (1.0.2-1) unstable; urgency=low

  * added purge proxy module

 -- Sebastian Mogilowski   Sat, 14 May 2011 13:00:00 +0100

Note: Replace my name with your own name 🙂

Add the module to the build rules edit „nginx-1.0.2/debian/rules“ and add:

--add-module=$(CURDIR)/modules/ngx_cache_purge-1.3 \

to the „./configure“ setting.

Example:

./configure --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 \
            --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 \
            --add-module=$(CURDIR)/modules/ngx_cache_purge-1.3 \
            $(CONFIGURE_OPTS)

6. Build the package

cd nginx-1.0.2
dpkg-buildpackage -b

7. Install

dpkg -i nginx_1.0.2-1_amd64.deb

Kategorie: Linux, Systemadministration Stichworte: debian, Nginx, Squeeze

Leser-Interaktionen

Kommentare

  1. Pedro Roger meint

    8. November 2011 um 14:21

    Nice clue!

    Antworten
  2. vlad meint

    14. April 2013 um 07:06

    Thanks!

    Antworten

Trackbacks

  1. Install nginx on debian squeeze from PPA | Sebastian Mogilowskis Blog sagt:
    14. Mai 2011 um 13:56 Uhr

    […] 0.7.67-3 von Nginx in Debian Squeeze. Wenn man eine neuere Version haben möchte, kann man sich seine eigenen Pakete bauen, oder man verwendet welche aus den Ubuntu PPA-Quellen.Dies installiert die neuste (stable) Version […]

    Antworten
  2. Nginx as reverse proxy cache for wordpress and apache | Sebastian Mogilowskis Blog sagt:
    14. Mai 2011 um 14:21 Uhr

    […] on 14 May 2011 Leave a comment (0) Go to comments1. Nginx installieren* PPA Installation * Installation mit selbstgebauten Paket2. Allgemeine Nginx EinstellungenFolgende Einstellungen in der Datei […]

    Antworten

Schreibe einen Kommentar Antwort abbrechen

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert

eMail-Benachrichtigung bei weiteren Kommentaren.
Auch möglich: Abo ohne Kommentar.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre, wie deine Kommentardaten verarbeitet werden.

Footer

Kategorien

  • Allgemein
  • Coldfusion
  • Development
  • Fun
  • General
  • Home automation
  • Homematic
  • Linux
  • Mobile
  • PHP
  • Privat
  • Systemadministration
  • Virtualization
  • Windows
  • Zaurus

© 2026 · Sebastian Mogilowski's Blog · Powered by Imagely