Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Variabelen, geef hier de versie in, OpenSSL moet al klaargemaakt zijn
- NGINXV="1.11.9"
- OPENSSLV="1.0.2j"
- NPS_VERSION="1.12.34.1"
- # Pagespeed voorbereiden
- cd
- rm -f release-${NPS_VERSION}-beta.zip
- rm -rf ngx_pagespeed-${NPS_VERSION}-beta/
- wget https://github.com/pagespeed/ngx_pagespeed/archive/v${NPS_VERSION}-beta.zip -O release-${NPS_VERSION}-beta.zip
- unzip release-${NPS_VERSION}-beta.zip
- cd ngx_pagespeed-${NPS_VERSION}-beta/
- wget https://dl.google.com/dl/page-speed/psol/${NPS_VERSION}-x64.tar.gz
- tar -xzvf ${NPS_VERSION}-x64.tar.gz # extracts to psol/
- # Systeemvariabelen
- PATH=/usr/lib/ccache:$PATH
- DEB_CFLAGS_SET="-O3 -march=native -flto -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security"
- DEB_CXXFLAGS_SET="-O3 -march=native -flto -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security"
- DEB_FFLAGS_SET="-O3"
- DEB_LDFLAGS_SET="-Wl,-z,relro -flto"
- # De Git sources bijwerken
- sudo rm -rf /usr/local/src/ngx_brotli_module
- git clone --recursive https://github.com/cloudflare/ngx_brotli_module.git /usr/local/src/ngx_brotli_module
- # Downloaden, uitpakken en opschonen sources
- cd /usr/local/src
- curl -o nginx.tar.gz http://nginx.org/download/nginx-$NGINXV.tar.gz
- tar -zxf nginx.tar.gz
- rm -f nginx.tar.gz
- cd /usr/local/src/nginx-$NGINXV
- make clean
- # Patchen sources
- curl -O "https://raw.githubusercontent.com/cloudflare/sslconfig/master/patches/nginx__1.11.5_dynamic_tls_records.patch"
- patch -p1 < nginx__1.11.5_dynamic_tls_records.patch
- # Configureren
- ./configure \
- --add-module=/usr/local/src/ngx_brotli_module \
- --add-module=$HOME/ngx_pagespeed-${NPS_VERSION}-beta \
- --prefix=/opt/nginx \
- --user=www-data \
- --group=www-data \
- --with-http_ssl_module \
- --with-http_v2_module \
- --with-openssl=/usr/local/src/openssl-$OPENSSLV \
- --with-openssl-opt="enable-ec_nistp_64_gcc_128 threads" \
- --with-pcre-jit \
- --with-file-aio \
- --with-http_flv_module \
- --with-http_geoip_module \
- --with-http_gunzip_module \
- --with-http_mp4_module \
- --with-http_realip_module \
- --with-http_stub_status_module \
- --with-threads \
- --with-cc-opt="-DTCP_FASTOPEN=23 -O3 -march=native -flto" \
- --with-ld-opt="-DTCP_FASTOPEN=23 -O3 -march=native -flto"
- # Installeren en opschonen
- sudo nice make install
- rm -rf /usr/local/src/nginx-$NGINXV
- # Vergeet niet de service te herstarten
- echo "Vergeet niet de services te herstarten: sudo systemctl restart memcached nginx"
Add Comment
Please, Sign In to add comment