Skip to content

Compilation recipes

Manish Malik edited this page Aug 14, 2016 · 1 revision

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.

Table of Contents
  1. Ubuntu 14.04

Ubuntu 14.04

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 :

  1. 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.

  2. 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.

  3. 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 relevant include_dirs and libraries.

  4. In order to install the Nodejs-binding you need to type sudo make. The Makefile included in this project will first create a wrapper code modsecurity_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 using node-gyp. If the installation was successful you must see OK at very end.

  5. You may like to run tests after the installation which can be done using npm test to run some unit tests and npm 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 from tests/test-cases/Working\ Tests into tests/test-cases).

Clone this wiki locally