How To Host A Website In IIS


These words Hosting a website, IIS Server are very common for .NET developers. But for a beginner this post will be quite helpful.

This post will explain how to host a website in the IIS Server.

Behind The Scene

First of all I will be explaining all the things with screen shots, so that it will be better for you to understand all the things and what you need to do exactly for hosting a website in the IIS.

STEP : 1

If your are developing your website through visual studio, then just publish the website to a local folder. If you are developing your site using only HTML , I mean if you have only html pages then no worry, step 1 has nothing to do for you.

STEP : 2

 For Windows 7 users; Just go the start menu and type there "inetmgr", now go to the inetmgr.

screen shot 1

STEP : 3

Now go to the sites as shown in the below screen shot. Right click there and select the add website option there. Now a pop up will open, here enter the site name for your site. In the Physicacal Path box put the folder location of your website ( root folder ).

Leave all the things as usual , give a unique port name other wise it will use the port 80 automatically. Here I was giving it 80.

screen shot 2

Now in the host name enter the same name as the site name, and unchecked the Start website immediately check box. Then click ok button.

STEP : 4

Now you need to set the default page for your website. As shown in the below screen shot 3 click one the Default document tab. Once clicking on that you will be taken to the screen shot 4 attached bellow.

screen shot 3


Here you can see some page names if your default page is among them then move up the page to the top using the move up link at the right side of the page. If you can not see your default page then you can take the help of the add link provided at the right side also.

screen shot 4

STEP : 5                   

Now click on the name of the website you just added from the left navigation bar. Go to the Manage Website section in the right navigation bar, and click on the Start button.

screen shot 5

You are not finished yet, just a little thing to do

STEP : 6                                    

Open note pad; then go to the File link and click open, then paste this location "C:\Windows\System32\drivers\etc" and go there. Then select All files form the drop down.

screen shot 6

screen shot 7

select the host file as shown in the screen shot. And add this at the bottom of the text file       testsite . Save the file.

screen shot 8

Now you are done. just refer the below screen shot and browse your site in the browser.

 Now you have successfully hosted a web site in IIS  server from Windows 7.

Happy Coding...

No comments:

Post a Comment