How to install and configure Internet Information Services (IIS) on Windows Server 2012/2012 R2
IIS (Internet Information Server) is one of the most powerful web servers from Microsoft that is used to host your Web application. IIS has it’s own Process Engine to handle the request. So, when a request comes from client to server, IIS takes that request and process it and send response back to clients.
IIS supports HTTP, HTTP/2, HTTPS, FTP, FTPS, SMTP and NNTP.
Now, we’ll see how you can install IIS on a server machine, to host your website for production purposes.
This can be done both with PowerShell or through the GUI, we’ll cover both methods here.
Install IIS Through Graphical User Interface (GUI)
Open the Server Manager and click Add Roles and Features:
Go on until you reach the Server Roles tab:
Select Role-based or feature-based installation and click Next.
Select the appropriate server. The local server is selected by default. Click Next.
Enable Web Server (IIS) and click Next.
Click Add Features:
No additional features are necessary to install the Web Adaptor, so click Next.
On the Web Server Role (IIS) dialog box, click Next.
On the Select role services dialog box, verify that the web server components listed below are enabled. Click Next.
Required IIS components
The IIS components listed below satisfy the minimum requirements to run the Web Adaptor. If other IIS components are enabled, they do not need to be removed.
- Web Server
- Common HTTP Features
- Default Document
- Static Content
- Request Filtering
- Basic Authentication
- Windows Authentication
- Application Development
- .NET Extensibility 4.5
- .NET Extensibility
- ASP.NET 4.5
- ISAPI Extensions
- ISAPI Filters
- Common HTTP Features
- Management Tools
- IIS Management Console
- IIS 6 Management Compatibility
- IIS 6 Metabase Compatibility
- IIS Management Scripts and Tools
- Management Service
Verify that your settings are correct and click Install.
When the installation completes, click Close to exit the wizard.
Install IIS With PowerShell Command Line Interface (CLI)
We can install PowerShell command line interface (CLI) instead of GUI. This method is a lot faster than going through all of the GUI options.
Open PowerShell with administrative privileges and run the Install-WindowsFeature cmdlet as shown below.
Install-WindowsFeature -name Web-Server -IncludeManagementTools
Here we include the management tools so that you can manage IIS on this server, as these are generally installed when using the GUI, making this PowerShell command equivalent with the GUI method below. If you do not plan on managing IIS through this server then you may prefer to not include this option.
Once the installation has succeeded.
Go back to the Server Manager. Select Internet Information Services (IIS) Manager from the Tools menu:
Click Add Website:
Specify at least the site name and path. Click Ok:
Your first site is ready to be accessed.