search
HomeTopicsIISIntroducing the automatic deployment method of IIS scripts

Introducing the automatic deployment method of IIS scripts

IIS script automated deployment method

  1. Required tools: appcmd.exe This tool No need to install it separately, it is installed together with iis. The directory where this tool is located is "C:\Windows\System32\inetsrv"
    Official Help Document

  2. appcmd.exe Deployment of IIS Website Example: (Copy this code and save it as a bat file Can be executed and used)

Recommended (free): 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. Use tools to automatically generate iis command deployment Script: (Here we only explain the use of the tool, and do not explain in detail what each attribute means. You can check the documentation and research this yourself)
Open the "Configuration Editor"
Introducing the automatic deployment method of IIS scripts
The content of this node is relatively small. There are many, you can choose the nodes you need to configure. Help document
Introducing the automatic deployment method of IIS scripts
This is the generated script. There are multiple language scripts (C#, javaScript, APPCmd, PowerShell). Here I am more familiar with the AppCmd ​​command line, so I choose the command line script. You can also You can choose other language scripts, whichever language script you are familiar with.
Introducing the automatic deployment method of IIS scripts

The above is the detailed content of Introducing the automatic deployment method of IIS scripts. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:CSDN. If there is any infringement, please contact admin@php.cn delete
The Continued Relevance of IIS: Why It PersistsThe Continued Relevance of IIS: Why It PersistsApr 17, 2025 am 12:01 AM

IIS remains relevant in the age of cloud native and containerization because of its versatility, integration with modern technologies, and its advantages in performance optimization and security. 1) IIS supports a variety of development frameworks and modern web functions. 2) It can be seamlessly integrated with technologies such as Azure, Docker and other technologies. 3) IIS improves performance and provides security through various technologies, and is suitable for hosting internal and external websites of the enterprise.

Running PHP on IIS: A Practical TutorialRunning PHP on IIS: A Practical TutorialApr 16, 2025 am 12:10 AM

Running PHP applications on a Windows server is feasible and practical. 1) Install and configure IIS, 2) Integrate PHP through FastCGI, 3) Solve common problems such as MIME type configuration and extended loading, 4) Optimize performance settings using OpCache and FastCGI, 5) Follow PHP best practices such as using namespaces and PSR standards.

The Purpose of IIS: Serving and Managing Web ContentThe Purpose of IIS: Serving and Managing Web ContentApr 15, 2025 am 12:12 AM

IIS is a web server software developed by Microsoft to host and manage websites. 1) IIS can handle static and dynamic content, 2) Provide management tools that seamlessly integrate with Windows, 3) Support HTTP, FTP, SMTP and other protocols, 4) Provide security functions such as SSL/TLS encryption, and 5) Optimize website performance through load balancing, caching, etc.

IIS in Action: Real-World Examples and Use CasesIIS in Action: Real-World Examples and Use CasesApr 14, 2025 am 12:12 AM

IIS's real-world applications include in-business departmental websites, high-traffic e-commerce websites and API gateways. 1) In-business departmental websites utilize the powerful features of IIS and seamless integration with Windows systems, 2) High-traffic e-commerce websites improve user experience by configuring load balancing and using ARR, and 3) IIS manages and protects API access through URL rewriting and reverse proxying.

IIS and PHP: The Steps for Successful IntegrationIIS and PHP: The Steps for Successful IntegrationApr 13, 2025 am 12:07 AM

The integration of IIS and PHP can be achieved through the following steps: 1. Install PHP, 2. Add PHP handler in IIS, 3. Test the configuration. After integration, IIS will pass the PHP file request to the PHP interpreter for execution and return the result to the client to achieve efficient web services.

Using PHP on IIS: A Comprehensive GuideUsing PHP on IIS: A Comprehensive GuideApr 12, 2025 am 12:19 AM

Configuring and running PHP applications on IIS requires the following steps: 1. Install IIS and PHP, make sure IIS is enabled and download the PHP ZIP file. 2. Add a website or application in IIS Manager and configure the handler to map to the PHP executable file. 3. Use simple PHP scripts to test the configuration. 4. Debug by checking log files and error logs. 5. Optimize performance, including using application pools and adjusting php.ini settings.

Beyond the Hype: Assessing the Role of IIS TodayBeyond the Hype: Assessing the Role of IIS TodayApr 11, 2025 pm 12:25 PM

IIS remains important in today's technological environment. 1) IIS is tightly integrated with Windows systems, providing powerful management and security functions. 2) It supports advanced usage from simple website hosting to complex load balancing and SSL management. 3) Through optimization and best practices, IIS still has powerful functions and stability in enterprise and personal applications.

What is IIS used for?What is IIS used for?Apr 09, 2025 am 12:13 AM

IIS is a powerful web server software developed by Microsoft to host and manage websites, applications, and services. The functions of IIS include: 1) Hosting websites and web applications, supporting a variety of programming languages ​​and frameworks; 2) Providing load balancing and high availability to ensure application stability; 3) Built-in multiple security features to protect web applications; 4) Providing performance optimization tools to improve response speed; 5) Providing detailed logging and monitoring functions to help diagnose and solve problems.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
1 months agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
1 months agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver Mac version

Dreamweaver Mac version

Visual web development tools