Nginx离线安装

4 篇文章 0 订阅

1、下载资源

https://download.csdn.net/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





  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值