Add 'README.install-brotli'.
This commit is contained in:
parent
bd1a9ce52e
commit
493cda24b8
86
README.install-brotli
Normal file
86
README.install-brotli
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
# ==========
|
||||||
|
# Build dynamic Nginx module Brotli
|
||||||
|
# ==========
|
||||||
|
|
||||||
|
# Download ngx_brotli
|
||||||
|
#
|
||||||
|
cd /usr/local/src
|
||||||
|
git clone https://github.com/google/ngx_brotli.git
|
||||||
|
|
||||||
|
# download (clone) also submodules
|
||||||
|
#
|
||||||
|
git submodule update --init --recursive
|
||||||
|
|
||||||
|
|
||||||
|
# Find installed version of nginx
|
||||||
|
#
|
||||||
|
# nginx -v
|
||||||
|
#
|
||||||
|
# output like:
|
||||||
|
#
|
||||||
|
# nginx version: nginx/1.14.2
|
||||||
|
|
||||||
|
|
||||||
|
# Download nginx version 1.14.2
|
||||||
|
#
|
||||||
|
cd /usr/local/src/nginx
|
||||||
|
wget https://nginx.org/download/nginx-1.14.2.tar.gz
|
||||||
|
|
||||||
|
# Umpack nginx souce code archive
|
||||||
|
gunzip < nginx-1.14.2.tar.gz | tar -xf -
|
||||||
|
|
||||||
|
cd nginx-1.14.2/
|
||||||
|
|
||||||
|
|
||||||
|
# Configure nginx including dynamic brotli module
|
||||||
|
#
|
||||||
|
# From output of 'nginx -V' keep configure arguments,
|
||||||
|
|
||||||
|
# remove *all* flaggs like
|
||||||
|
#
|
||||||
|
# --add-dynamic-module=<path-to-module>
|
||||||
|
#
|
||||||
|
# add
|
||||||
|
#
|
||||||
|
# --add-dynamic-module=/usr/local/src/ngx_brotli
|
||||||
|
#
|
||||||
|
./configure --with-cc-opt='-g -O2 -fdebug-prefix-map=/build/nginx-tBUzFN/nginx-1.14.2=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -Wdate-time -D_FORTIFY_SOURCE=2' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -fPIC' --prefix=/usr/share/nginx --conf-path=/etc/nginx/nginx.conf --http-log-path=/var/log/nginx/access.log --error-log-path=/var/log/nginx/error.log --lock-path=/var/lock/nginx.lock --pid-path=/run/nginx.pid --modules-path=/usr/lib/nginx/modules --http-client-body-temp-path=/var/lib/nginx/body --http-fastcgi-temp-path=/var/lib/nginx/fastcgi --http-proxy-temp-path=/var/lib/nginx/proxy --http-scgi-temp-path=/var/lib/nginx/scgi --http-uwsgi-temp-path=/var/lib/nginx/uwsgi --with-debug --with-pcre-jit --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --with-http_auth_request_module --with-http_v2_module --with-http_dav_module --with-http_slice_module --with-threads --with-http_addition_module --with-http_flv_module --with-http_geoip_module=dynamic --with-http_gunzip_module --with-http_gzip_static_module --with-http_image_filter_module=dynamic --with-http_mp4_module --with-http_perl_module=dynamic --with-http_random_index_module --with-http_secure_link_module --with-http_sub_module --with-http_xslt_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-stream=dynamic --with-stream_ssl_module --with-stream_ssl_preread_module --add-dynamic-module=/usr/local/src/ngx_brotli
|
||||||
|
|
||||||
|
# Build modules
|
||||||
|
#
|
||||||
|
make modules
|
||||||
|
|
||||||
|
|
||||||
|
# Add and load the dynamic brotli modules to nginx service
|
||||||
|
#
|
||||||
|
mkdir -p /etc/nginx/modules
|
||||||
|
|
||||||
|
cp -a /usr/local/src/nginx/nginx-1.14.2/objs/ngx_http_brotli_filter_module.so /etc/nginx/modules/
|
||||||
|
cp -a /usr/local/src/nginx/nginx-1.14.2/objs/ngx_http_brotli_static_module.so /etc/nginx/modules/
|
||||||
|
|
||||||
|
|
||||||
|
# Create load_module statements for the two brotli modules
|
||||||
|
#
|
||||||
|
cat <<EOF > /etc/nginx/modules-available/http-brotli-filter-module.conf
|
||||||
|
load_module /etc/nginx/modules/ngx_http_brotli_filter_module.so;
|
||||||
|
EOF
|
||||||
|
|
||||||
|
cat <<EOF > /etc/nginx/modules-available/http-brotli-static-module.conf
|
||||||
|
load_module /etc/nginx/modules/ngx_http_brotli_static_module.so;
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
# Eanable Modules
|
||||||
|
#
|
||||||
|
ln -s ../modules-available/http-brotli-filter-module.conf /etc/nginx/modules-enabled/60-http-brotli-filter-module.conf
|
||||||
|
ln -s ../modules-available/http-brotli-static-module.conf /etc/nginx/modules-enabled/60-http-brotli-static-module.conf
|
||||||
|
|
||||||
|
# Verify if all is fine
|
||||||
|
#
|
||||||
|
nginx -t
|
||||||
|
|
||||||
|
|
||||||
|
# Restart Nginx webservice
|
||||||
|
#
|
||||||
|
systemctl restart nginx.service
|
||||||
|
|
Loading…
Reference in New Issue
Block a user