Showing posts with label nginx. Show all posts
Showing posts with label nginx. Show all posts

Sunday, June 6, 2021

Program open port 80 with normal user

sudo apt-get install libcap2-bin
sudo setcap 'cap_net_bind_service=+ep' /path/to/program

Saturday, June 5, 2021

Dynamic install module Nginx

 Example for ModSecurity-nginx

$ cd nginx-version
$ ./configure --with-compat --add-dynamic-module=../ModSecurity-nginx
$ make modules
$ cp objs/ngx_http_modsecurity_module.so /etc/nginx/modules

Tuesday, June 1, 2021

Build Nginx from source for Debian 10

 apt install libssl-dev

wget https://ftp.pcre.org/pub/pcre/pcre-8.44.tar.gz

tar -zxf pcre-8.44.tar.gz
cd pcre-8.44
./configure
make

cd \

wget http://zlib.net/zlib-1.2.11.tar.gz
tar -zxf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure
make

cd \

wget http://nginx.org/download/nginx-1.20.1.tar.gz

mkdir -p nginx/3party_module

mkdir -p nginx/nginx-rtmp-module

touch nginx/3party_module/config

touch nginx/nginx-rtmp-module/config

cd nginx-1.20.1

./configure --prefix=/home/othername/nginx --sbin-path=/home/othername/nginx/nginx --conf-path=/home/othername/nginx/nginx.conf --pid-path=/home/othername/nginx/nginx.pid --with-http_ssl_module --with-stream --with-mail=dynamic --add-module=/home/othername/nginx/nginx-rtmp-module --add-dynamic-module=/home/othername/nginx/3party_module  --with-pcre=../pcre-8.44 --with-zlib=../zlib-1.2.11

make

make install