IIS7.5 APPCMD 简单用法及示例
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 简单用法及示例的更多相关文章
- TransactionScope简单用法
记录TransactionScope简单用法,示例如下: void Test() { using (TransactionScope scope = new TransactionScope()) { ...
- (转)轻松掌握shell编程中数组的常见用法及示例
缘起:在老男孩进行linux培训shell编程教学中,发现不少水平不错的网友及同学对数组仍然很迷糊,下面就给大家分享下数组的用法小例子,希望能给大家一点帮助.其实SHELL的数组很简单,好用.我们学习 ...
- Python网络编程之TCP套接字简单用法示例
Python网络编程之TCP套接字简单用法示例 本文实例讲述了Python网络编程之TCP套接字简单用法.分享给大家供大家参考,具体如下: 上学期学的计算机网络,因为之前还未学习python,而jav ...
- IIS7.0 Appcmd 命令详解和定时重启应用池及站点的设置
IIS7.0 Appcmd 命令详解 废话不说!虽然有配置界面管理器!但是做安装包的时候命令创建是必不可少的!最近使用NSIS制作安装包仔细研究了一下Appcmd的命令,可谓是功能齐全. 上网查了些资 ...
- unity Dotween插件的简单介绍及示例代码
unity里面做插值动画的插件有许多,比较常见的有itween.hotween.dotween.根据大家的反馈和实际体验来说,dotween插件在灵活性.稳定性.易用性上都十分突出.这里简单介绍下它的 ...
- WPF之Treeview控件简单用法
TreeView:表示显示在树结构中分层数据具有项目可展开和折叠的控件 TreeView 的内容是可以包含丰富内容的 TreeViewItem 控件,如 Button 和 Image 控件.TreeV ...
- IIS7.0 Appcmd 命令详解
原文 IIS7.0 Appcmd 命令详解 一:准备工作 APPcmd.exe 位于 C:\Windows\System32\inetsrv 目录 使用 Cd c:\Windows\System32\ ...
- JS的简单用法
JS的简单用法 参考:http://www.w3school.com.cn/js/js_switch.asp JavaScript 是网络的脚本语言 JavaScript 是可插入 HTML 页面的编 ...
- Func和Action委托简单用法
Func和Action类是特殊的类型,它们允许你在不必指定自定义委托类型的情况下,去使用委托.在整个.NET框架中都可以使用它们.例如,在我们考察并行计算时,你也会看到这两个类的示例. 上面一段文字是 ...
随机推荐
- Asteroids(二分图最大匹配模板题)
Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 12323 Accepted: 6716 Description Bess ...
- BZOJ1976: [BeiJing2010组队]能量魔方 Cube
1976: [BeiJing2010组队]能量魔方 Cube Time Limit: 10 Sec Memory Limit: 64 MBSubmit: 832 Solved: 281[Submi ...
- 使用 VMAccess 扩展程序重置 Linux 虚拟机的登录凭据
Ning KuangWSSC WS ARD高级项目经理 您是否曾经因为忘记 Azure VM 密码或 SSH密钥而导致无法访问 VM?VMAccess扩展程序使您可以重置密码.SSH密钥或 SSH ...
- 【细说Java】Java封箱拆箱的一些问题
1.概念 首先简单介绍一下概念性的东西: 所谓封箱:就是把基本类型封装成其所对应的包装类型: 而拆箱则恰好相反,是把包装类型转换成其所对应的基本数据类型. 如基本类型int,封箱后的包装类是Integ ...
- C#之VS2010开发Web Service
一:创建web service vs2010软件默认的framework是4.0版本,所以想创建web服务的时候压根看不到web服务应用程序.网上有人说vs2010的web service 跟wcf合 ...
- 注释PHP和html混合代码
<?php if(false){ ?> any code <?php } ?>
- wxPython学习笔记(二)
如何创建和使用一个应用程序对象? 任何wxPython应用程序都需要一个应用程序对象.这个应用程序对象必须是类wx.App或其定制的子类的一个实例.应用程序对象的主要目的是管理幕后的主事件循环. 父类 ...
- SKPhysicsJointSpring类
继承自 NSObject 符合 NSCoding(SKPhysicsJoint)NSObject(NSObject) 框架 /System/Library/Frameworks/SpriteKit. ...
- Android中Application类用法
Application类 Application和Activity,Service一样是Android框架的一个系统组件,当Android程序启动时系统会创建一个Application对象,用来存储系 ...
- JBoss 系列九十九:Rest WebService jBPM 6 集成演示样例
概述 jBPM 6 提供 Rest API 供第三方应用整合使用 jBPM 6,本文演示假设通过 Rest API: 启动流程 获取流程实例信息 启动 User Task 完毕 User Task j ...