wargio / naxsi

NAXSI is an open-source, high performance, low rules maintenance WAF for NGINX
GNU General Public License v3.0
305 stars 38 forks source link

configure error : Cannot find 'libinjection' submodule #125

Closed oukanghua closed 9 months ago

oukanghua commented 9 months ago

Details

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.
wargio commented 9 months ago

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

wargio commented 9 months ago

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

oukanghua commented 9 months ago

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")
wargio commented 9 months ago

please how are you building this?

oukanghua commented 9 months ago
$  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.

wargio commented 9 months ago

what is that patch and how i get it?

wargio commented 9 months ago

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.

oukanghua commented 9 months ago

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.

wargio commented 9 months ago

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.