Created
August 11, 2017 08:32
-
-
Save dfang/ca8a6c96c9bc4a4e8ee1e930267d1a3a to your computer and use it in GitHub Desktop.
compile nginx with pagespeed dynamic module support
This file contains hidden or 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
| NPS_VERSION=1.12.34.2-stable | |
| NPS_RELEASE_NUMBER=${NPS_VERSION/stable/} | |
| sudo apt-get update \ | |
| && sudo apt-get install -y unzip \ | |
| && sudo apt-get build-dep nginx=1.13.3 \ | |
| && cd \ | |
| && apt-get source nginx=1.13.3 \ | |
| && cd \ | |
| && wget https://github.com/pagespeed/ngx_pagespeed/archive/v${NPS_VERSION}.zip \ | |
| && unzip v${NPS_VERSION}.zip \ | |
| && sudo mv ngx_pagespeed-${NPS_VERSION} ngx_pagespeed \ | |
| && cd ngx_pagespeed \ | |
| && 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}) \ | |
| && cd $HOME/nginx* \ | |
| && ./configure --prefix=/etc/nginx \ | |
| --sbin-path=/usr/sbin/nginx \ | |
| --user=nginx \ | |
| --group=nginx \ | |
| --with-poll_module \ | |
| --with-threads \ | |
| --with-http_ssl_module \ | |
| --with-http_v2_module \ | |
| --with-http_realip_module \ | |
| --with-http_addition_module \ | |
| --add-dynamic-module=$HOME/ngx_pagespeed \ | |
| && make \ | |
| && sudo make install |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://modpagespeed.com/doc/build_ngx_pagespeed_from_source
https://www.digitalocean.com/community/tutorials/how-to-add-ngx_pagespeed-to-nginx-on-ubuntu-14-04
https://www.digitalocean.com/community/questions/best-ppa-for-nginx-with-google-pagespeed-2