nginx编译安装脚本-1.18.0版本
#!/bin/bash
#目录在 /usr/local/nginx
echo "start"
wget http://nginx.org/download/nginx-1.18.0.tar.gz
tar xf nginx-1.18.0.tar.gz
yum install gcc zlib zlib-devel pcre pcre-devel openssl openssl-devel -y
groupadd -g 995 nginx
useradd -g nginx -M -s /sbin/nologin -u 995 nginx
mkdir /var/log/nginx
cd nginx-1.18.0
./configure --user=nginx --group=nginx --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_sub_module --with-http_ssl_module --with-pcre --with-stream --with-stream_ssl_module
sleep 8 #可有可无
make && make install
echo -e '\E[31m start nginx!!! \E[0m'
/usr/local/nginx/sbin/nginx
netstat -nlpt | grep 80

浙公网安备 33010602011771号