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框架中都可以使用它们.例如,在我们考察并行计算时,你也会看到这两个类的示例. 上面一段文字是 ...
随机推荐
- Linux&shell之结构化命令进阶
写在前面:案例.常用.归类.解释说明.(By Jim) for命令重复一系列的命令是一种常见的编程实践. #!/bin/bash # basic for command for test in A B ...
- -_-#【Angular】依赖注入
AngularJS学习笔记 var BoxCtrl = function($scope, $element) { } var str = BoxCtrl.toString().replace(/\s/ ...
- Linux环境下使用图形化界面的SVN客户端软件-RabbitVCS
如果想在Linux环境下使用图形化界面的SVN客户端软件,那么RabbitVCS绝对是首选,可以媲美Windows环境下用的TortoiseSVN,甚至连操作都基本一样,所以强烈推荐给各位童鞋. Ra ...
- 红米note不好用
手感不错 拍摄效果暗,没有调好 有死机现象
- 网络智能和大数据公开课Homework3 Map-Reduce编程
Web Intelligence and Big Data by Dr. Gautam Shroff 这门课是关于大数据处理,本周是第一次编程作业,要求使用Map-Reduce对文本数据进行统计.使用 ...
- Android Monkey具体解释
Monkey是一个执行在Android设备或者虚拟机上的程序,它能随机模拟一系列用户的操作.点击,滑动,能够用它来做压力測试. 在Monkey执行的过程中,它会产生并发送一系列的事件给系统,而且监听系 ...
- 树莓派学习笔记——交叉编译练习之SQLite3安装
0.前言 本博文可能并没有太多使用价值.不过为了练习而练习.在树莓派上使用SQLite有非常多的方法,安装的方法也有非常多. [1]假设使用Python,那么不必安装SQLite由于P ...
- Robotium--通过Id寻找控件
在自动化测试中,UI上经常有一些控件是没有名称的,那么此时,就可以通过id来找到这些控件. 案例:对两个EditText进行测试 package com.tangbc.tedit.test; impo ...
- 怎样将关系型数据表转换至hbase数据表
首先须要把关系型数据库的数据表的数据添加由 "纵向延伸",转变为HBase数据表的"横向延伸" 一.Hbase的存储结构 a) HBase以表(HTa ...
- 更加详细的Log4net的配置
请转到周金桥的文章 http://blog.csdn.net/zhoufoxcn/article/details/6029021