How to host a website on local IIS?

Prerequisites

You already have installed IIS on your system.If IIS is not installed then go to

Control Panel -> Programs and features -> Turn on windows features on or off

Steps

  • Add a new MVC Web application.Here I have added it to the path E:\

CreateProject CreateProject

  • Open the IIS by pressing Windows+R and then type inetmgr. Right click on folder Sites and click Add Website

AddWebsite

  • Enter the site name as you want and the host name as per your requirement.Put the IPAddress as 127.0.0.1.Host name is the name by which our local website runs and 127.0.0.1 is the IP address for localhost.

AddWebsite

  • Update the host file by going to C:\Windows\System32\drivers\etc . Open the hosts file in notepad.Run notepad as administrator.

AddWebsite

  • Update the hosts file by adding an entry with the IPAddress and host name.

AddWebsite

  • Open the browser and then run the website.

AddWebsite

Yeahhh!!!Finally you have hosted your website locally 🙂 In the next blog post I will try to connect the locally hosted website with database on sql server and create a logging.