前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >yum安装的nginx添加http3

yum安装的nginx添加http3

原创
作者头像
峨眉山市雅铭网络
修改2022-03-07 21:17:14
8160
修改2022-03-07 21:17:14
举报
文章被收录于专栏:Linux云服务器Linux云服务器

安装编译环境

代码语言:shell
复制
dnf install gcc gcc-c++ pcre-devel openssl-devel zlib-devel cmake make go

克隆nginx http3依赖库

代码语言:shell
复制
$ git clone https://gitee.com/fenghuolingyun/boringssl.git
配置编译依赖
代码语言:shell
复制
cd boringssl
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..  配置发布稳定版本 默认使用`cmake .. `构建调试版本
make

报错添加全局go代理重新make

linux 、MAC
代码语言:shell
复制
export GO111MODULE=on   
export GOPROXY=https://mirrors.aliyun.com/goproxy/
Windows
代码语言:shell
复制
set GO111MODULE=on  
set GOPROXY=https://mirrors.aliyun.com/goproxy/

克隆源码库:

dnf install hg 或者 yum install hg

代码语言:shell
复制
hg clone -b quic https://hg.nginx.org/nginx-quic
cd nginx-quic

获取默认构建参数

代码语言:shell
复制
$ nginx -V

添加参数配置编译

代码语言:shell
复制
./auto/configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client\_temp --http-proxy-temp-path=/var/cache/nginx/proxy\_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi\_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi\_temp --http-scgi-temp-path=/var/cache/nginx/scgi\_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http\_addition\_module --with-http\_auth\_request\_module --with-http\_dav\_module --with-http\_flv\_module --with-http\_gunzip\_module --with-http\_gzip\_static\_module --with-http\_mp4\_module --with-http\_random\_index\_module --with-http\_realip\_module --with-http\_secure\_link\_module --with-http\_slice\_module --with-http\_ssl\_module --with-http\_stub\_status\_module --with-http\_sub\_module --with-http\_v2\_module --with-mail --with-mail\_ssl\_module --with-stream --with-stream\_realip\_module --with-stream\_ssl\_module --with-stream\_ssl\_preread\_module --with-http\_v3\_module --with-cc-opt=-I../boringssl/include --with-ld-opt='-L../boringssl/build/ssl -L../boringssl/build/crypto'

替换主程序

代码语言:shell
复制
$ cd objs && rm -rf /usr/sbin/nginx && cp ./nginx /usr/sbin/nginx

配置相关服务:

代码语言:txt
复制
$ systemctl enable nginx  创建开机启动
$ systemctl restart nginx  重新启动服务
```stemctl disable nginx 移除开机启动文档基于centos 8-stream编写

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 安装编译环境
  • 克隆nginx http3依赖库
    • 配置编译依赖
    • 报错添加全局go代理重新make
      • linux 、MAC
        • Windows
    • 克隆源码库:
    • 获取默认构建参数
    • 添加参数配置编译
    • 替换主程序
    • 配置相关服务:
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
    http://www.vxiaotou.com