nginx modsecurity on Debian 8

Alt nginx-forum at nginx.us
Wed Dec 23 16:47:18 UTC 2015


Hello Thierry,

Here's a quick howto build a nginx debian package, I hope it's clear and
that I'm not making mistakes.

First, you need to get the source of nginx and others files to build the
package. You can probably do something like "apt-get source nginx", but I
prefer to go on this page: https://packages.debian.org/jessie/nginx and
manually download the 3 files on the right.
Something like "wget
http://http.debian.net/debian/pool/main/n/nginx/nginx_1.6.2-5.dsc
http://http.debian.net/debian/pool/main/n/nginx/nginx_1.6.2.orig.tar.gz
http://http.debian.net/debian/pool/main/n/nginx/nginx_1.6.2-5.debian.tar.xz".

Then, you uncompress everything with: "dpkg-source -x nginx_1.6.2-5.dsc"

Then "cd nginx_1.6.2-5"

Here, you will have to do something to add ModSecurity. Normally, you add a
3rd party module by adding something like
"--add-module=full/path/to/the/module-source" in the "debian/rules" file
(where there are others parameters like "--with-ipv6" or
"--with-http_ssl_module").
Check the "debian/rules" and add your parameter only to the flavor you will
use (full, light,...). Or add the parameter for each of them if you are not
sure.
I don't know if ModSecurity need something special.

Last step, execute: "dpkg-buildpackage -B -uc" to compile everything and
build the ".deb" packages. Note that you will get several of them: full,
extras, light, with or without debug,... (regarding this flavors, see
previous step: where you added the parameter).

Then install your newly created package with: "dpkg -i
nginx-THE-FLAVOR-YOU-WANT.deb"


PS: I'm really sorry if there are some mistakes (maybe in the filenames?), I
just wrote the instructions from memory.

PS2: I suggest you first do all this steps, without the one regarding
ModSecurity (so without editing "debian/rules"), just to be sure everything
goes well.

Best Regards.

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,263657,263671#msg-263671



More information about the nginx mailing list