Heim  >  Artikel  >  Themen  >  Einführung in die automatisierte Bereitstellungsmethode von IIS-Skripten

Einführung in die automatisierte Bereitstellungsmethode von IIS-Skripten

coldplay.xixi
coldplay.xixinach vorne
2021-04-26 16:39:383180Durchsuche

Einführung in die automatisierte Bereitstellungsmethode von IIS-Skripten

Automatisierte IIS-Skript-Bereitstellungsmethode

  1. Erforderliche Tools: appcmd.exe Dieses Tool muss nicht separat installiert werden, es wird zusammen mit iis installiert. Das Verzeichnis, in dem sich dieses Tool befindet, ist „C:WindowsSystem32inetsrv“
    Offizielles Hilfedokument

  2. appcmd.exe Beispiel für die Bereitstellung einer IIS-Site: (Kopieren Sie diesen Code und speichern Sie ihn als Bat-Datei, um ihn auszuführen)

Empfohlen (kostenlos): IIS

::跳到iis命令工具所在目录下 
cd C:\Windows\System32\inetsrv
::删除指定web站点
appcmd.exe delete site "Default Web Site"
appcmd.exe delete site "ppsweb"
::删除指定应用程序池
appcmd delete apppool "ppsweb"
appcmd delete apppool "ppswebservice"
appcmd delete apppool "ChartPic"
appcmd delete apppool "PipelinePath"

::添加应用程序池
appcmd add apppool /name:"ppsweb"
::修改应用程序池启动模式
appcmd.exe set APPPOOL "ppsweb" /config /startMode:"AlwaysRunning"  /commit:apphost
::修改应用程序池标示
appcmd.exe set APPPOOL "ppsweb" /processModel.identityType:"SpecificUser" /processModel.userName:"*****" /processModel.password:"*****"  /commit:apphost
::设置固定时间间隔回收应用程序池
appcmd.exe set APPPOOL "ppsweb" /recycling.periodicRestart.time:"00:00:00"  /commit:apphost
::设置指定时间回收应用程序池
appcmd.exe set APPPOOL "ppsweb" /+"recycling.periodicRestart.schedule.[value='00:30:00']" /commit:apphost
::关闭快速故障防护功能
appcmd.exe set APPPOOL "ppsweb" /failure.rapidFailProtection:"False"  /commit:apphost

appcmd add apppool /name:"ppswebservice"
appcmd.exe set APPPOOL "ppswebservice" /config /startMode:"AlwaysRunning"  /commit:apphost
appcmd.exe set APPPOOL "ppswebservice" /processModel.identityType:"SpecificUser" /processModel.userName:"*****" /processModel.password:"*****"  /commit:apphost
appcmd.exe set APPPOOL "ppswebservice" /recycling.periodicRestart.time:"00:00:00"  /commit:apphost
appcmd.exe set APPPOOL "ppswebservice" /+"recycling.periodicRestart.schedule.[value='00:30:00']" /commit:apphost
appcmd.exe set APPPOOL "ppswebservice" /failure.rapidFailProtection:"False"  /commit:apphost
appcmd.exe set APPPOOL "ppswebservice" /enable32BitAppOnWin64:"True"  /commit:apphost

::添加web站点
appcmd.exe set config  -section:system.applicationHost/sites /+"[name='ppsweb',id='2',serverAutoStart='True']" /commit:apphost
::绑定端口访问方式
appcmd.exe set config  -section:system.applicationHost/sites /+"[name='ppsweb',id='2',serverAutoStart='True'].bindings.[protocol='http',bindingInformation='*:80:']" /commit:apphost
::绑定端口访问方式
appcmd.exe set config  -section:system.applicationHost/sites /+"[name='ppsweb',id='2',serverAutoStart='True'].bindings.[protocol='https',bindingInformation='*:443:']" /commit:apphost
::添加web站点默认运行路径和应用程序池
appcmd.exe set config  -section:system.applicationHost/sites /+"[name='ppsweb',id='2',serverAutoStart='True'].[path='/',applicationPool='ppsweb',serviceAutoStartEnabled='True',preloadEnabled='True']" /commit:apphost
::添加web站点的应程序路径
appcmd.exe set config  -section:system.applicationHost/sites /+"[name='ppsweb',id='2',serverAutoStart='True'].[path='/',applicationPool='ppsweb',serviceAutoStartEnabled='True',preloadEnabled='True'].[path='/',physicalPath='C:\inetpub\wwwroot\ppsweb']" /commit:apphost
::添加web子站点方式
appcmd.exe set config  -section:system.applicationHost/sites /+"[name='ppsweb',id='2',serverAutoStart='True'].[path='/WebService',applicationPool='ppswebservice',serviceAutoStartEnabled='True',preloadEnabled='True']" /commit:apphost

appcmd.exe set config  -section:system.applicationHost/sites /+"[name='ppsweb',id='2',serverAutoStart='True'].[path='/WebService',applicationPool='ppswebservice',serviceAutoStartEnabled='True',preloadEnabled='True'].[path='/',physicalPath='C:\inetpub\wwwroot\ppsweb\WebService']" /commit:apphost
::修改web站点单个请求的大小
appcmd.exe set config  -section:system.webServer/asp /limits.maxRequestEntityAllowed:"20000000"  /commit:apphost
::修改web站点允许上传单个文件大小
appcmd.exe set config  -section:system.webServer/serverRuntime /uploadReadAheadSize:"20971520"  /commit:apphost

pause

3. Verwenden Sie das Tool, um das IIS-Befehlsbereitstellungsskript automatisch zu generieren: (Hier erkläre ich nur die Verwendung des Tools und erkläre nicht die Bedeutung der einzelnen Attribute im Detail. Sie können Schauen Sie sich die Dokumentation selbst an)
Öffnen Sie den „Konfigurationseditor“
Einführung in die automatisierte Bereitstellungsmethode von IIS-Skripten
Dieser Knoten hat viel Inhalt, Sie müssen den Knoten konfigurieren, wenn Sie möchten. Hilfedokument
Einführung in die automatisierte Bereitstellungsmethode von IIS-Skripten
Dies ist das generierte Skript. Es gibt mehrere Sprachskripte (C#, JavaScript, APPCmd, PowerShell), daher kann ich das Befehlszeilenskript auswählen Wählen Sie andere Sprachskripte. Wählen Sie das Sprachskript aus, mit dem Sie vertraut sind.
Einführung in die automatisierte Bereitstellungsmethode von IIS-Skripten

Das obige ist der detaillierte Inhalt vonEinführung in die automatisierte Bereitstellungsmethode von IIS-Skripten. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!

Stellungnahme:
Dieser Artikel ist reproduziert unter:csdn.net. Bei Verstößen wenden Sie sich bitte an admin@php.cn löschen