google / ngx_brotli

NGINX module for Brotli compression
BSD 2-Clause "Simplified" License
2.1k stars 216 forks source link

Debian installation instructions #92

Closed Daniel15 closed 4 years ago

Daniel15 commented 4 years ago

Would be good to have this on a wiki... In @eustas's fork I sent a PR to add some basic instructions in the README (https://github.com/eustas/ngx_brotli/pull/34) but it seems like that's not present in this repo. Would you like instructions in the repo, or would you prefer some docs somewhere?

This is the approach I took:

# Get this source code
cd /usr/local/src
git clone git://github.com/google/ngx_brotli.git

# Get the Nginx Debian package source code
cd /usr/local/src/
apt source nginx
cd nginx-1.x.x

# Find the ./configure line Nginx was compiled with
nginx -V

# Call `./configure` with the arguments from "configure arguments:" output above, **except** for the `--add-dynamic-module` ones, and append `--add-dynamic-module=../ngx_brotli` to the end
./configure --with-cc-opt='-g -O2 ....................... --add-dynamic-module=../ngx_brotli

# Build and copy build modules to the right place
make modules
cp objs/ngx_http_brotli_filter_module.so /usr/local/lib/nginx/modules/
cp objs/ngx_http_brotli_static_module.so /usr/local/lib/nginx/modules/

Enable by adding to /etc/nginx/modules-enabled/brotli-static.conf:

load_module /usr/local/lib/nginx/modules/ngx_http_brotli_filter_module.so;
load_module /usr/local/lib/nginx/modules/ngx_http_brotli_static_module.so;
eustas commented 4 years ago

Will add instructions here as well soon =) Thanks!

eustas commented 4 years ago

Added content from eustas/ngx_brotli. Feel free to send a PR to extend the README.md here.