A bit lost …
I know nothing concerning nginx, I am more confortable with Apache2.
I am using an email server who is using nginx on debian 8.
I would need to install modsecurity as module.
I have understood that I need to compile from the working directory of
nginx …
./configure --add-module=/opt/ModSecurity-nginx
But how to deal with it if nginx as been installed from binary (debian
package) ?
A bit lost …
I know nothing concerning nginx, I am more confortable with Apache2.
I am using an email server who is using nginx on debian 8.
I would need to install modsecurity as module.
I have understood that I need to compile from the working directory
of
nginx …
FWIW I am in a similar boat. Apache has been my weapon of choice for a
long time, I have inherited a system where they prefer nginx. We are a
Debian shop, using Jessie (8) on production systems. I use the packages
from the nginx repositories rather than the Debian builds.
Seems for me to be a bit tricky.
Not going to do something because I do not want to break something
who is already working perfectly…
Why is it so complicated to install a module for nginx ?
Thx anyway and happy christmas.
Le mercredi 23 décembre 2015 à 15:03:10, vous écriviez :
Greetings,
On Wed, 2015-12-23 at 14:21 +0200, Thierry wrote:
A bit lost …
I know nothing concerning nginx, I am more confortable with Apache2.
I am using an email server who is using nginx on debian 8.
I would need to install modsecurity as module.
I have understood that I need to compile from the working directory
of
nginx …
FWIW I am in a similar boat. Apache has been my weapon of choice for a
long time, I have inherited a system where they prefer nginx. We are a
Debian shop, using Jessie (8) on production systems. I use the packages
from the nginx repositories rather than the Debian builds.
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.
Thx a lot … But, I might mistaken …
My nginx is already working, as already been compiled with a certain
number of modules … I do not want to break something …
If I am doing what you said … It might happen no ?
Thx*
Le mercredi 23 dcembre 2015 18:47:18, vous criviez :
Hello Thierry,
Here’s a quick howto build a nginx debian package, I hope it’s clear and
that I’m not making mistakes.
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.
One problem I see here is that you need to place the modules added there
in
their exact path like for
example /tmp/buildd/nginx-1.6.2/debian/modules/nginx-upstream-fair
.Otherwise you will have to modify those path accordingly. you need to
install build deps for nginx too
Also you might be able to use 1.8.0 stable version
Follow -
. The difference is you are adding mod_sec instead of pagespeed .
Ok, but if I recompile everything, do I lose the actual nginx’s config
?
Le mercredi 23 dcembre 2015 19:33:11, vous criviez :
On Thu, Dec 24, 2015, at 02:31, Thierry wrote:
Bonjour Alt,
Thx a lot … But, I might mistaken …
My nginx is already working, as already been compiled with a certain
number of modules … I do not want to break something …
If I am doing what you said … It might happen no ?
nginx doesn’t have support for loadable modules yet so any modules you
want to add/remove requires recompiling nginx.
Thx a lot … But, I might mistaken …
My nginx is already working, as already been compiled with a certain
number of modules … I do not want to break something …
If I am doing what you said … It might happen no ?
nginx doesn’t have support for loadable modules yet so any modules you
want to add/remove requires recompiling nginx.
As said in my last message, in theory you shouldn’t lose your
configuration.
But : backup, backup and backup And compile and test on a test
server,
not on a production server
Just rebuilding a Debian package and installing it shouldn’t break
anything.
But a problem or mistake can always happen, so I don’t recommend doing
eveything I said in my previous message on your production server.
I don’t think you want to spend your XMas fixing your server So
compile,
package and test nginx on a test server (a virtual machine for example).
And anyway, you really must have a backup of your production server
(with
all your config files), because shit can happen (mistake of an admin,
hardware failure, a hack,…) and you could lose everything.
If you want to keep the modules already compiled in, you should add
ModSecurity to the same flavor you used on your server. If you installed
the
package “nginx-full” flavor, you should add ModSecurity to “nginx-full”,
rebuild the packages and install your new “nginx-full.deb”.
Best Regards.
Posted at Nginx Forum:
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.