一、首先需要去国内相关镜像库下载相关依赖rpm:
http://mirrors.bfsu.edu.cn/centos-altarch/7.9.2009/os/aarch64/
http://mirror.nju.edu.cn/centos-altarch/7.9.2009/os/aarch64/
http://mirrors.tuna.tsinghua.edu.cn/centos-altarch/7.9.2009/os/aarch64/
http://mirrors.huaweicloud.com/centos-altarch/7.9.2009/os/aarch64/
http://mirror.xtom.com.hk/centos-altarch/7.9.2009/os/aarch64/
http://mirror-hk.koddos.net/centos-altarch/7.9.2009/os/aarch64/
http://mirror.aktkn.sg/centos-altarch/7.9.2009/os/aarch64/
http://ftp.yz.yamagata-u.ac.jp/pub/linux/centos-altarch/7.9.2009/os/aarch64/
http://mirror.truenetwork.ru/centos-altarch/7.9.2009/os/aarch64/
http://mirrors.powernet.com.ru/centos-altarch/7.9.2009/os/aarch64/
二、下载的rpm依赖有:
rpm -ivh cpp-4.8.5-44.el7.aarch64.rpm --nodeps --force
rpm -ivh gcc-4.8.5-44.el7.aarch64.rpm --nodeps --force
rpm -ivh gcc-c++-4.8.5-44.el7.aarch64.rpm --nodeps --force
rpm -ivh gcc-plugin-devel-4.8.5-44.el7.aarch64.rpm --nodeps --force
rpm -ivh glibc-devel-2.17-317.el7.aarch64.rpm --nodeps --force
rpm -ivh glibc-headers-2.17-317.el7.aarch64.rpm --nodeps --force
rpm -ivh kernel-headers-4.18.0-193.28.1.el7.aarch64.rpm --nodeps --force
rpm -ivh libmpc-1.0.1-3.el7.aarch64.rpm --nodeps --force
rpm -ivh mpfr-3.1.1-4.el7.aarch64.rpm --nodeps --force
rpm -ivh openssl-1.0.2k-19.el7.aarch64.rpm --nodeps --force
rpm -ivh openssl-devel-1.0.2k-19.el7.aarch64.rpm --nodeps --force
rpm -ivh pcre-8.32-17.el7.aarch64.rpm --nodeps --force
rpm -ivh pcre-devel-8.32-17.el7.aarch64.rpm --nodeps --force
rpm -ivh perl-Data-Dumper-2.145-3.el7.aarch64.rpm --nodeps --force
rpm -ivh zlib-1.2.7-18.el7.aarch64.rpm --nodeps --force
rpm -ivh zlib-devel-1.2.7-18.el7.aarch64.rpm --nodeps --force
rpm -ivh openssl-static-1.0.2k-19.el7.aarch64.rpm --nodeps --force
rpm -ivh openssl-perl-1.0.2k-19.el7.aarch64.rpm --nodeps --force
rpm -ivh openssl-libs-1.0.2k-19.el7.aarch64.rpm --nodeps --force
rpm -ivh unzip-6.0-21.el7.aarch64.rpm --nodeps --force
rpm -ivh zip-3.0-11.el7.aarch64.rpm --nodeps --force
rpm -ivh pcre-tools-8.32-17.el7.aarch64.rpm --nodeps --force
rpm -ivh pcre-static-8.32-17.el7.aarch64.rpm --nodeps --force
注意:1、博主是下载上面了这些包,实际看自己服务器具体缺失的包,可能需要增加一些
2、上面命令是下载好的包,上传到服务器执行安装的命令
三、去官网下载最新的nginx
四、编译安装nginx
#进入
cd /home/nginx
#解压
tar -zxvf nginx-1.22.1.tar.gz
#进入文件夹
/home/nginx/nginx-1.22.1
#不用开启https
./configure
#需要开启https,--with-openssl路径需要根据自己实际情况配置
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-openssl=/home/nginx/nginxarm/openssl-1.1.1l
make
make install
注意:--with-openssl=/home/nginx/nginxarm/openssl-1.1.1l里面的openssl可以根据自己实际情况配置,博主配置是因为已经安装了openssl,但是编译还是提示找不到路径,所以去官网下载了一个openssl进行编译,官网地址:https://www.openssl.org/source/
其他说明:这是arm架构离线安装nginx,如果是x86离线安装的话,镜像库选择就需要是x86镜像库:CentOS Mirror