Last active
May 16, 2018 16:43
-
-
Save amanualt/60f939de9d9514b77154ce440e23dcb8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
#install nginx | |
apt install -y dpkg-dev build-essential \ | |
zlib1g-dev \ | |
libpcre3 \ | |
libpcre3-dev \ | |
unzip \ | |
python-software-properties \ | |
software-properties-common \ | |
libpcre3 \ | |
libpcre3-dev \ | |
uuid-dev \ | |
bzip2 \ | |
libssl-dev \ | |
daemon \ | |
libgeoip-dev | |
#create parent direktory | |
mkdir -p ~/nginx/modules | |
#install pagespeed | |
NPS_VERSION=1.13.35.2-stable | |
cd ~/nginx/modules | |
wget https://github.com/apache/incubator-pagespeed-ngx/archive/v${NPS_VERSION}.zip | |
unzip v${NPS_VERSION}.zip | |
nps_dir=$(find . -name "*pagespeed-ngx-${NPS_VERSION}" -type d) | |
cd "$nps_dir" | |
NPS_RELEASE_NUMBER=${NPS_VERSION/beta/} | |
NPS_RELEASE_NUMBER=${NPS_VERSION/stable/} | |
psol_url=https://dl.google.com/dl/page-speed/psol/${NPS_RELEASE_NUMBER}.tar.gz | |
[ -e scripts/format_binary_url.sh ] && psol_url=$(scripts/format_binary_url.sh PSOL_BINARY_URL) | |
wget ${psol_url} | |
tar -xzvf $(basename ${psol_url}) # extracts to psol/ | |
#install naxis | |
NNX_VERSION=master | |
NNX_NAME=ngx_naxsi | |
cd ~/nginx/modules | |
wget https://github.com/nbs-system/naxsi/archive/${NNX_VERSION}.zip | |
unzip ${NNX_VERSION}.zip | |
#install cache purge | |
cd ~/nginx/modules | |
wget https://github.com/FRiCKLE/ngx_cache_purge/archive/2.3.zip | |
unzip 2.3.zip | |
#INSTALL NGINX | |
NGINX_VERSION=1.14.0 | |
cd ~/nginx/ | |
wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz | |
tar -xvzf nginx-${NGINX_VERSION}.tar.gz | |
cd nginx-${NGINX_VERSION}/ | |
./configure --add-module=$HOME/$nps_dir \ | |
--add-module=/root/nginx/modules/naxsi-master/naxsi_src \ | |
--add-module=/root/nginx/modules/ngx_cache_purge-2.3 | |
make | |
make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment