원 키 배치 nginx 가상 호스트

\ # 2018 년 1 월 13 일 12: 16: 14 \ # auto install Nginx and create virtual Hosts \ # by author xiaofan \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # \ # # \ # # # 설치 Nginx ServerNGINXDIR="/usr/local/nginx/"NGINX_SOFT="nginx-1.12.0.tar.gz"NGINX_SRC=$(echo $NGINX_SOFT|sed 's/.tar.*//g')NGINX_CNF="nginx.conf"NGINX_URL="http://nginx.org/download/"NGINX_DOMAIN="$1"
if [ $# -eq 0 ];thenecho -e "\033[32m-------------------\033[0m"echo -e "\033[32mUsage:{/bin/bash $0 v1.xiaofan.com|v2.xiaofan.com}\033[0m"exit 0fi
if [ ! -d $NGINX_DIR ];thenyum install pcre-devel pcre gcc gcc-c++ glibc glibc-devel zlib zlib-devel openssl-devel openssl -ywget -c $NGINX_URL/$NGINX_SOFT tar -xzf $NGINX_SOFTcd nginx-1.12.0sed -i -e 's/1.12.0//g' -e 's/nginx\//JWS/g' -e 's/"NGINX"/"JWS"/g' src/core/nginx.huseradd www./configure --user=www --group=www --prefix=$NGINX_DIR --with-http_stub_status_module --with-http_ssl_modulemakemake installfi
#Config Nginx Virtual Hostcd $NGINX_DIR/conf/NUM= grep -c "include vhosts" ${NGINX_CNF} if [ $NUM -eq 0 ];thengrep -vE "#|^$" ${NGINX_CNF} >${NGINX_CNF}.swp\cp ${NGINX_CNF}.swp ${NGINX_CNF}sed -i '$i\include vhosts/*;' ${NGINX_CNF}fi
mkdir -p $NGINX_DIR/conf/vhosts/cat>$NGINX_DIR/conf/vhosts/$NGINX_DOMAIN}EOF#Create Nginx HTML DIRmkdir -p /data/www/$NGINX_DOMAIN/cat>/data/www/$NGINX_DOMAIN/index.htmlps -ef |grep -v grep|grep -v auto|grep -c nginx if [ $NUM1 -eq 0 ];then$NGINX_DIR/sbin/nginxelse$NGINX_DIR/sbin/nginx -t >>/dev/null 2>&1if [ $? -eq 0 ];then$NGINX_DIR/sbin/nginx -s reloadelseecho "Please Check Nginx Service info. Exit."exit 0fifi``

좋은 웹페이지 즐겨찾기