国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 學院 > 開發設計 > 正文

IIS7:通過腳本來配置ftp站點

2019-11-17 01:49:24
字體:
來源:轉載
供稿:網友

IIS7:通過腳本來配置ftp站點

Appcmd.exe是IIS7提供的一個管理站點的命令行工具,同時支持Ftp和Http的站點,功能還算強大,具體使用方法參考微軟網站。

需求

我這里的例子主要配置一個Ftp站點,并且允許CcUser這個用戶對其目錄具備讀和寫的權限:

image

代碼

@echo offset cc_inbox_dir=c:/CC_Inboxset cc_outbox_dir=c:/CC_Outboxset appcmd_exe=%systemroot%/system32/inetsrv/appcmd.exeset ftp_siet_name=CC_Inbox::create cc inbox folder::rd /S /Q %cc_inbox_dir%IF NOT EXIST %cc_inbox_dir% (md %cc_inbox_dir%)::create cc outbox folder::rd /S /Q %cc_outbox_dir%IF NOT EXIST %cc_outbox_dir% (md %cc_outbox_dir%)::delete the ftp site and then make a new one. ID of the ftp site will be auto-generated.%appcmd_exe% delete site %ftp_siet_name%%appcmd_exe% add site /name:%ftp_siet_name% /bindings:ftp://*:21 /physicalpath:%cc_inbox_dir%::add virtual dir for cc outbox. Note there is "/' at the end of the app.name%appcmd_exe% add vdir /app.name:"%ftp_siet_name%/" /path:/outbox /physicalpath:%cc_outbox_dir%::config ftp authentication%appcmd_exe% set site %ftp_siet_name% -ftpServer.security.ssl.controlChannelPolicy:SslAllow -ftpServer.security.ssl.dataChannelPolicy:SslAllow -ftpServer.security.authentication.basicAuthentication.enabled:true::config ftp authorization to allow CcUser to read and write%appcmd_exe% set config %ftp_siet_name% -section:system.ftpServer/security/authorization /+"[accessType='Allow',users='CcUser',permissions='Read, Write']" /commit:apphost

要點

  • appcmd.exe默認沒有添加到Path里,需要指定完整的路徑。
  • 如果64機器上應該使用64位的版本,32位的版本在Wow64目錄下
  • 如果需要ip Address設置成“All Unassigned”,在bindings的時候使用“*”,而不要使用ip地址或機器名
  • “/app.name”參數的值應該以“/”結尾,比如應該用“CC_Inbox/”而不是“CC_Inbox”
  • Authentication的設置在添加ftp站點的時候沒法設置,但是可以通過修改ftp站點的屬性來完成
  • Authorization(比如文件的訪問權限)不在ftp站點的屬性中,而是system級別的屬性,修改完最后記得提交 “/commit:apphost”

參考資料

  • IIS官方文檔:Getting Started with AppCmd.exe
  • IIS官方文檔:http://www.iis.net/configreference/system.ftpserver/security/authorization
  • 通過修改配置文件(applicationHost.config)的方式創建ftp站點

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 兴海县| 峨眉山市| 开平市| 海门市| 锦州市| 湘阴县| 临夏市| 方正县| 天台县| 台安县| 陇南市| 出国| 武宣县| 黄山市| 遵义县| 广宁县| 望都县| 延寿县| 永济市| 益阳市| 衡水市| 望城县| 恩施市| 榕江县| 红原县| 综艺| 金川县| 宁武县| 阳春市| 绥滨县| 沐川县| 武穴市| 板桥市| 虎林市| 崇礼县| 贵南县| 洪雅县| 南靖县| 贺兰县| 门源| 榕江县|