Closed bourneenery closed 1 year ago
Hello @bourneenery ,
I do not recall having seen that particularly error message before.
Can you specify fully the steps you followed? Either reproduce them here, or point to the specific link.
You could also try alternative instructions, in case the ones you used are easily misinterpreted somehow. (For example: https://www.nginx.com/blog/compiling-and-installing-modsecurity-for-open-source-nginx/)
( Also, what versions are you using for ModSecurity and ModSecurity-nginx? )
Hi Martin,
Thank you for your response. The steps I followed are from the exact same link you posted, no errors were thrown during the compilation. The ModSecurity and ModSecurity-nginx versions are the one used in that guide, which I presume it's the latest for both.
The module works if I completely rebuild the nginx binary with make && make install, but compiling this as a dynamic module always fail with the error provided earlier.
Any advise is appreciated. Thanks!
I'm not following you.
With the problem scenario that prompted your report, did you install nginx itself via sudo apt install nginx
(or equivalent)? Or did you build it yourself from source?
Hi Martin,
Yes, correct. I built it myself from source. I included the ./configure line in the first post.
Any advise is very appreciated.
In that case, it sounds more like you have not correctly built nginx. That is not something I can offer guidance on.
My suggestion would be to install nginx from repo.
If want information on building nginx yourself, you could consider inquiring with the nginx project as that group would be the subject matter experts on building nginx.
I'm trying to load the ModSecurity-nginx connector ...
nginx version: nginx/1.21.0 built by gcc 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) ... Any advise is appreciated, thank you!
there is a package for Ubuntu 18.04: https://modsecurity.digitalwave.hu - but Nginx version is the same as in Ubuntu 18.04, not the 1.21.
For 1.21, you should make your own package from this package source: https://salsa.debian.org/modsecurity-packaging-team/libnginx-mod-http-modsecurity. It's not the final version for 1.21, but only few small cosmetics need.
Hello,
I'm trying to load the ModSecurity-nginx connector but after compilation and installation nginx is throwing the following error after compiling manually as dynamic module from https://github.com/SpiderLabs/ModSecurity-nginx.git and using my exact nginx version nginx-1.21.0.tar.gz
nginx: [emerg] dlopen() "/home/build/bin/nginx/modules/ngx_http_modsecurity_module.so" failed (/home/build/bin/nginx/modules/ngx_http_modsecurity_module.so: undefined symbol: ngx_http_top_body_filter) in /home/build/bin/nginx/conf/nginx.conf:4
I loaded the module as,
"load_module modules/ngx_http_modsecurity_module.so;" in the nginx.conf.
I have compiled and installed ModSecurity from https://github.com/SpiderLabs/ModSecurity successfully with no errors, it's currently under /usr/local/modsecurity/lib/libmodsecurity.so
/home/build/bin/nginx/sbin/nginx -V
nginx version: nginx/1.21.0 built by gcc 7.5.0 (Ubuntu 7.5.0-3ubuntu1~18.04) built with OpenSSL 1.1.1f 31 Mar 2020 TLS SNI support enabled configure arguments: --prefix=/home/build/bin/nginx --with-compat --with-http_auth_request_module --with-file-aio --with-threads --with-http_gzip_static_module --with-http_realip_module --with-http_flv_module --with-http_mp4_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-cc-opt='-static -static-libgcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --with-ld-opt='-static -Wl,-z,relro -Wl,-z,now -pie' --with-pcre=../pcre-8.44 --with-pcre-jit --with-zlib=../zlib-1.2.11 --with-openssl=../openssl-1.1.1f --with-openssl-opt=no-nextprotoneg --add-module=/home/build/headers-more-nginx-module
file /home/build/bin/nginx/modules/ngx_http_modsecurity_module.so
/home/build/bin/nginx/modules/ngx_http_modsecurity_module.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=2ee88e266909459bf86a1439ea8f0ac988584357, with debug_info, not stripped
ldd /home/build/bin/nginx/modules/ngx_http_modsecurity_module.so
Any advise is appreciated, thank you!