delete web server(nginx)
#!/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)的更多相关文章
- delete web server(nginx+apache)
#!/bin/bash conf_dir1="/usr/local/nginx/conf/vhost.d" conf_dir2="/usr/local/apache2/c ...
- NGINX Web Server Nginx web server
原文地址:http://nginx.com/resources/admin-guide/web-server/ NGINX Web Server Nginx web server This secti ...
- add web server(nginx+apache)
#!/bin/bash # # Web Server Install Script # Last Updated 2012.09.24 # ##### modify by WanJie 2012.09 ...
- add web server(nginx)
#!/bin/bash # # Web Server Install Script # Last Updated 2012.09.24 # ##### modify by WanJie 2012.09 ...
- Nginx负载均衡:分布式/热备Web Server的搭建
Nginx是一款轻量级的Web server/反向代理server及电子邮件(IMAP/POP3)代理server.并在一个BSD-like 协议下发行.由俄罗斯的程序设计师Igor Sysoev所开 ...
- 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 ...
- virtualbox搭建ubuntu server nginx+mysql+tomcat web服务器1 (未完待续)
virtualbox搭建ubuntu server nginx+mysql+tomcat web服务器1 (未完待续) 第一次接触到 linux,不知道linux的确很强大,然后用virtualbox ...
- 在nginx中配置如何防止直接用ip访问服务器web server及server_name特性讲解
看了很多nginx的配置,好像都忽略了ip直接访问web的问题,不利于SEO优化,所以我们希望可以避免直接用IP访问网站,而是域名访问,具体怎么做呢,看下面. 官方文档中提供的方法: If you d ...
- 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 ...
随机推荐
- JAVA配置文件/反射操作
配置文件 1. 在src目录下新建一个file, 命名为XXX.properties 2.编写配置文件: 3. import java.util.ResourceBundle; 4. 使用如下代码读取 ...
- 配置中文分词器 IK-Analyzer-Solr7
先下载solr7版本的ik分词器,下载地址:http://search.maven.org/#search%7Cga%7C1%7Ccom.github.magese分词器GitHub源码地址:http ...
- linux中创建python的虚拟环境
1,何为虚拟环境 linux是支持多用户的系统,如果某一位用户不想使用公用环境,想指定特殊的python版本安装仅供个人使用的一些包,那么虚拟环境将满足他的要求 2,虚拟环境使用需要virtualen ...
- pythonの递归锁
首先看一个例子,让我们lock = threading.Lock() 时(代码第33行),程序会卡死在这里 #!/usr/bin/env python import threading,time de ...
- C++写文件
头文件 ofstream -- 向文件写内容 实现代码 #include <vector> #include <string> #include <fstream> ...
- MySQL死锁查询【原创】
死锁详情查询 SELECT SUM(trx_rows_locked) AS rows_locked, SUM(trx_rows_modified) AS rows_modified, SUM(trx_ ...
- C++ 三/五法则
当定义一个类时,我们显式地或隐式地指定了此类型的对象在拷贝.赋值和销毁时做什么.一个类通过定义三种特殊的成员函数来控制这些操作:拷贝构造函数.拷贝赋值运算符和析构函数. 拷贝构造函数定义了当用同类型的 ...
- 在eclipse中安装svn插件
1.下载SVN插件 下载地址:https://github.com/subclipse/subclipse 点击"Files" 2.安装 在eclipse 中点击菜单"w ...
- 数据库之删除表数据drop、truncate和delete的用法
数据库中删除表数据的关键字,最常用的可能就是delete了,另外其实还有drop和truncate两个关键字. 老大:drop 命令格式:drop table tb ---tb表示数据表的名字,下 ...
- j2cache笔记
初步理解 eg: https://my.oschina.net/javayou https://my.oschina.net/tinyframework/blog/538363?p=2 https:/ ...