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 @ 2024-08-21 18:08  Leonardo-li  阅读(3)  评论(0编辑  收藏  举报