-
Notifications
You must be signed in to change notification settings - Fork 3
Compilation recipes
This Wiki page contains the installation guide for ModSecurity Nodejs binding.
If your distribution is missing and you manage to install it, don't forget to add it here in this list.
This Nodejs module was primarily developed on Ubuntu 14.04 with the Nodejs version 0.10.25, npm version 1.3.10, SWIG version 3.0.10 and gcc version is 4.8.4. To install this module you may follow the following step :
-
Compile ModSecurity v3 using the compilation recipes provided by ModSecurity. By default this module expects that the installation of ModSecurity must happen in the
/usr
directory. So, you may want to run./configure --prefix=/usr
while configuring the ModSecurity installation. -
Once the compilation of the ModSecurity is finished, you need to install SWIG on your system. For that you may need to grab the latest release from SWIG releases and follow the installation guide provided here.
-
Upon the installation of SWIG and ModSecurity, you are now ready to install this Nodejs binding. If in case you choose to change the installation directory other than default you need to update the
binding.gyp
with the relevantinclude_dirs
andlibraries
. -
In order to install the Nodejs-binding you need to type
sudo make
. The Makefile included in this project will first create a wrapper codemodsecurity_wrap.cxx
using SWIG and then it will install all the relevant node modules for this project, followed by generating Nodejs binding with the wrapper code usingnode-gyp
. If the installation was successful you must seeOK
at very end. -
You may like to run tests after the installation which can be done using
npm test
to run some unit tests andnpm run regression_test
to run some regression tests (but before running the regression tests make sure you copy the test cases that you want to run fromtests/test-cases/Working\ Tests
intotests/test-cases
).