Skip to content

Instantly share code, notes, and snippets.

@kewubenduben
Last active August 18, 2017 16:40
Show Gist options
  • Save kewubenduben/a7825f52c59c0ced2f023dd3c906951f to your computer and use it in GitHub Desktop.
Save kewubenduben/a7825f52c59c0ced2f023dd3c906951f to your computer and use it in GitHub Desktop.
nginx modsecurity ubuntu 16.04
sudo -i
apt-get update
apt-get install \
apache2-dev \
autoconf \
automake \
build-essential \
bzip2 \
checkinstall \
devscripts \
flex \
g++ \
gcc \
git \
graphicsmagick-imagemagick-compat \
graphicsmagick-libmagick-dev-compat \
libaio-dev \
libaio1 \
libass-dev \
libatomic-ops-dev \
libavcodec-dev \
libavdevice-dev \
libavfilter-dev \
libavformat-dev \
libavutil-dev \
libbz2-dev \
libcdio-cdda1 \
libcdio-paranoia1 \
libcdio13 \
libcurl4-openssl-dev \
libfaac-dev \
libfreetype6-dev \
libgd-dev \
libgeoip-dev \
libgeoip1 \
libgif-dev \
libgpac-dev \
libgsm1-dev \
libjack-jackd2-dev \
libjpeg-dev \
libjpeg-progs \
libjpeg8-dev \
liblmdb-dev \
libmp3lame-dev \
libncurses5-dev \
libopencore-amrnb-dev \
libopencore-amrwb-dev \
libpam0g-dev \
libpcre3 \
libpcre3-dev \
libperl-dev \
libpng12-dev \
libpng12-0 \
libpng12-dev \
libreadline-dev \
librtmp-dev \
libsdl1.2-dev \
libssl-dev \
libssl1.0.0 \
libswscale-dev \
libtheora-dev \
libtiff5-dev \
libtool \
libva-dev \
libvdpau-dev \
libvorbis-dev \
libxml2-dev \
libxslt-dev \
libxslt1-dev \
libxslt1.1 \
libxvidcore-dev \
libxvidcore4 \
libyajl-dev \
make \
openssl \
perl \
pkg-config \
tar \
texi2html \
unzip \
zip \
zlib1g-dev
cd /opt/
git clone https://github.com/SpiderLabs/ModSecurity
cd ModSecurity
git checkout -b libmodsecurity origin/libmodsecurity
sh build.sh
git submodule init
git submodule update
./configure
make
make install
cd /opt/
git clone https://github.com/SpiderLabs/ModSecurity-nginx
cd /opt/ModSecurity-nginx
cd /opt/
wget https://openresty.org/download/openresty-1.11.2.1.tar.gz
tar -xvzf openresty-1.11.2.1.tar.gz
cd openresty-1.11.2.1
./configure \
--add-module=/opt/ModSecurity-nginx \
--conf-path=/etc/nginx/nginx.conf \
--error-log-path=/var/log/nginx/error.log \
--group=www-data \
--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=/run/nginx.pid \
--prefix=/usr/share/nginx \
--sbin-path=/usr/sbin/nginx \
--user=www-data \
--with-debug \
--with-file-aio \
--with-http_addition_module \
--with-http_auth_request_module \
--with-http_dav_module \
--with-http_flv_module \
--with-http_geoip_module \
--with-http_gunzip_module \
--with-http_gzip_static_module \
--with-http_iconv_module \
--with-http_image_filter_module \
--with-http_mp4_module \
--with-http_perl_module \
--with-http_random_index_module \
--with-http_realip_module \
--with-http_secure_link_module \
--with-http_slice_module \
--with-http_ssl_module \
--with-http_stub_status_module \
--with-http_sub_module \
--with-http_v2_module \
--with-http_xslt_module \
--with-ipv6 \
--with-lua51 \
--with-mail \
--with-mail_ssl_module \
--with-pcre-jit \
--with-poll_module \
--with-select_module \
--with-stream \
--with-stream_ssl_module \
--with-threads
@semaf
Copy link

semaf commented Jul 15, 2017

How to run this file? .sh?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment