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框架中都可以使用它们.例如,在我们考察并行计算时,你也会看到这两个类的示例. 上面一段文字是 ...
随机推荐
- C++ BigInteger 大整数类模板(转)
#include <deque> #include <vector> #include <iostream> #include <string> #in ...
- 安装loadrunner11 ,出现如下错误如何解决?
出现的问题是: 安装LoadRunner 11时弹窗提示"Micosoft Visual C++ 2005 SP1 可再发行组件包(X86):'命令行选项语法错误.键入命令 / ? 可获得帮 ...
- DateTime用法二
任何项目,难免会碰到DateTime的显示问题,.net框架虽提供丰富多样的显示方法,但我很少使用,因老忘记细节,每次都要纠结到底月份在前还是年份在前:日期分隔符到底是“/”,还是“\”,还是“-”等 ...
- Number Transformation
Description In this problem, you are given a pair of integers A and B. You can transform any integer ...
- HDOJ(HDU) 1859 最小长方形(水题、、)
Problem Description 给定一系列2维平面点的坐标(x, y),其中x和y均为整数,要求用一个最小的长方形框将所有点框在内.长方形框的边分别平行于x和y坐标轴,点落在边上也算是被框在内 ...
- ArcGis : unable to save as template this document is already based on another template
原文:http://forums.esri.com/Thread.asp?c=93&f=989&t=289930 ----------------- I ran into this p ...
- SRM468 - SRM469(1-250pt, 500pt)
SRM 468 DIV1 250pt 题意:给出字典,按照一定要求进行查找. 解法:模拟题,暴力即可. tag:water score: 0.... 这是第一次AC的代码: /* * Author: ...
- MVC中各类文件
sln:解决方案文件,为解决方案资源管理器提供显示管理文件的图形接口所需的信息. .csproj:项目文件,创建应用程序所需的引用.数据连接.文件夹和文件的信息. .aspx:Web 窗体页由两部分组 ...
- 1st day
学习配置环境,听的一脸懵逼,不过还好装好了,哈哈哈... <?php /*写一个函数,该函数可以将给定的任意个数的参数以指定的字符串串接起来成为一个长的字符串.该函数带2个或2个以上参数,其中第 ...
- Java做acm所需要的基础知识之排序问题
Java做acm所需要的基础知识. 以前做acm的题都是用C/C++来写代码的,在学习完Java之后突然感觉Java中的方法比C/C++丰富很多,所以就整理一下平时做题需要用到的Java基础知识. 1 ...