#!/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. JAXB注解的使用详解

    前言: 最近一直在做各种接口的对接,接触最多的数据类型就是JSON和XML数据,还有XML中包含JSON的数据,而在Java中对象和XML之间的转换经常用到JAXB注解,抽空在这里总结一下,首先做一下 ...

  2. codeforces479E

    Riding in a Lift CodeForces - 479E Imagine that you are in a building that has exactly n floors. You ...

  3. Django+Vue打造购物网站(五)

    注册和登陆 drf的认证 http://www.django-rest-framework.org/api-guide/authentication/ settings.py文件的配置 INSTALL ...

  4. [LOJ10121] 与众不同

    题目类型:\(DP\)+\(RMQ\) 传送门:>Here< 题意:给定一个长度为\(N\)的序列,并给出\(M\)次询问.询问区间\([L,R]\)内的最长完美序列.所谓完美序列就是指连 ...

  5. virtualbox虚拟机使用的是桥接网络无法连接外网

    virtualbox虚拟机使用的是桥接网络,获取到的DHCP,无法和外界通信 查看路由表发现有两个默认路由,优先级高的路由指向了,仅主机网络的网关 删除第一个默认路由

  6. 常用js方法整理(个人)

    开头总要有点废话 今天想了下,还是分享下自己平时积累的一些实用性较高的js方法,供大家指点和评价.本想分篇介绍,发现有点画蛇添足.整理了下也没多少拿得出手的方法,自然有一些是网上看到的个人觉得很有实用 ...

  7. phpmyadmin低权限getshell

    账号:‘localhost’@'@” 密码:为空 可获得一个低权限账号 利用方法: Mysql可以把指定的文件写进表 CREATE TABLE `test`.`a` (`a1` TEXT NOT NU ...

  8. qt: 系统默认程序打开文件或者软件;

    Qt提供了QDesktopServices类, 可以利用openUrl函数调用默认程序打开文件: 源码参考: #ifdef Q_OS_WIN32 m_szHelpDoc = QString(" ...

  9. Mysql SQL注入漏洞

    学习网址:http://www.cnblogs.com/rush/archive/2011/12/31/2309203.html https://www.cnblogs.com/sdya/p/4568 ...

  10. C++回顾day03---<输入输出流>

    一:C++输入输出包含下面3个方面 (一)标准I/O 对系统指定的标准设备的输入和输出.即从键盘输入数据,输出到显示器屏幕.这种输入输出称为标准的输入输出. (二)文件I/O 以外存磁盘文件为对象进行 ...