在没有外网的情况,进行编译安装,仅供参考!
echo "#-------------安装gcc------------------"`在这里插入代码片`
cd /app/work/nginx/gcc_rpm
rpm -ivh mpfr-3.1.1-4.el7.x86_64.rpm --nodeps --force
rpm -ivh libmpc-1.0.1-3.el7.x86_64.rpm --nodeps --force
rpm -ivh kernel-headers-3.10.0-957.el7.x86_64.rpm --nodeps --force
rpm -ivh glibc-headers-2.17-260.el7.x86_64.rpm --nodeps --force
rpm -ivh glibc-devel-2.17-260.el7.x86_64.rpm --nodeps --force
rpm -ivh cpp-4.8.5-36.el7.x86_64.rpm --nodeps --force
rpm -ivh gcc-4.8.5-36.el7.x86_64.rpm --nodeps --force
echo "#-------------安装pcre----------------"
tar -zxvf /app/work/nginx/pcre-8.21.tar.gz -C /app/os
cd /app/os/pcre-8.21/
./configure
make && make install
echo "#-----------安装zlib----------------"
tar -xvf /app/work/nginx/zlib-1.2.8.tar.gz -C /app/os
cd /app/os/zlib-1.2.8
./configure
make && make install
echo "#----------安装openssl-------------"
tar -zxvf /app/work/nginx/openssl-fips-2.0.14.tar.gz -C /app/os
cd /app/os/openssl-fips-2.0.14
./config
make && make install
echo "#---------安装nginx---------------"
tar -xvf /app/work/nginx/nginx-1.18.0.tar.gz -C /usr/local
cd /usr/local/nginx-1.18.0
./configure --prefix=/usr/local/nginx
make && make install
/usr/local/nginx/sbin/nginx
if [[ $? = 0 ]];then
echo "nginx编译安装成功"
else
ln -s /usr/local/lib/libpcre.so.0 /lib64
/usr/local/nginx/sbin/nginx >>/dev/null
if [[ $? = 0 ]];then
echo "NGINX编译安装成功"
else
echo "安装有问题,请手动安装"
fi
fi
|