DBMNG数据库管理与应用

才能是来自独创性。独创性是思维、观察、理解和判断的一种独特的方式。
当前位置:首页 > 服务器配置 > IIS&ASP

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


本站文章内容,部分来自于互联网,若侵犯了您的权益,请致邮件chuanghui423#sohu.com(请将#换为@)联系,我们会尽快核实后删除。
Copyright © 2006-2023 DBMNG.COM All Rights Reserved. Powered by DEVSOARTECH            豫ICP备11002312号-2

豫公网安备 41010502002439号