Last active
December 21, 2017 16:57
-
-
Save dmcyk/f907e3be0107aa6bd137392a94504946 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 | |
sudo apt-get install build-essential zlib1g-dev libpcre3 libpcre3-dev unzip libssl-dev | |
NPS_VERSION=1.12.34.3-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/ | |
# check http://nginx.org/en/download.html for the latest version | |
NGINX_VERSION=1.13.7 | |
cd | |
wget http://nginx.org/download/nginx-${NGINX_VERSION}.tar.gz | |
tar -xvzf nginx-${NGINX_VERSION}.tar.gz | |
cd nginx-${NGINX_VERSION}/ | |
./configure \ | |
--prefix=/etc/nginx \ | |
--sbin-path=/usr/sbin/nginx \ | |
--conf-path=/etc/nginx/nginx.conf \ | |
--pid-path=/var/run/nginx.pid \ | |
--lock-path=/var/run/nginx.lock \ | |
--error-log-path=/var/log/nginx/error.log \ | |
--http-log-path=/var/log/nginx/access.log \ | |
--with-http_gzip_static_module \ | |
--with-http_stub_status_module \ | |
--with-http_ssl_module \ | |
--with-pcre \ | |
--with-file-aio \ | |
--with-http_realip_module \ | |
--with-http_v2_module \ | |
--add-module=$HOME/$1/ngx_pagespeed-${NPS_VERSION} ${PS_NGX_EXTRA_FLAGS} | |
make | |
sudo make install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment