1、下载资源
https://download.youkuaiyun.com/download/gdczcwq/86927507
2、安装编译工具
yum -y install gcc gcc-c++ autoconf automake make
3、运行脚本
path=$(pwd)
sourcecode=/usr/local/source-code
# 开放防火墙端口
firewall-cmd --add-port=1234/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-all
mkdir $sourcecode
cd $path
tar zxvf openssl-fips-2.0.10.tar.gz -C $sourcecode
cd /usr/local/source-code/openssl-fips-2.0.10
./config && make && make install
cd $path
tar zxvf pcre-8.40.tar.gz -C $sourcecode
cd /usr/local/source-code/pcre-8.40
./configure && make && make install
cd $path
tar zxvf zlib-1.2.11.tar.gz -C $sourcecode
cd /usr/local/source-code/zlib-1.2.11
./configure && make && make install
cd $path
tar zxvf nginx-1.20.1.tar.gz -C $sourcecode
cd /usr/local/source-code/nginx-1.20.1
./configure && make && make install
cd $path
cp -f ./nginx.conf /usr/local/nginx/conf/nginx.conf
chmod 777 /usr/local/nginx/sbin/nginx
# 编辑启动服务路径、命令
cp -f nginx /etc/init.d/nginx
chmod 777 /etc/init.d/nginx
chkconfig nginx on
chkconfig --list
chkconfig --list
#重启服务
systemctl stop nginx
systemctl start nginx
systemctl status nginx