介紹IIS腳本自動化部署方式
IIS腳本自動化部署方式
所需工具:appcmd.exe 此工具不需要單獨安裝,與iis一起安裝的。此工具所在目錄「C:\Windows\System32\inetsrv」
官方說明文件appcmd.exe部署iis文網站範例:(複製此程式碼儲存為bat檔就能執行使用)
推薦(免費):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、使用工具自動產生iis指令部署腳本:(此處只給講解工具的使用,不詳細講解每一個屬性什麼意思,這個自己去查文檔研究)
打開《配置編輯器》
這個節點內容較多,自己選擇需要配置節點。幫助文件
這就是產生的腳本,有多種語言腳本(C#、javaScript、APPCmd、PowerShell),在這裡我比較熟悉AppCmd命令列,所以我選擇命令列腳本,你也可以選擇其他語言腳本,看你對哪個語言腳本熟悉就選哪一個。
以上是介紹IIS腳本自動化部署方式的詳細內容。更多資訊請關注PHP中文網其他相關文章!

熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

記事本++7.3.1
好用且免費的程式碼編輯器

SublimeText3漢化版
中文版,非常好用

禪工作室 13.0.1
強大的PHP整合開發環境

Dreamweaver CS6
視覺化網頁開發工具

SublimeText3 Mac版
神級程式碼編輯軟體(SublimeText3)

IIS在當今技術環境中仍然重要。 1)IIS與Windows系統緊密集成,提供強大的管理和安全功能。 2)它支持從簡單網站託管到復雜的負載均衡和SSL管理的高級用法。 3)通過優化和最佳實踐,IIS在企業和個人應用中依然具有強大功能和穩定性。

iisisagoodwebserverforthosedledeplyeplycometecosystecosystecsystems,產品定期,安全性和easeofmanagement.ever,itmaybelimitingforthoseseekingflexibilityorPreferringopen-Sourcesolutions。

IIS在現實世界中的應用包括企業內部門戶網站、高流量電商網站和API網關。 1)企業內部門戶網站利用IIS的強大功能和與Windows系統的無縫集成,2)高流量電商網站通過配置負載均衡和使用ARR提升用戶體驗,3)IIS作為API網關通過URL重寫和反向代理管理和保護API訪問。

許多知名公司如微軟、戴爾、惠普、美國銀行和GoDaddy使用IIS。它們選擇IIS是因為其與Windows的無縫集成、高性能和可擴展性、安全性以及易於管理的工具。儘管有學習曲線、成本和跨平台兼容性等挑戰,但通過微軟的文檔、免費試用和跨平台解決方案可以解決。

最佳的網絡服務器託管應滿足特定需求,提供高性能、可靠性和安全性。 1)共享託管適合小型網站,2)VPS和專用服務器提供更多控制和性能,3)雲託管利用雲計算技術,提供可擴展性和高可用性。

IIS是微軟開發的強大Web服務器軟件,用於託管和管理網站、應用程序和服務。 IIS的功能包括:1)託管網站和Web應用,支持多種編程語言和框架;2)提供負載均衡和高可用性,確保應用穩定性;3)內置多種安全特性,保護Web應用;4)提供性能優化工具,提升響應速度;5)提供詳細的日誌和監控功能,幫助診斷和解決問題。

IIS服務器角色是指在Windows服務器上安裝和配置IIS服務,使其能夠執行web服務器的功能。 1)安裝IIS服務器角色使用PowerShell命令:Install-WindowsFeature-nameWeb-Server-IncludeManagementTools。 2)創建新網站使用PowerShell命令:New-WebSite-Name"MyNewSite"-Port80-PhysicalPath"C:\inetpub\wwwroot\MyNewSite

微软的IIS确实提供了免费版本,适用于个人开发者和小型项目,但功能有限。1.免费版本随Windows操作系统捆绑,适用于个人和小型项目。2.付费版本提供高级功能,如负载均衡,适合需要高可靠性和扩展性的项目。3.使用IIS时,合理配置和优化能显著提升性能和可靠性。
