1 添加应用程序进城池

appcmd.exe add apppool  /name:test.com  /managedRuntimeVersion:"v4.0" /managedPipelineMode:"Integrated"

2 添加站点,指定站点名,绑定,物理路径

appcmd.exe add site /name:"test.com"  /id:1 /bindings:http/*:81:  /physicalpath:"E:\webroot\test.com\Web"

3 指定站点的进城池

appcmd.exe set site /site.name:"test.com" /[path='/'].applicationPool:test.com

4 指定站点的默认文档为index.aspx

appcmd.exe set config "test.com/" /section:defaultDocument /+files.[@start,value='index.aspx'] /commit:"test.com"

5 把特定目录的脚本执行权限关闭

appcmd set config "test.com/Download" /section:handlers /accessPolicy:Read

6导出一个机器上的所有应用进程池

%windir%/system32/inetsrv/appcmd list apppool /config /xml > c:/apppools.xml

7 导出1个机器上的所有站点

%windir%/system32/inetsrv/appcmd list site /config /xml > c:/sites.xml

8 导入所有进程池

%windir%/system32/inetsrv/appcmd add apppool /in < c:/apppools.xml

9 导入所有站点

%windir%/system32/inetsrv/appcmd add site /in < c:/sites.xml

以下是批处理脚本

10 给站点文件授权

ICACLS e:\webroot\test.com\  /inheritance:e /grant:R "IIS AppPool\test.com":R

ICACLS e:\webroot\test.com\*  /inheritance:e /grant:R "IIS AppPool\test.com":R

ICACLS e:\webroot\test.com\download   /grant:M "IIS AppPool\test.com":R

ICACLS e:\webroot\test.com\download\*   /grant:M "IIS AppPool\test.com":R

*******************************************************
set Sitename=test.com
set SitePath=E:\webroot\test.com
set LogPath=G:\logfile
set defaultDocument='index.aspx'
set Is32BitApp =False
set BackPort=99
set netversion=v4.0
set Cache=Cache
%windir%\system32\inetsrv\Appcmd add apppool  /name:%Sitename%  /managedRuntimeVersion:%netversion% /managedPipelineMode:"Integrated" /enable32BitAppOnWin64:False
%windir%\system32\inetsrv\Appcmd add site /name:"%Sitename%"  /id:100 /bindings:http/*:%BackPort%:,http/*:80:%sitename%  /physicalpath:%SitePath% /logfile.directory:%LogPath%
%windir%\system32\inetsrv\Appcmd set site /site.name:"%Sitename%" /[path='/'].applicationPool:%Sitename%
%windir%\system32\inetsrv\Appcmd set config "%Sitename%/" /section:defaultDocument /+files.[@start,value=%defaultDocument%] /commit:"%Sitename%"
ICACLS %SitePath% /inheritance:e /grant:R "IIS AppPool\%SiteName%":R
ICACLS %SitePath%\* /inheritance:e /grant:R "IIS AppPool\%SiteName%":R
ICACLS %SitePath%\%Cache% /inheritance:e /grant:R "IIS AppPool\%SiteName%":R
ICACLS %SitePath%\%Cache% /inheritance:e /grant:R "IIS AppPool\%SiteName%":R
*******************************************************
set Sitename=test.com
set SitePath=E:\webroot\test.com
set LogPath=G:\logfile
set defaultDocument='index.aspx'
set Is32BitApp =False
set BackPort=99
set netversion=v4.0
set Cache=Cache
%windir%\system32\inetsrv\Appcmd add apppool /name:%Sitename% /managedRuntimeVersion:%netversion% /managedPipelineMode:"Integrated" /enable32BitAppOnWin64:False
%windir%\system32\inetsrv\Appcmd add site /name:"%Sitename%" /id:100 /bindings:http/*:%BackPort%:,http/*:80:%sitename% /physicalpath:%SitePath% /logfile.directory:%LogPath%
%windir%\system32\inetsrv\Appcmd set site /site.name:"%Sitename%" /[path='/'].applicationPool:%Sitename%
%windir%\system32\inetsrv\Appcmd set config "%Sitename%/" /section:defaultDocument /+files.[@start,value=%defaultDocument%] /commit:"%Sitename%"
ICACLS %SitePath% /inheritance:e /grant:R "IIS AppPool\%SiteName%":R
ICACLS %SitePath%\* /inheritance:e /grant:R "IIS AppPool\%SiteName%":R
ICACLS %SitePath%\%Cache% /inheritance:e /grant:R "IIS AppPool\%SiteName%":R
ICACLS %SitePath%\%Cache% /inheritance:e /grant:R "IIS AppPool\%SiteName%":R

  

IIS7.5 APPCMD 简单用法及示例的更多相关文章

  1. TransactionScope简单用法

    记录TransactionScope简单用法,示例如下: void Test() { using (TransactionScope scope = new TransactionScope()) { ...

  2. (转)轻松掌握shell编程中数组的常见用法及示例

    缘起:在老男孩进行linux培训shell编程教学中,发现不少水平不错的网友及同学对数组仍然很迷糊,下面就给大家分享下数组的用法小例子,希望能给大家一点帮助.其实SHELL的数组很简单,好用.我们学习 ...

  3. Python网络编程之TCP套接字简单用法示例

    Python网络编程之TCP套接字简单用法示例 本文实例讲述了Python网络编程之TCP套接字简单用法.分享给大家供大家参考,具体如下: 上学期学的计算机网络,因为之前还未学习python,而jav ...

  4. IIS7.0 Appcmd 命令详解和定时重启应用池及站点的设置

    IIS7.0 Appcmd 命令详解 废话不说!虽然有配置界面管理器!但是做安装包的时候命令创建是必不可少的!最近使用NSIS制作安装包仔细研究了一下Appcmd的命令,可谓是功能齐全. 上网查了些资 ...

  5. unity Dotween插件的简单介绍及示例代码

    unity里面做插值动画的插件有许多,比较常见的有itween.hotween.dotween.根据大家的反馈和实际体验来说,dotween插件在灵活性.稳定性.易用性上都十分突出.这里简单介绍下它的 ...

  6. WPF之Treeview控件简单用法

    TreeView:表示显示在树结构中分层数据具有项目可展开和折叠的控件 TreeView 的内容是可以包含丰富内容的 TreeViewItem 控件,如 Button 和 Image 控件.TreeV ...

  7. IIS7.0 Appcmd 命令详解

    原文 IIS7.0 Appcmd 命令详解 一:准备工作 APPcmd.exe 位于 C:\Windows\System32\inetsrv 目录 使用 Cd c:\Windows\System32\ ...

  8. JS的简单用法

    JS的简单用法 参考:http://www.w3school.com.cn/js/js_switch.asp JavaScript 是网络的脚本语言 JavaScript 是可插入 HTML 页面的编 ...

  9. Func和Action委托简单用法

    Func和Action类是特殊的类型,它们允许你在不必指定自定义委托类型的情况下,去使用委托.在整个.NET框架中都可以使用它们.例如,在我们考察并行计算时,你也会看到这两个类的示例. 上面一段文字是 ...

随机推荐

  1. 【HDOJ】1107 武林

    简单模拟,题目数据太弱太弱了. /* 1107 */ #include <iostream> #include <cstdio> #include <cstring> ...

  2. 【HDOJ】1314 Numerically Speaking

    学了几天的Java了,终于独立A了一道大数计算.感觉还得练Java啊. import java.util.Scanner; import java.math.BigInteger; import ja ...

  3. (2015年郑州轻工业学院ACM校赛题)I 旋转图像

    矩阵旋转,写一个转 90° 的函数就行了, 注意每次要将 长和宽的值进行交换就行了. #include<stdio.h> #include<iostream> #include ...

  4. Selenium webdriver 高级应用

    对于这一段还蛮有感慨的,只想说,代码还是需要自己去敲的. 1. 改变用户代理 import org.junit.AfterClass; import org.junit.BeforeClass; im ...

  5. JavaScript String 对象实例深入研究

    本文主要介绍并分析JavaScript中String对象的具体用法,以及和String对象相关的方法,方便开发者在JavaScript开发中更好地处理字符串. 1. 介绍 String 对象,对字符串 ...

  6. MVC控制器方法返回类型

    控制器公开控制器操作.操作是控制器上的方法,在浏览器的地址栏中输入特定 URL 时被调用.例如,假设要请求下面的 URL: http://localhost/Product/Index/3 在这种情况 ...

  7. java中Object相关的几个方法

    protected Object clone()创建并返回此对象的一个副本. String     toString()返回该对象的字符串表示. boolean equals(Object obj)指 ...

  8. uploadify在struts2下的使用

    1.首先准备uploadify上传插件包,拷贝到项目目录下 2.注意其中的特殊文件:uploadify-init.js文件,是包含了封装后的特殊函数: /** * uploadify上传插件相关JS ...

  9. linux系统目录介绍

    目录/文件 用途 来源 / /处于Linux文件系统树形结构的最顶端,它是Linux文件系统的入口,所有的目录.文件.设备都在/之下. - /bin 该目录存放着系统最常用的最重要的命令,相当于DOS ...

  10. 转载:c++内存泄露机制

    对于一个c/c++程序猿来说,内存泄漏是一个常见的也是令人头疼的问题.已经有很多技术被研究出来以应对这个问题,比方 Smart Pointer,Garbage Collection等.Smart Po ...