nginx源码编译自定义版本号

复制代码
1.下载1.20.2源码包
[root@localhost service]# cd /data/build/nginx-1.20.2/
[root@localhost nginx-1.20.2]# ls
auto  CHANGES  CHANGES.ru  conf  configure  contrib  html  LICENSE  Makefile  man  objs  README  src


2.在nginx源码包中编辑此文件
src/core/nginx.h
修改:
#define nginx_version      1020002
#define NGINX_VERSION      "1.20.2"
为:
#define nginx_version 1230002
#define NGINX_VERSION "1.23.2"

3.进行配置
./configure --prefix=/data/service/nginx \
--with-http_stub_status_module \
--with-http_gzip_static_module \
--with-http_ssl_module \
--with-http_mp4_module \
--with-stream \
--with-http_realip_module \
--with-http_v2_module \
--with-http_sub_module \
--with-pcre=../pcre-8.45 \
--with-zlib=../zlib-1.3.1 \
--with-openssl=../openssl-3.3.0 \
--add-module=../nginx-http-flv-module-1.2.11

4.编译
make -j$(nporc) && make install

5.这样就会把nginx1.20.2版本修改为1.23.2,但其内容还是1.20.2的,只是修改了版本号
复制代码

 

posted @   Leonardo-li  阅读(23)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· winform 绘制太阳,地球,月球 运作规律
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· AI 智能体引爆开源社区「GitHub 热点速览」
· 写一个简单的SQL生成工具
· Manus的开源复刻OpenManus初探
点击右上角即可分享
微信分享提示