wargio / naxsi

NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

configure error : Cannot find 'libinjection' submodule

oukanghua opened this issue · comments

Details

  • NGINX version: 1.24
  • NAXSI version: 1.6
  • Operating System: ubuntu 22

Nginx Logs


 + ngx_http_lua_module was configured
adding module in ../ngx_devel_kit-master
 + ngx_devel_kit was configured
configuring additional dynamic modules
adding module in ../naxsi-1.6/naxsi_src
./configure: 27: ../naxsi-1.6/naxsi_src/config: pkg-config: not found
./configure: 28: ../naxsi-1.6/naxsi_src/config: pkg-config: not found
Cannot find 'libinjection' submodule.


it's not a bug.

Some distros has libinjection, if it is available, then the code will link towards the shared lib available, if not it will use the submodule.

When the lib is not available systemwide then you will have that error message, but can be ignored.

If it fails to build then you didn't follow the instructions here: https://github.com/wargio/naxsi?tab=readme-ov-file#build-naxsi

maybe i should improve the error message and hint that the user may have not downloaded the submodules.

Thanks.
I user command git clone --recurse-submodules to clone the repository,but still config fail with nginx-1.24.0

adding module in ../naxsi/naxsi_src
: not found: 3: ../naxsi/naxsi_src/config: 
: not found: 4: ../naxsi/naxsi_src/config: 
: not found: 12: ../naxsi/naxsi_src/config: 
: not found: 25: ../naxsi/naxsi_src/config: 
./configure: 27: ../naxsi/naxsi_src/config: pkg-config: not found
./configure: 28: ../naxsi/naxsi_src/config: pkg-config: not found
: not found: 30: ../naxsi/naxsi_src/config: 
./configure: 40: ../naxsi/naxsi_src/config: Syntax error: word unexpected (expecting "do")

please how are you building this?

$  cd /usr/nginx/source/nginx-1.24.0/
$  patch -p1 < ../nginx_upstream_check_module-master/check_1.20.1+.patch
$ ./configure --with-ld-opt="-Wl,-rpath,/usr/nginx/luajit2/lib" --prefix=/usr/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_realip_module --with-http_stub_status_module --with-http_gzip_static_module --with-http_flv_module --with-http_mp4_module --with-stream --with-pcre=../pcre-8.45 --with-zlib=../zlib-1.2.11 --with-openssl=../openssl-3.0.13 --add-module=../nginx_upstream_check_module-master --add-module=../nginx-goodies-nginx-sticky-module-ng --add-dynamic-module=../naxsi/naxsi_src --add-module=../ngx_http_substitutions_filter_module-master/ --add-module=../lua-nginx-module-0.10.26 --add-module=../ngx_devel_kit-master

If I don't add naxsi module,it'll building success.

what is that patch and how i get it?

image
Looks ok if i only use ngx_http_substitutions_filter_module and naxsi. be sure it is not the other plugin failing.

This is via a clean ubuntu install. if you downloaded the release be sure to download the one with -deps in the name, not the one generated by Github.

When I clone the repository in Liunx OS, it building sucess.I clone compress in Windows OS and upload to Liunx OS before.
Anyway, thanks.

When I clone the repository in Liunx OS, it building sucess.I clone compress in Windows OS and upload to Liunx OS before. Anyway, thanks.

it's quite possible that is due the CR+LF line endings.