shell脚本:一键安装 nginx
#!/bin/bash
echo "安装依赖"
yum -y install gcc zlib zlib-devel pcre-devel openssl openssl-devel
echo "下载nginx"
cd /usr/local
wget http://nginx.org/download/nginx-1.13.7.tar.gz
echo "解压"
tar -zxvf nginx-1.13.7.tar.gz
cd /usr/local/nginx-1.13.7
echo "编译安装"
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
make && make install
echo "启动nginx"
cd /usr/local/nginx/sbin
./nginx