码迷,mamicode.com
首页 > 其他好文 > 详细

nginx编译安装脚本

时间:2017-07-13 19:05:48      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:nginx

#!/bin/bash
#Date:2017-05-05 By Allen_Jol
#--------- YUm Install related components------
sleep 3
yum install -y yum -y install make gcc gcc-c++  cmake openssl openssl-devel zlib zlib-devel


mkdir -p /usr/local/nginx

mkdir /lnmpsoftware
cd /lnmpsoftware
#-----------------Download Nginx-------------------
sleep 3
if [ ! -f nginx-1.8.1.tar.gz ]
then
  wget http://nginx.org/download/nginx-1.8.1.tar.gz
fi
#-----------------Install Nginx server--------------
sleep 3


if [ ! -d /usr/local/nginx ]
then
  mkdir /usr/local/nginx
fi
tar -zxvf nginx-1.8.1.tar.gz
cd nginx-1.8.1
if [ ! -f /usr/local/nginx/sbin/nginx ]
then
  ./configure --prefix=/usr/local/nginx --sbin-path=/usr/local/nginx/sbin/nginx \
> --with-http_ssl_module
sleep 1
make && make install
fi


#------------------start  nginx service-------------
/usr/local/nginx/sbin/nginx
iptables -I INPUT  -p tcp --dport 80 -j ACCEPT
service iptables save


nginx编译安装脚本

标签:nginx

原文地址:http://12262646.blog.51cto.com/12252646/1947242

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!