install_nginx.sh
#!/bin/bash
#安装依赖包
yum -y install zlib zlib-devel openssl openssl-devel pcre pcre-devel ncurses-devel
#环境创建
useradd -r -s /sbin/nologin -M www
#编译安装
cd /home/software
tar xf nginx-1.10.2.tar.gz
cd nginx-1.10.2
./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --with-http_realip_module
make && make install
编辑文件权限 chmod 755 nginx-1.10.2.tar.gz install_nginx.sh
运行 ./install_nginx.sh