美文网首页
nginx一键编译脚本

nginx一键编译脚本

作者: 山口肅彧 | 来源:发表于2018-08-22 17:35 被阅读0次
        #!/bin/bash  
        #nginx auto-deploy script by xiaojie     2018-02-08  
        path=/usr/local/src  
        vers=1.14.0  
        user=nginx
    
        yum install gcc gcc-c++ automake zlip     zlib-devel  pcre pcre-devel openssl wget openssl-devel -y  
        if [ $? -ne 0 ];then  
          echo "yum failed"  
        else  
          id $user  &>/dev/null
          [ $? -eq 0 ] && : || useradd  $user  -s /sbin/nologin -M  
          [ -d $path ] && : || mkdir -p $path    
          cd $path  
          [ -f nginx-${vers}.tar.gz ] && : ||   wget http://nginx.org/download/nginx-${vers}.tar.gz  
          if [ $? -ne 0 ];then    
              echo "download nginx false" && exit 1 
          else  
              tar xf nginx-$vers.tar.gz 
              cd $path/nginx-$vers     
              ./configure     --prefix=/usr/local/nginx-$vers  --user=$user --group=$user --with-http_stub_status_module   --with-http_ssl_module --with-http_gzip_static_module  --with-http_sub_module --with-pcre 
              make && make   install  
              [ $? -eq 0 ] && echo "nginx install success" || echo "nginx  install make error"
              ln -sf   /usr/local/nginx-$vers   /usr/local/nginx   
          fi     
        fi  
        mkdir -p /usr/local/nginx/conf/extra   
    

    相关文章

      网友评论

          本文标题:nginx一键编译脚本

          本文链接:https://www.haomeiwen.com/subject/jwvyiftx.html