大网数据广告活动
服务器运维问答

How to install the brotli nginx module properly on debian

· 52CE 我爱测

I'm trying to setup brotly compression on a nginx/1.10.3 server running on Debian 9.5 Stretch / Linux 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u5 (on a lightsail instance). I used the following commands to try to install it: $ s…

问题原文

原帖链接 · Simon · CC BY-SA 4.0

I'm trying to setup brotly compression on a nginx/1.10.3 server running on Debian 9.5 Stretch / Linux 4.9.0-8-amd64 #1 SMP Debian 4.9.110-3+deb9u5 (on a lightsail instance). I used the following commands to try to install it:

$ sudo apt-add-repository -y ppa:hda-me/nginx-stable
$ sudo apt-get update
$ sudo apt-get install brotli nginx nginx-module-brotli

Unfortunatly the first one fails:

gpg: keybox '/tmp/tmpwhmks25f/pubring.gpg' created
gpg: /tmp/tmpwhmks25f/trustdb.gpg: trustdb created
gpg: key 1F5EB010C5341279: public key "Launchpad PPA for hda_launchpad" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: no valid OpenPGP data found.

which causes that the package cannot be installed, so running the last command (after suto apt-get update) ends with that the package can't be found:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nginx-module-brotli

I'ved looked up several docs but there are only infos about installing it on CentOS or ubuntu.

已采纳解答

原帖链接 · hotenov · CC BY-SA 4.0

There is no official Debian module for nginx (not so far), but you can compile and add dynamic modules for Brotli compression.

What is dynamic module and how to configure it, read documentation.

You can clone brotli modules from here and compile it (see section "Other Platforms - Dynamically loaded" carefully).

Also this guide helped me understand what configure arguments I can remove (spoiler: all dynamic modules, except brotli)

You may need additional dependencies to compile (such as libbrotli-dev and others). Look for another manuals in this direction.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-07-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。