zoukankan      html  css  js  c++  java
  • 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:webroottest.comWeb"  

    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 est.com  /inheritance:e /grant:R "IIS AppPool est.com":R 

    ICACLS e:webroot est.com*  /inheritance:e /grant:R "IIS AppPool est.com":R 

    ICACLS e:webroot est.comdownload   /grant:M "IIS AppPool est.com":R

    ICACLS e:webroot est.comdownload*   /grant:M "IIS AppPool est.com":R 

    *******************************************************
    set Sitename=test.com
    set SitePath=E:webroot	est.com
    set LogPath=G:logfile
    set defaultDocument='index.aspx'
    set Is32BitApp =False
    set BackPort=99
    set netversion=v4.0
    set Cache=Cache
    %windir%system32inetsrvAppcmd add apppool  /name:%Sitename%  /managedRuntimeVersion:%netversion% /managedPipelineMode:"Integrated" /enable32BitAppOnWin64:False
    %windir%system32inetsrvAppcmd add site /name:"%Sitename%"  /id:100 /bindings:http/*:%BackPort%:,http/*:80:%sitename%  /physicalpath:%SitePath% /logfile.directory:%LogPath%
    %windir%system32inetsrvAppcmd set site /site.name:"%Sitename%" /[path='/'].applicationPool:%Sitename%
    %windir%system32inetsrvAppcmd 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	est.com
    set LogPath=G:logfile
    set defaultDocument='index.aspx'
    set Is32BitApp =False
    set BackPort=99
    set netversion=v4.0
    set Cache=Cache
    %windir%system32inetsrvAppcmd add apppool  /name:%Sitename%  /managedRuntimeVersion:%netversion% /managedPipelineMode:"Integrated" /enable32BitAppOnWin64:False
    %windir%system32inetsrvAppcmd add site /name:"%Sitename%"  /id:100 /bindings:http/*:%BackPort%:,http/*:80:%sitename%  /physicalpath:%SitePath% /logfile.directory:%LogPath%
    %windir%system32inetsrvAppcmd set site /site.name:"%Sitename%" /[path='/'].applicationPool:%Sitename%
    %windir%system32inetsrvAppcmd 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
    

      

  • 相关阅读:
    Docker容器监控(十)--技术流ken
    Docker跨主机通信(九)--技术流ken
    Docker多主机管理(八)--技术流ken
    Docker公共&本地镜像仓库(七)--技术流ken
    Docker镜像构建的两种方式(六)--技术流ken
    Docker网络(五)--技术流ken
    tomcat使用详解(week4_day2)--技术流ken
    haproxy使用演示--技术流ken
    xshell连接虚拟机详解--技术流ken
    grafana使用详解--技术流ken
  • 原文地址:https://www.cnblogs.com/94YY/p/4542711.html
Copyright © 2011-2022 走看看