#安装依赖包
yum -y install gcc pcre pcre-devel zlib zlib-devel openssl openssl-devel
#下载NGINX
curl -O https://nginx.org/download/nginx-1.21.6.tar.gz
#解压NGINX
tar -zxvf nginx-1.21.6.tar.gz
cd nginx-1.21.6.tar.gz
#配置
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
#编译和安装
make && make install
#启动、重载、停止
./nginx
./nginx -s reload
./nginx -s stop