ubuntu24.04 编译安装 Nginx 1.26.2

[复制链接]
发表于 2026-1-29 16:46:13 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
写在前面

如题,本文将给出基于ubuntu24.04体系通过编译安装 Nginx 1.26.2 , 并将其设置为体系服务的完备方法。
安装步调

1. gcc 安装

  1. cd ~
  2. apt update
  3. apt install build-essential libpcre3-dev libssl-dev
  4. gcc --version
复制代码
2. prce 安装

版本查询
  1. wget https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.44/pcre2-10.44.tar.gz
  2. tar -zxvf pcre2-10.44.tar.gz
  3. cd pcre2-10.44/
  4. ./configure
  5. make
  6. make install
复制代码
3. zlib 安装

版本查询
  1. cd ~
  2. wget https://github.com/madler/zlib/releases/download/v1.3.1/zlib-1.3.1.tar.gz
  3. tar -zxvf zlib-1.3.1.tar.gz
  4. cd zlib-1.3.1/
  5. ./configure
  6. make
  7. make install
复制代码
4. openssl安装

版本查询
  1. cd ~
  2. wget https://github.com/openssl/openssl/releases/download/openssl-3.3.1/openssl-3.3.1.tar.gz
  3. tar -zxvf openssl-3.3.1.tar.gz
  4. cd openssl-3.3.1/
  5. ./config --prefix=/usr
  6. make
复制代码
5. nginx 1.26.2(当前最新版) 安装

版本查询
编译模块查询
  1. cd ~
  2. wget https://nginx.org/download/nginx-1.26.2.tar.gz
  3. tar -zxvf nginx-1.26.2.tar.gz
  4. cd nginx-1.26.2/
  5. ./c
复制代码
回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表