一键安装nginx(auto_nginx_install.sh
```
#!/bin/bash
#auto install nginx
#by 杨进 2021-02
#nginx define path variable
#加入变量后期维护更加简单,智能化
#替换所有的的 %s#yum install -y#$NGINX_YUM#g
#删除nginx-1.12.2.tar.gz后面的 .tar.gz sed 's/.tar.*//g'
NGINX_VER=1.12.2 #如果改成$1 启动脚本 sh auto_install_nginx_v2.sh XXXXX(版本号)
NGINX_SOFT=nginx-${NGINX_VER}.tar.gz
NGINX_DIR=/usr/local/nginx
NGINX_YUM="yum install -y"
NGINX_SRC=$(echo $NGINX_SOFT|sed 's/.tar.*//g')
NGINX_URL="http://nginx.org/download"
NGINX_ARGS="--user=www --group=www"
$NGINX_YUM wget gzip tar make gcc
$NGINX_YUM pcre pcre-devel zlib-devel openssl-devel
wget -c $NGINX_URL/$NGINX_SOFT
tar -xzf nginx-1.12.2.tar.gz
cd nginx-1.12.2
useradd -s /sbin/nologin www -M
./configure --prefix=$NGINX_DIR $NGINX_ARGS --with-http_ssl_module --with-http_stub_status_module
make
make install
$NGINX_DIR/sbin/nginx
ps -ef|grep -w 80
setenforce 0 firewall-cmd--add-port=80/tcp --permanent
systemctl reload firewalld.service
```