#!/bin/bash

conf_dir1="/usr/local/nginx/conf/vhost.d"
conf_dir2="/usr/local/apache2/conf/vhost.d"
rewrite_dir="/usr/local/nginx/conf/rewrite.d"
web_dir="/data/www/vhosts"

function dis_info {
        clear
        echo
        echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
        echo "Del Virtual Host"
        echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
        echo
}
if [ $# -eq 0 ];then
	dis_info;
	echo "Pleast input domain:"
	read -p "(Default or Example domain: www.example.com):" domain ;
fi

if [ $# -eq 1 ];then
	domain=$1
fi

if [[ $domain == "" ]];then
        domain="example.com"
else if [[ $domain =~ ^www\.(.*)$ ]];then
        nonwww_domain=${domain#www.}
fi

fi

rm -rf $web_dir/$domain
rm -rf $conf_dir1/$domain.conf
rm -rf $conf_dir2/$domain.conf
rm -rf /data/www/logs/apache_log/access/${domain}_access.log*
rm -rf /data/www/logs/apache_log/error/${domain}_error.log*
rm -rf /data/www/logs/nginx_log/access/${domain}_access.log*
rm -rf /data/www/logs/nginx_log/error/${domain}_error.log*
rm -rf $rewrite_dir/$domain.conf

echo
echo "web site infomations:"
echo "========================================"
echo "domain list:$domain "
echo "----------------------------------------"
echo "website dir:$web_dir/$domain"
echo "----------------------------------------"
echo "nginx_conf file:$conf_dir1/$domain.conf"
echo "----------------------------------------"
echo "apache2_conf file:$conf_dir2/$domain.conf"
echo "----------------------------------------"

echo "Del web site is OK"
echo "========================================"

  

使用方法:

执行脚本,并传入要删除的网站域名作为参数

delete web server(nginx+apache)的更多相关文章

  1. add web server(nginx+apache)

    #!/bin/bash # # Web Server Install Script # Last Updated 2012.09.24 # ##### modify by WanJie 2012.09 ...

  2. delete web server(nginx)

    #!/bin/bash conf_dir1="/usr/local/nginx/conf/vhost.d" #conf_dir2="/usr/local/apache2/ ...

  3. NGINX Web Server Nginx web server

    原文地址:http://nginx.com/resources/admin-guide/web-server/ NGINX Web Server Nginx web server This secti ...

  4. add web server(nginx)

    #!/bin/bash # # Web Server Install Script # Last Updated 2012.09.24 # ##### modify by WanJie 2012.09 ...

  5. Build Web Server with Apache and Passenger

    Follow the instructions at 2.6. Generic installation, upgrade and downgrade method: via tarball of P ...

  6. Nginx负载均衡:分布式/热备Web Server的搭建

    Nginx是一款轻量级的Web server/反向代理server及电子邮件(IMAP/POP3)代理server.并在一个BSD-like 协议下发行.由俄罗斯的程序设计师Igor Sysoev所开 ...

  7. Install the high performance Nginx web server on Ubuntu

    Look out Apache, there's a web server – Nginx (pronounced Engine X) – that means to dismantle you as ...

  8. Web Server 与 App Server

    Web Server 常见的Web Server有Apache Server与Nginx. Apache Http Server是Apache软件基金会下的一个项目,是一款开源的HTTP服务器软件(它 ...

  9. Apache 后台服务器(主要处理php及一些功能请求 如:中文url)   Nginx 前端服务器(利用它占用系统资源少得优势来处理静态页面大量请求)   Lighttpd 图片服务器   总体来说,随着nginx功能得完善将使他成为今后web server得主流。

    Apache 后台服务器(主要处理php及一些功能请求 如:中文url) Nginx 前端服务器(利用它占用系统资源少得优势来处理静态页面大量请求) Lighttpd 图片服务器 总体来说,随着ngi ...

随机推荐

  1. js中 ajax动态新增节点无法触发点击事件

    在写ajax加载数据的时候发现,后面添加进来的demo节点元素,失去了之前的点击事件. 其实最简单的方法就是直接在标签中写onclick="",但是这样写有些场景的是实现不了的,最 ...

  2. 【APIO2016】【UOJ205】【LOJ2568】烟花表演 可合并堆

    题目大意 有一棵树,每条边都有一个边权,现在你要修改边权,使得修改后根到所有叶子的距离相等. 要求所有边权非负. 修改的代价为\(\lvert\)每条边修改前的边权\(-\)修改后的边权\(\rver ...

  3. python学习日记(内置函数)

    目前所有内置函数 http://www.runoob.com/python3/python3-built-in-functions.html *菜鸟教程* 内置函数分类 作用域相关globals(). ...

  4. 【BZOJ5506】[GXOI/GZOI2019]旅行者(最短路)

    [BZOJ5506][GXOI/GZOI2019]旅行者(最短路) 题面 BZOJ 洛谷 题解 正着做一遍\(dij\)求出最短路径以及从谁转移过来的,反过来做一遍,如果两个点不由同一个点转移过来就更 ...

  5. MongoDB介绍与安装

    MongoDB 是一个介于关系数据库和非关系数据库之间的产品,是非关系数据库当中功能最丰富,最像关系数据库的.他支持的数据结构非常松散,是类似 json 的 bson 格式,因此可以存储比较复杂的数据 ...

  6. [hashcat]基于字典和暴力破解尝试找到rar3-hp的压缩包密码

    1.使用rar2john找到md5 2.基于字典 hashcat -a 0 -m 12500 /root/Desktop/md5.txt /usr/share/wordlists/weakpass.t ...

  7. 洛谷 P3327 【[SDOI2015]约数个数和】

    前置芝士 关于这个题,你必须知道一个这样奇奇怪怪的式子啊QAQ \[d(i*j)= \sum_{x|i} \sum_{y|j}[gcd(x,y)=1] \] 留坑,先感性理解:后面那个gcd是为了去重 ...

  8. 看毛片就能AC算法

    KMP && ACA KMP: 吼哇! 反正网上教程满天飞,我就不写了. 发个自己写的模板 /** freopen("in.in", "r", ...

  9. 【HDU4751】Divide Groups

    题目大意:给定 N 个点和一些有向边,求是否能够将这个有向图的点分成两个集合,使得同一个集合内的任意两个点都有双向边联通. 题解:反向思考,对于没有双向边的两个点一定不能在同一个集合中.因此,构建一个 ...

  10. ComboBox下拉列表框

    属性:DropDownStyle(下拉.可编辑等).Items(条目) 事件:SelectedIndexChanged选择项改变触发 Items内容:总经理.副总经理.财务部 DropDownStyl ...