Skip to content

ngx_http_modsecurity_module requires the ModSecurity library #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
olekstumedia opened this issue Sep 14, 2016 · 4 comments
Closed

ngx_http_modsecurity_module requires the ModSecurity library #15

olekstumedia opened this issue Sep 14, 2016 · 4 comments
Assignees

Comments

@olekstumedia
Copy link

I am trying to build custom deb package with modsecurity and pagespeed but getting this error

hecking for sysconf(_SC_NPROCESSORS_ONLN) ... found
checking for openat(), fstatat() ... found
checking for getaddrinfo() ... found
configuring additional modules
adding module in /root/rebuildnginx/modsecurity
checking for ModSecurity library ... not found
checking for ModSecurity library in /usr/local/modsecurity ... not found
 ./configure: error: ngx_http_modsecurity_module requires the ModSecurity library.
debian/rules:86: recipe for target 'configure_debug' failed
make[1]: *** [configure_debug] Error 1
make[1]: Leaving directory '/root/rebuildnginx/nginx-1.11.4'
debian/rules:64: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2

Following this tutorial but with latest nginx and pagespeed modules versions

https://serversforhackers.com/compiling-third-party-modules-into-nginx

root@host:/rebuildnginx# ll
total 1084
drwxr-xr-x 5 root root 4096 Sep 14 14:20 ./
drwx------ 13 root root 4096 Sep 14 14:21 ../
drwxr-xr-x 4 root root 4096 Aug 22 16:20 modsecurity/
drwxr-xr-x 11 root root 4096 Sep 14 14:22 nginx-1.11.4/
-rw-r--r-- 1 root root 133672 Sep 13 12:47 nginx_1.11.4-1
xenial.debian.tar.xz
-rw-r--r-- 1 root root 1843 Sep 13 12:47 nginx_1.11.4-1~xenial.dsc
-rw-r--r-- 1 root root 949793 Sep 13 12:46 nginx_1.11.4.orig.tar.gz
drwxr-xr-x 6 root root 4096 Sep 14 14:19 pagespeed/

@olekstumedia
Copy link
Author

Looks like I need to install modcesuriy library into /usr/local/modsecurity

@zimmerle zimmerle self-assigned this Sep 14, 2016
@zimmerle
Copy link
Contributor

Hi @olekstumedia,

Exactly, you need to install the libmodsecurity before proceed with nginx compilation. The ModSecurity library can be found at:
https://github.com/SpiderLabs/ModSecurity/tree/v3/master

@olekstumedia
Copy link
Author

The ones in Ubuntu repo will not work right?

root@host:~/rebuildnginx/nginx-1.11.4# apt-cache search modsecurity
libapache2-mod-security2 - Tighten web applications security for Apache
libapache2-modsecurity - Dummy transitional package
modsecurity-crs - modsecurity's Core Rule Set

@olekstumedia
Copy link
Author

For those who are building ModSecurity Library on Ubuntu this commands will be useful. I have not filter them and some packages just does not exists but finally I got everything installed

410 20160914 - 14:43:09 - apt-get install libtoolize autoreconf autoheader automake autoconf
411 20160914 - 14:43:41 - sudo apt-get install autoconf
412 20160914 - 14:46:02 - apt-get install gcc
413 20160914 - 14:46:04 - apt-get install build-essential fakeroot dpkg-dev
414 20160914 - 14:46:29 - sh build.sh
415 20160914 - 14:47:05 - sudo apt-get install build-essential libtool
416 20160914 - 14:47:16 - sh build.sh
417 20160914 - 14:47:55 - apt-get install flex
418 20160914 - 14:48:21 - ./configure
420 20160914 - 14:48:42 - apt-get install bison curl
423 20160914 - 14:49:50 - apt-get install libyajl-dev
424 20160914 - 14:50:24 - sudo apt-get install graphviz
425 20160914 - 14:50:44 - sudo apt-get install doxygen-gui
429 20160914 - 14:51:38 - apt-get install libgeoip-dev
430 20160914 - 14:51:45 - ./configure
431 20160914 - 14:52:09 - git submodule init
432 20160914 - 14:52:12 - git submodule update
433 20160914 - 14:52:22 - ./configure
436 20160914 - 14:54:25 - apt-get install lmdb-utils

dennus pushed a commit to dennus/ModSecurity-nginx that referenced this issue Apr 23, 2018
…urity from feature/SECURITYGW-708-response-custom-error_page to develop

* commit '1759337c69ea63bfd38adff0b4326f863bc5acf9':
  Added workaround for correct working ModSecurity with custom error page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants