nginx--源码包一键安装搭建脚本.sh

2022-09-19 11:32:18 浏览数 (1)

代码语言:javascript复制
#!/bin/bash
#解压压缩包
tar -xvf nginx-1.19.8.tar.gz 
cd nginx-1.19.8/
useradd -r -s /sbin/nologin nginx
yum -y install gcc gcc-c   pcre-devel openssl openssl-devel zlib-devel ncurses-devel cmake bison libxml2-devel libpng-devel
./configure --prefix=/usr/local/nginx --user=nginx --group=nginx --with-http_stub_status_module --with-http_ssl_module
make
make install
#需要提前加入执行权限chmod  x /etc/rc.d/rc.local
echo "/usr/local/nginx/sbin/nginx" >> /etc/rc.local
chmod  x /etc/rc.local
#给rc.local加上可执行权限

0 人点赞