Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Research on automatic deployment of IIS-- Management tool Appcmd

2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Recently in the study of automated deployment of things, linux can be deployed directly using jenkins and ansible, windows is a little less, in the search process found appcmd this tool. Appcmd as a new management command after windows IIS7.0, the function is very powerful, the key is that the modification is directly effective.

The default location of the tool is:% systemroot%\ system32\ inetsrv\, that is, under C:\ Windows\ System32\ inetsrv\. Microsoft does not put it in the internal command table and needs to be in the file directory to run. If you want to run the appcmd command directly, you need to add the path to the path of the system variable under the environment variable.

one。 Create a website

Create a new website called 123. port 81, where id is 2, listens for all ip addresses. Of course, you can set it to ip. The port is followed by the host name or domain name, of course, you can not add it. The colon after the port must be added, otherwise the port will not take effect. Physicalpath is the location of an existing directory.

According to the official instructions, name must be specified, id is arbitrary, no specification will be automatically generated according to the existing delay, and the host name can be arbitrary.

Appcmd add site / name:123 / id:2 / bindings:http/:81:iistest-1.tech.xyauto.com / physicalPath:D:\ site\ 123

The following one is an additional substation to 123.

Appcmd add app / site.name:123 / path:/456 / phtsicalPath:D:\ site\ 123\ 456

If you do not specify the physicalpath parameter, or if you want to add another virtual directory, you can use this command

Appcmd add vdir / app.name: "123amp 456" / path:/vdir1 / physicalPath:D:\ site\ 123\ 567

View the properties of the site and display it as text.

Appcmd list site "123" / text:

After creating a website, a default application pool is associated, and it is best to create a corresponding application pool for easy management.

two。 Create an application pool

Create an application pool named 123 and 456 and associate it

Appcmd add apppool / name:123

Appcmd add apppool / name:456

Appcmd set app "123 /" / applicationpool:123

Appcmd set app "123mobile456" / applicationpool:456 # since 456 is a substation of 123, so add primary station 123s.

Then take a look at the application pool.

three。 Configure site properties

Check the configuration parameters of the website first

Appcmd list site "123" / text:

Modify attribute command:

Appcmd set site "123 /" / traceFailedRequestsLogging.enable:true # other parameters can refer to, to first look at the attributes that belong to several levels, some levels are relatively deep, before the need to add a lot of headers, for example: ftpserver.connections.datachanneltimeout:60 this to add two headers.

four。 Configure Application Pool Properties

1. Check the configuration information of the current default application pool.

Appcmd list apppool "DefaultAppPool" / text:*

Appcmd set apppool "DefaultAppPool" / queueLength:65535 # this modifies the queue length and is essential in iis optimization.

Appcmd set apppool "DefaultAppPool" / cpu.limit:2 # there is an extra cpu. This is because regular configurations can be configured directly, while others need to be added with categories.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report