Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mklooss/1057e94da288419c25370cfd5a42c911 to your computer and use it in GitHub Desktop.
Save mklooss/1057e94da288419c25370cfd5a42c911 to your computer and use it in GitHub Desktop.
Build NGINX with Pagespeed Modul
https://github.com/apache/incubator-pagespeed-ngx/wiki/Building-PSOL-From-Source
I am using Debian Buster amd64!
Requirements:
- binutils >= 2.25
- chromium/tools/depot_tools
~# mkdir -p $HOME/bin
~# git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git $HOME/bin/depot_tools
~# export PATH=$PATH:~/bin/depot_tools
apt-get install \
libpng-dev build-essential zlib1g-dev libpcre3 libpcre3-dev unzip uuid-dev \
apache2-dev g++ python subversion gperf make devscripts fakeroot git curl \
virtualenv libwebp-dev libjpeg-dev yasm
We need python 2.7 - so we create an venv with this version
Otherwise you may getting an error about python3.x
~# virtualenv $HOME/.venv -p python2.7
~# . $HOME/.venv/bin/activate
Getting Data (BUILDTYPE=Release):
~# cd $HOME
~# rm -rf $HOME/incubator-pagespeed-mod
~# git clone https://github.com/apache/incubator-pagespeed-mod.git
~# cd $HOME/incubator-pagespeed-mod
may change branch
~# git submodule update --init --recursive
~# python build/gyp_chromium --depth=.
~# make BUILDTYPE=Release mod_pagespeed_test pagespeed_automatic_test -j`nproc`
Building Elements for NGINX (BUILDTYPE=Release):
~# cd $HOME/incubator-pagespeed-mod/pagespeed/automatic
~# make psol BUILDTYPE=Release CFLAGS+="-I/usr/include/apr-1" CXXFLAGS+="-I/usr/include/apr-1 -DUCHAR_TYPE=uint16_t" -j`nproc`
~# mkdir -p $HOME/ngx/psol/lib/Release/linux/x64
~# cp $HOME/incubator-pagespeed-mod/pagespeed/automatic/pagespeed_automatic.a $HOME/ngx/psol/lib/Release/linux/x64
Getting Data (BUILDTYPE=Debug):
~# cd $HOME
~# rm -rf $HOME/incubator-pagespeed-mod
~# git clone https://github.com/apache/incubator-pagespeed-mod.git
~# cd $HOME/incubator-pagespeed-mod
may change branch
~# git submodule update --init --recursive
~# python build/gyp_chromium --depth=.
~# make BUILDTYPE=Debug mod_pagespeed_test pagespeed_automatic_test -j`nproc`
Building Elements for NGINX (BUILDTYPE=Debug):
~# cd $HOME/incubator-pagespeed-mod/pagespeed/automatic
~# make psol BUILDTYPE=Debug CFLAGS+="-I/usr/include/apr-1" CXXFLAGS+="-I/usr/include/apr-1 -DUCHAR_TYPE=uint16_t" -j`nproc`
~# mkdir -p $HOME/psol/lib/Debug/linux/x64
~# cp $HOME/incubator-pagespeed-mod/pagespeed/automatic/pagespeed_automatic.a $HOME/ngx/psol/lib/Debug/linux/x64/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment