全球主机交流论坛
标题:
Nginx编译ngx_brotli老是出现奇奇怪怪的问题
[打印本页]
作者:
yanyuo
时间:
2022-3-17 14:23
标题:
Nginx编译ngx_brotli老是出现奇奇怪怪的问题
运维阿宏 管理员 发表于 4 小时前 | 只看该作者
您好,服务器命令行执行以下命令安装依赖后再试试
apt-get install gcc gcc-c++ gcc-g77
复制代码
root@debian:~# apt-get install gcc gcc-c++ gcc-g77
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package gcc-c+
E: Couldn't find any package by regex 'gcc-c+'
E: Unable to locate package gcc-g77
复制代码
root@debian:~# apt update
Hit:1 https://mirrors.cloud.tencent.com/debian buster InRelease
Get:2 https://mirrors.cloud.tencent.com/debian buster-updates InRelease [51.9 kB]
Get:3 https://mirrors.cloud.tencent.com/debian buster-backports InRelease [46.7 kB]
Get:4 https://mirrors.cloud.tencent.com/debian-security buster/updates InRelease [65.4 kB]
Fetched 164 kB in 1s (173 kB/s)
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
root@debian:~# apt install -y make cmake gcc gcc-c++ gcc-g77 autoconf automake
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package gcc-c+
E: Unable to locate package gcc-g77
复制代码
作者:
whl32
时间:
2022-3-17 14:24
没有看到奇怪的问题
作者:
Ticifer
时间:
2022-3-17 14:38
ngx_brotli从github拉:
git clone https://github.com/google/ngx_brotli.git
cd ngx_brotli
git submodule update --init
cd ..
gcc相关:
#gcc
yum -y install centos-release-scl && yum -y install centos-release-scl devtoolset-7-gcc devtoolset-7-gcc-c++ devtoolset-7-binutils && scl enable devtoolset-7 bash
#需要注意的是scl命令启用只是临时的,退出shell或重启就会恢复原系统gcc版本。
#如果要长期使用gcc 7.3的话:
echo "source /opt/rh/devtoolset-7/enable" >>/etc/profile
上述命令基于centos7-1810 其他系统自行替换
作者:
眼儿媚
时间:
2022-3-17 14:46
腾讯云的源需要腾讯自己的DNS才能在正常,你可定更换腾讯的默认DNS了
作者:
乌拉擦
时间:
2022-3-17 21:10
.进入宝塔面板 --软件列表--Nginx安装(已安装的需要卸载)--选择编译安装--添加自定义模块:
模块名称:
Nginx Brotli压缩
全选代码复制
模块描述:
Nginx Brotli压缩模块
全选代码复制
模块参数:
--add-module=/www/server/ngx_brotli
全选代码复制
前置脚本:
cd /www/server
git clone https://github.com/google/ngx_brotli
cd ngx_brotli && git submodule update --init
全选代码复制
安装成功后,输入nginx -V 查看返回代码结尾包含 --add-module=/www/server/ngx_brotli
欢迎光临 全球主机交流论坛 (https://443502.xyz/)
Powered by Discuz! X3.4