Installing and securing Web Server IIS

This article discuss about the IIS server secure installation.

First, step to secure your IIS web server installation default folder, to change the path from C drive to D drive or any other drive letter.

The Inetpub folder is the default location of your web hosting content, IIS logs and so on. Its good practice to move the Inetpub folder from the default location “C:\> Inetpub” to the different location /partition. The folder “Inetpub” can be move after completed the IIS installation. 

Here is the script called iisinetpubmove.bat to do the same

IIS Installation Steps:-

Go to Server Manager to add the IIS server Role.

Server Manager

Then Click on Roles.

Select Roles

Then click on Add Roles to get the next wizard to select IIS server roles.

Add Roles

This Wizard will show you some information about what you need to verify before continue the installation. So simply click on next button to continue.

Before you begin to install IIS server Roles

Select the roles which you want to install like Web Server IIS and any others.

Select Server Roles

This wizard will give you the Introduction about Web Server IIS.So simply you need to click on next button.

Introduction to Web Server IIS

Role Services wizard will come up to select the IIS services according to your requirement. Here I have selected ASP.Net service for my web server IIS. So simply click on Add Required Role Services.

Select Role Services

This wizard will confirm about the installation of your selection that what you roles and services you have selected. Therefore, you need to click on Install button.

Confirm Installation Selections

After that, Installation result wizard will pop-up, which will show you about the Roles, role services, or features were installed successfully. So simply you need to close this wizard.

Installation Results

You can see IIS server has been installed in your machine C Drive. You can also access IIS server using the following command “inetmgr” or simple go to Administrative tools.

IIS Server default directory path

Now After IIS installation you can move your inetpub folder from C drive to D drive or any other drive letter.This is an important to secure your web server installation directory. Here is the link from where you can download the script/batch file. After download the batch file you need to open command line runas Administrator and then run this batch file like “iisinetpubmove.bat”. Below snapshot shows the same.

Executing the command through command line interface CMD

This wizard shows the command result which we have executed using batch file.

Command Line Interface

After that, you can see that one folder is created called “Inetpub” in your D drive.

After Installation changing the IIS Server default directory from C drive to D drive