I am not familiar with debian's deb package build system, so I go through the process of building deb package from source at first.
- Install packages needed for building nginx
sudo apt-get build-dep nginx
sudo apt-get install fakeroot
- Get source code package:
mkdir $HOME/build/nginx -p
cd $HOME/build/nginx
apt-get source nginx
- Build it to generate deb package
cd nginx-0.6.32
dpkg-buildpackage -rfakeroot
Everything goes well, a deb package is generated under $HOME/build/nginx.
Then I continue to build nginx with wsgi support
- Checkout latest code of ( mod_wsgi for nginx)
cd $HOME/build/nginx
hg clone http://hg.mperillo.ath.cx/nginx/mod_wsgi/
- Edit $HOME/build/nginx/nginx-0.6.32/debian/rules, add additional options to the configure clause:
--add-module=${HOME}/build/nginx/mod_wsgi --with-debug
- Edit $HOME/build/nginx/nginx-0.6.32/debian/conf/nginx.conf, add these two lines to "http" section:
include /etc/nginx/wsgi_vars;
wsgi_temp_path /var/tmp/nginx_wsgi_temp;
- Copy file wsgi_vars from wsgi's conf directory to nginx's
cp $HOME/build/nginx/mod_wsgi/conf/wsgi_vars \
$HOME/build/nginx/nginx-0.6.32/debian/conf/
- Edit $HOME/build/nginx/nginx-0.6.32/auto/install, and thses lines to it
test -f '\$(DESTDIR)$NGX_CONF_PATH' \
|| cp conf/wsgi_vars '\$(DESTDIR)$NGX_CONF_PREFIX'
cp conf/wsgi_vars '\$(DESTDIR)$NGX_CONF_PREFIX/wsgi_vars.default'
- Everything is ready now, compile nginx and generate deb package as before
cd nginx-0.6.32
dpkg-buildpackage -rfakeroot
Install the generated deb package with dpkg, it works.
The deb package I built can be downloaded from
here.