#!/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)的更多相关文章

  1. delete web server(nginx+apache)

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

  2. NGINX Web Server Nginx web server

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

  3. add web server(nginx+apache)

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

  4. add web server(nginx)

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

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

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

  6. 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 ...

  7. virtualbox搭建ubuntu server nginx+mysql+tomcat web服务器1 (未完待续)

    virtualbox搭建ubuntu server nginx+mysql+tomcat web服务器1 (未完待续) 第一次接触到 linux,不知道linux的确很强大,然后用virtualbox ...

  8. 在nginx中配置如何防止直接用ip访问服务器web server及server_name特性讲解

    看了很多nginx的配置,好像都忽略了ip直接访问web的问题,不利于SEO优化,所以我们希望可以避免直接用IP访问网站,而是域名访问,具体怎么做呢,看下面. 官方文档中提供的方法: If you d ...

  9. Setting up Django and your web server with uWSGI and nginx

    https://uwsgi.readthedocs.io/en/latest/tutorials/Django_and_nginx.html Setting up Django and your we ...

随机推荐

  1. SpringBoot文件上传大小设置(yml中配置)

    #文件大小 MB必须大写 # maxFileSize 是单个文件大小 # maxRequestSize是设置总上传的数据大小 spring: servlet: multipart: enabled: ...

  2. SQLServer常用分页方式

    mysql的分页是基于limit关键字,oracle的分页是基于rownum行号,SQLserver的分页在下面进行研究,是基于SQLServer2012进行的测试. 0.原来的SQL的所有数据 下面 ...

  3. linux 下为qtcreator 添加排版工具

    1. 下载astyle.   http://sourceforge.net/projects/astyle 这里可以下载最新版本, 目前是3.1  下载文件astyle_3.1_linux.tar.g ...

  4. JavaWeb - 目录

    参考:https://www.cnblogs.com/xdp-gacl/tag/JavaWeb%E5%AD%A6%E4%B9%A0%E6%80%BB%E7%BB%93/default.html?pag ...

  5. 如何生成添加前缀的顺序DIV

    今天我们这边的需求是生产类似于 div1 div2 div3 这种的方式. filters: { pre: function (value) { return 'div' + value; } }, ...

  6. 【转】Python3 configparse模块(配置)

    [转]Python3 configparse模块(配置) ConfigParser模块在python中是用来读取配置文件,配置文件的格式跟windows下的ini配置文件相似,可以包含一个或多个节(s ...

  7. python3-元类

    原文出处:http://www.cnblogs.com/linhaifeng/articles/8029564.html exec的使用 #可以把exec命令的执行当成是一个函数的执行,会将执行期间产 ...

  8. MySQL5.7 锁定用户【转】

    使用ALTER USER 语句锁定 mysql>ALTER USER 'demo'@'localhost' ACCOUNT LOCK; Query OK, rows affected (0.00 ...

  9. 博客主Judge已跳槽搬家emmm

    跳槽网站:博客园 顺便带一下:洛谷blog (好久没更了QAQ...) ### 不过csdn上还是会照常更新的,毕竟用着方便

  10. IOT相关协议

    MQTT协议的入门 入门教程; 发布/订阅(Pub/Sub)模式,方便消息在传感器之间传递; 这意味着发布者和订阅者之间并不需要直接建立联系; 消息类型 MQTT拥有14种不同的消息类型: CONNE ...