wargio / naxsi

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

Create Makefile #83

Closed Zorono closed 1 year ago

wargio commented 1 year ago

Can you explain why this is needed? PS: i appreciate the PR <3

Zorono commented 1 year ago

Can you explain why this is needed? PS: i appreciate the PR <3

to make it easy to build naxsi inside nginx for newbies(regardless of your CI workflow file...)... and there are some fixes for issues like

  1. nginx: [emerg] module "/usr/lib/nginx/modules/ngx_http_naxsi_module.so" is not binary compatible (e.g #84) --> with-compat flag

  2. nginx: [emerg] dlopen() "/usr/lib/nginx/modules/ngx_http_naxsi_module.so" failed (/usr/lib/nginx/modules/ngx_http_naxsi_module.so: undefined symbol: pcre_exec) --> --with-ld-options="-lpcre" (it requires libpcre-dev package to be installed... e.g: sudo apt-get install -y libpcre3-dev)

or (i didn't add this method for some reason...)

Build PCRE from source:

wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz
tar -zxvf pcre-8.44.tar.gz
cd pcre-8.44
./configure --prefix=/usr/local/pcre
make && sudo make install

configure step

cd /path/to/nginx
./configure --prefix=/etc/nginx \
            --with-pcre=/path/to/pcre-8.44 \
            --add-dynamic-module=/path/to/naxsi/naxsi_src
wargio commented 1 year ago

i understand, but the issue is that i expect people to read the instructions. Moreover the issue that you have mentioned are linked specifically on how debian/ubuntu builds their packages, which makes this Makefile a bit pointeless since the built shared lib cannot be used since the sources are not "compatible" with each other.