一.安装必要的依赖
yum install gcc-c++ -y
yum install -y openssl openssl-devel
yum install -y zlib zlib-devel
yum install -y pcre pcre-devel
二.下载nginx安装包
进入usr/local里面创建nginx文件,方便后期删除干净
cd /usr/local
mkdir nginx
cd nginx
wget下载安装包
wget http://nginx.org/download/nginx-1.20.2.tar.gz
编译安装nginx
tar xvf nginx-1.20.2.tar.gz
cd nginx-1.20.2
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
编译和安装
make
make install
三、验证安装
启动nginx服务
cd /usr/local/nginx/sbin
./nginx
./nginx -s reload
./nginx -s stop
标签:local,cd,centos7,nginx,yum,usr,install,安装
From: https://www.cnblogs.com/zmh520/p/18307631