江湖浪人 发表于 2018-11-16 10:13:19

nginx安装部署脚本

  #!/bin/bash
  ##############################################################
  # File Name: c.sh
  # Version: V1.0
  # Author: wanglong
  # Organization: www.oldboyedu.com
  # Created Time : 2017-08-29 12:01:03
  # Description:
  ##############################################################
  [ -d /home/oldboy/tools ]||mkdir -p /home/oldboy/tools
  [ -d /application ]||mkdir -p /application
  id www
  [ $? -eq 0 ]||useradd www -s /sbin/nologin -M
  rpm -qa pcre pcre-devel
  [ $? -eq 0 ]&&yum install pcre pcre-devel -y
  rpm -qa openssl openssl-devel
  [ $? -eq 0 ]&&yum install openssl openssl-devel -y
  cd /home/oldboy/tools/&&wget http://nginx.org/download/nginx-1.10.3.tar.gz
  [ $? -eq 0 ]&&\
  tar xf nginx-1.10.3.tar.gz
  cd nginx-1.10.3
  ./configure --user=www --group=www --prefix=/application/nginx-1.10.3 --with-http_stub_status_module --with-http_ssl_module
  [ $? -eq 0 ]&&\
  make&&make install
  [ $? -eq 0 ]&&\
  ln -s /application/nginx-1.10.3 /application/nginx
  cd /application/nginx/conf/&&egrep -v "#|^$" nginx.conf.default >nginx.conf
  lsof -i:80
  [ $? -eq 0 ]&&echo qidong||/application/nginx/sbin/nginx

页: [1]
查看完整版本: nginx安装部署脚本