强上阿里云之NGINX安装

#创建www用户 [ -z "`grep www /etc/group`" ] && useradd www -s /sbin/nologin

创新互联建站专业为企业提供富平网站建设、富平做网站、富平网站设计、富平网站制作等企业网站建设、网页设计与制作、富平企业网站模板建站服务,十载富平做网站经验,不只是建网站,更提供有价值的思路和整体网络服务。

#安装pcre yum install pcre pcre-devel unzip gd-devel -y #创建软件下载目录 mkdir -p /data/web && mkdir -p /root/software && cd /root/software/ #下载软件 if [ ! -f nginx-1.12.0.tar.gz ];then wget -c http://scripts.showshowbaby.com/lnmp/soft/nginx-1.12.0.tar.gz #安装 tar zxvf nginx-1.12.0.tar.gz && cd nginx-1.12.0 ./configure --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_v2_module --with-http_ssl_module --with-http_gzip_static_module make && make install ln -sf /usr/local/nginx/sbin/nginx /usr/bin/nginx rm -rf /usr/local/nginx/logs && mkdir -p /data/wwwlogs/ && chown -R www.www /data/wwwlogs && ln -sf /data/wwwlogs /usr/local/nginx/logs #配置文件 rm -f /usr/local/nginx/conf/{fcgi.conf,mime.types,age-max.conf,nginx.conf} cd /usr/local/nginx/conf/ wget -c http://scripts.showshowbaby.com/lnmp/conf/{fcgi.conf,mime.types,age-max.conf,nginx.conf} mkdir -p /usr/local/nginx/conf/{ssl,vhost} ##下载配置日志切割计划任务 cd /root/sh/ && wget -c http://scripts.showshowbaby.com/lnmp/sh/nginx_cut_log.sh chmod +x nginx_cut_log.sh echo "00 00 * * * root /bin/bash /root/sh/nginx_cut_log.sh >/dev/null 2>&1" >> /etc/crontab ##下载添加虚拟主机脚本 wget -c http://scripts.showshowbaby.com/lnmp/sh/addnginx && mv addnginx /sbin/ && chmod +x /sbin/addnginx ##开机启动 cd /etc/init.d/ && wget -c http://scripts.showshowbaby.com/lnmp/sh/nginx && chmod +x /etc/init.d/nginx chkconfig nginx on #启动 /etc/init.d/nginx start


网页题目:强上阿里云之NGINX安装
文章来源:http://ybzwz.com/article/cpjgds.html