Skip to content

Instantly share code, notes, and snippets.

@theraw
Last active May 29, 2021 18:38
Show Gist options
  • Save theraw/2a1fe68f8d70d49551533328237a9476 to your computer and use it in GitHub Desktop.
Save theraw/2a1fe68f8d70d49551533328237a9476 to your computer and use it in GitHub Desktop.
service nginx stop
killall nginx
rm -Rf /nginx
#LuaJIT Library
cd /opt/nginx/modules/; wget http://luajit.org/download/LuaJIT-2.0.5.tar.gz; tar -zxvf LuaJIT-2.0.5.tar.gz; cd LuaJIT-2.0.5; make install PREFIX=/usr/local/LuaJIT
ldconfig
# Download Nginx
mkdir -p /opt/nginx/sources/
rm -Rf /opt/nginx/sources/nginx-1.19.9/
cd /opt/nginx/sources/
wget 'http://nginx.org/download/nginx-1.19.9.tar.gz'
tar -xzvf nginx-1.19.9.tar.gz; rm -Rf nginx-1.19.9.tar.gz
cd /opt/nginx/sources/nginx-1.19.9/
curl -s https://gist.githubusercontent.com/theraw/bbbb096c9031493e54b11c687cda974a/raw/2abd802ad65d0b9449393a849cd2be56a107301c/nnbuild.sh > nbuild.sh
chmod +x nbuild.sh
./nbuild.sh
make -j`nproc`
make install
ldconfig
mkdir -p /nginx/live
mkdir -p /nginx/logs
mkdir -p /nginx/conf.d
touch /nginx/logs/access.log
touch /nginx/logs/error.log
cd /nginx/; mkdir conf.d; rm -Rf nginx.conf*; wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/nginx.conf
mkdir -p /nginx/live/
cd /nginx/live/
wget https://raw.githubusercontent.com/theraw/The-World-Is-Yours/master/static/vhost/default
cd /nginx/; mkdir db/; cd db/; wget https://github.com/theraw/The-World-Is-Yours/raw/master/static/GeoLite2-Country.mmdb
cd /nginx/; rm -Rf *.default
cp /opt/nginx/modules/naxsi/naxsi_config/naxsi_core.rules /nginx/naxsi_core.rules
cp /opt/ModSecurity/modsecurity.conf-recommended /nginx/modsecurity/modsecurity.conf
cd /opt/; git clone https://github.com/SpiderLabs/owasp-modsecurity-crs.git
cp -a /opt/owasp-modsecurity-crs/rules/ /nginx/modsecurity/
cp -a /opt/owasp-modsecurity-crs/crs-setup.conf.example /nginx/modsecurity/crs-setup.conf
touch /nginx/logs/error.log
clear
nginx -t
service nginx start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment