赞
踩
#/bin/bash systemctl stop firewalld systemctl disable firewalld setenforce 0 mount /dev/mount /mnt yum -y install pcre-devel zlib-devel gcc gcc-c++ make useradd -M -s /sbin/nologin nginx echo "编译安装" cd /opt tar zxvf nginx-1.12.0.tar.gz -C /opt/ cd nginx-1.12.0/ ./configure \ --prefix=/usr/local/nginx \ --user=nginx \ --group=nginx \ --with-http_stub_status_module make && make install echo "优化路径" ln -s /usr/local/nginx/sbin/nginx /usr/local/sbin/ echo "添加 Nginx 系统服务" echo "[Unit] Description=nginx After=network.target [Service] Type=forking PIDFile=/usr/local/nginx/logs/nginx.pid ExecStart=/usr/local/nginx/sbin/nginx ExecrReload=/bin/kill -s HUP $MAINPID ExecrStop=/bin/kill -s QUIT $MAINPID PrivateTmp=true [install] WantedBy=multi-user.target" > /lib/systemd/system/nginx.service chmod 754 /lib/systemd/system/nginx.service systemctl start nginx.service systemctl enable nginx.service
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。