@manhng

Welcome to my blog!

Deploy IIS

October 16, 2018 08:56

Deploy IIS (edit)

https://www.c-sharpcorner.com/search/IIS

https://docs.microsoft.com/en-us/iis/manage/creating-websites/select-a-provisioning-option

1) The IIS Admin Service

NET START IISADMIN
NET STOP IISADMIN

2) World Wide Web Publishing Service

NET START  W3SVC
NET STOP W3SVC

Deployment of a Website on IIS

Application Pools on IIS 6.0

Deploying ASP.NET Websites on IIS 7.0

How To Deploy a Web App in IIS

Recycle Application Pool(s) in IIS 7 Server Using C# Code

Windows XP IIS Manager v1.7

Programmatically Manage IIS

Use C# to manage IIS

Beginner's Guide: Exploring IIS 6.0 With ASP.NET

Windows Service Management

Controlling installed services via ServiceController in WinForms

Using NET STOP and NET START commands to force IIS services to re-read the registry

https://support.microsoft.com/en-ie/help/236166/using-net-stop-and-net-start-commands-to-force-iis-services-to-re-read

Common IIS-related services

Service Name Display Name
Iisadmin IIS Admin Service
Msftpsvc FTP Publishing Service
Nntpsvc Microsoft NNTP Service
Smtpsvc Microsoft SMTP Service
W3svc World Wide Web Publishing Service

(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Kevin Zollman, Microsoft Corporation.

https://tecadmin.net/restart-iis-via-command-line/

3) Add Website

https://blogs.msdn.microsoft.com/rakkimk/2007/06/08/iis7-sample-code-for-addingdeleting-a-website-programmatically-c-example/

You can add a website using Add method that is present in the Sites collection of ServerManager. Below is the code snippet which creates an application Pool, and then creates a site, also enables the FREB and commit the changes to the IIS7 configuration file:

ServerManager serverMgr = new ServerManager();
Site mySite = serverMgr.Sites.Add("MySiteName", "C:\\inetpub\\wwwroot", 8080);
serverMgr.ApplicationPools.Add("MyAppPool");
mySite.ApplicationDefaults.ApplicationPoolName = "MyAppPool";
mySite.TraceFailedRequestsLogging.Enabled = true;
mySite.TraceFailedRequestsLogging.Directory = "C:\\inetpub\\customfolder\\site";
serverMgr.CommitChanges();

Now, let's try to delete the same website created. As you know earlier, in IIS7, you need to give an unique name for each website (which was not the case in IIS 6.0).

Site site = serverMgr.Sites["MySiteName"]; // you can pass the site name or the site ID

serverMgr.Sites.Remove(site);

serverMgr.CommitChanges();

4) Command Lines

https://www.codeproject.com/Articles/545019/ParsedCommandLine

Categories

Recent posts