--with-http_gzip_static_module for serve precompressed versions of static files,
--with-http_flv_module for flash streaming video or
--with-http_geoip_module for country and city variables from the IP-address and etc.
Standard way is uninstall nginx (apt-get uninstall nginx) and Building Nginx From Source with the required flags.
Other easier way recompile deb package.
Setup the dependencies to repack the package:
apt-get build-dep nginxGet source code for the package to tmp folder:
cd /tmp && apt-get source nginxChange compile options:
nano nginx-*/auto/optionsFoe example, to enable GeoIP module need change line HTTP_GEOIP=NO to HTTP_GEOIP=YESCompile the package:
cd /tmp/nginx-* && dpkg-buildpackage -uc -bAnd install recompiled .deb file:
dpkg -i /tmp/nginx_*.debАfter you upgrade to a new version nginx, this recompiled package will be overwritten. You will have to do this process again.
Thanks! Very well done tutorial!
ReplyDeleteJust a quick tip, you can use 'sudo aptitude hold nginx' to prevent your custom build from being overwritten. You can then repackage and upgrade at your leisure.
ReplyDelete