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. 7.4.1 Dumping Data in SQL Format with mysqldump

    7.4 Using mysqldump for Backups 使用mysqldump 用于备份: 7.4.1 Dumping Data in SQL Format with mysqldump 7. ...

  2. Ubuntu中Samba的安装配置和使用[图文]

    Samba服务在Ubuntu服务器版本中默认并没有安装. 1. Samba软件包的安装 使用源安装,在终端中输入如下命令: #sudo apt-get install samba#sudo apt-g ...

  3. HDOJ(HDU) 1799 循环多少次?(另类杨辉三角)

    Problem Description 我们知道,在编程中,我们时常需要考虑到时间复杂度,特别是对于循环的部分.例如, 如果代码中出现 for(i=1;i<=n;i++) OP ; 那么做了n次 ...

  4. HDU_1254——推箱子,两次BFS

    这题做的一把鼻涕一把泪,果断考虑不周555 Problem Description 推箱子是一个很经典的游戏.今天我们来玩一个简单版本.在一个M*N的房间里有一个箱子和一个搬运工,搬运工的工作就是把箱 ...

  5. Tomcat内存溢出详解【转载】

    本文转载自 http://elf8848.iteye.com/blog/378805 Java内存溢出详解 一.常见的Java内存溢出有以下三种: 1. java.lang.OutOfMemoryEr ...

  6. Be Sociable, Share!

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

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

  8. 设计模式学习--复合模式(Compound Pattern)

    设计模式学习--复合模式(Compound Pattern) 概述 ——————————————————————————————————————————————————— 2013年8月4日<H ...

  9. ScrollView与ListView合用(正确计算Listview的高度)的问题解决

    最近做项目中用到ScrollView和ListView一起使用的问题,显示的时候ListView不能完全正确的显示,查了好多资料终于成功解决:   首先,ListView不能直接用,要自定义一个,然后 ...

  10. INFORMATION_SCHEMA.COLUMNS 查询表字段语句

    INFORMATION_SCHEMA.COLUMNS 视图以 sysobjects.spt_data type_info.systypes.syscolumns.syscomments.sysconf ...