创建nginx1.22离线安装包
1、创建用户
groupadd builder
useradd -r -g builder -s /bin/false builder
2、安装 nginx 源码构建包
rpm -ivh http://nginx.org/packages/centos/7/SRPMS/nginx-1.22.1-1.el7.ngx.src.rpm
3、 安装依赖
yum install -y openssl-devel zlib-devel pcre-devel rpm-build gcc-c++ pcre2-devel
4、构建
cd rpmbuild/SPECS
rpmbuild -bb nginx.spec
5、安装
cd ../RPMS/x86_64 # 下面会有rpm安装包,直接拷贝出来就可以了
yum localinstall *.rpm