Recently, Windows Server 7-based deployment is a very practical command tool that enables quick deployment of IIS 7. The following describes some of the most common features of the appcmd.exe command.
1. Appcmd or AppcmdUI
You need to note that there is an appcmdui.exe command in addition to appcmd.exein IIS 7. In fact, these two commands serve the same purpose, but the second is based on the graphic interface. You can choose to use them according to your own habits.
2. quickly create a site
Run the command prompt tool and enter "CD % systemroot % \ system32 \ Inetsrv \ drivers" to enter the path of appcmd.exe. Run the "APPCMD add site/name: Default Web Site" command to add a Web Site named Default Web site.
3. Port/Host Header binding
Generally, the Web site uses port 80. Sometimes we need to bind the Web site to a port based on special needs or security considerations. Run "APPCMD add site/name: Default Web Site/bindings: http/*: 81:, https/*: 443:" On the command line :", you can create a Site named Default Web Site and bind it with the http port 81 and the https (encrypted) port 443.
If you need to add a Host Header based on the existing binding, you need to run the "APPCMD set site/site. name: "Default Web Site"/+ bindings. [protocol = 'http', bindingInformation = '*: 80: website1.com'] ". This command can add a new binding without deleting the original binding.
4. physical path
After the site is created and the port is bound, we also need to specify the physical path of the site. Run "APPCMD add site/name: Default Web Site/bindings:" http/*: 82:, https/*: 444: "under the command :"
/PhysicalPath: c: \ Default Web Site ", you can create a Site named Default Web Site, and bind the http port to 82, https port to 444, and the physical path of the Site to c: \ Default Web Site, which is basically set up.
5. Application Library
To ensure the independence between sites and the security of the whole server, we also need to set the application library for the site. Take the Default Web Site as an example to create an application library. Run "APPCMD set app Default Web Site/-applicationPool: Default Web SiteAppPool" on the command line ", A library named Default Web SiteAppPool is created for the Ctocio site.
6. delete a site
You can delete the Default Web Site by using the appcmd.exe command. Run the "APPCMD delete site Default Web Site" command on the command line to Delete the site. In addition, we need to delete the corresponding application library and continue to run the "APPCMD Delete apppool Default Web Siteapppool" command.
7. view results
You can open the IIS manager, expand to Sites, and refresh the page to view the added web Site Default Web Site and Default Web Site.
In addition to several common applications of IIS, The appcmd.exe command can be used to further set up IIS 7-based Web sites. For specific command parameters, you can enter the command "appcmd/?" under the command line /?" To view.