nbs-system / naxsi

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

Error on Ubuntu 20 + nginx 1.20 #588

Closed javiercasares closed 11 months ago

javiercasares commented 2 years ago

I'm executing:

cd
wget https://github.com/nbs-system/naxsi/releases/download/1.3/ubuntu-focal-libnginx-mod-http-naxsi_1.3_amd64.deb -O /tmp/naxsi.deb
dpkg -i /tmp/naxsi.deb

and I'm getting:

nginx: [emerg] module "/usr/share/nginx/modules/ngx_http_naxsi_module.so" version 1018000 instead of 1020001 in /etc/nginx/modules-enabl...

Looking at the versions, I get that 1018000 is nginx 1.18, and 1020001 is nginx 1.20...

I'm using this nginx version https://launchpad.net/~ondrej/+archive/ubuntu/nginx

wargio commented 2 years ago

i guess, that the only option you have is to manually build it since the module you have installed is for the distro package and not for that user launchpad repo.

killmasta93 commented 2 years ago

Try this

wget http://nginx.org/download/nginx-1.21.6.tar.gz
wget https://github.com/nbs-system/naxsi/archive/master.zip
unzip master.zip
tar xzf nginx-1.21.6.tar.gz
./configure \
--conf-path=/etc/nginx/nginx.conf \
--add-module=../naxsi-master/naxsi_src/ \
--error-log-path=/var/log/nginx/error.log \
--http-client-body-temp-path=/var/lib/nginx/body \
--http-fastcgi-temp-path=/var/lib/nginx/fastcgi \
--http-log-path=/var/log/nginx/access.log \
--http-proxy-temp-path=/var/lib/nginx/proxy \
--http-scgi-temp-path=/var/lib/nginx/scgi \
--http-uwsgi-temp-path=/var/lib/nginx/uwsgi \
--lock-path=/var/lock/nginx.lock \
--pid-path=/var/run/nginx.pid \
--user=www-data \
--group=www-data \
--with-debug \
--with-compat \
--with-pcre-jit \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_auth_request_module \
--with-http_v2_module \
--with-http_dav_module \
--with-http_slice_module \
--with-threads \
--with-http_addition_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_image_filter_module=dynamic \
--with-http_sub_module \
--with-http_xslt_module=dynamic \
--with-stream=dynamic \
--with-stream_ssl_module \
--with-mail=dynamic \
--with-mail_ssl_module \
--prefix=/usr