Skip to content

Instantly share code, notes, and snippets.

@binhqd
Created November 1, 2017 03:10
Show Gist options
  • Save binhqd/4b3cc04eeb47a4ddc6dc3bd336780382 to your computer and use it in GitHub Desktop.
Save binhqd/4b3cc04eeb47a4ddc6dc3bd336780382 to your computer and use it in GitHub Desktop.
sudo apt-get install -y build-essential zlib1g-dev libpcre3 libpcre3-dev unzip
NPS_VERSION=1.12.34.2-stable
cd
wget https://github.com/pagespeed/ngx_pagespeed/archive/v${NPS_VERSION}.zip
unzip v${NPS_VERSION}.zip
cd ngx_pagespeed-${NPS_VERSION}/
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/
NGINX_VERSION=1.13.3
cd
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/ngx_pagespeed-${NPS_VERSION} ${PS_NGX_EXTRA_FLAGS} --prefix=/opt/nginx-pagespeed
make
sudo make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment