Hosting ASP.NET web sites on IIS.




Hi all,

In this article i will explain how to host your ASP.NET web site on IIS server.I would  like to mention the difficulties i personally  encountered when hosting ASP.NET website and how to solve those problems.First of all you need to activate  IIS feature on your machine.For that just type "turn windows feature on or off" on search bar.Then you will be redirected to following window.



Before closing make sure all options under Internet Information Services are selected.In my case,i have selected all the options under Internet Information Services.Then type "inetmgr" on your search bar.Click the first suggestion you get(IIS Manager).There is a default web site in IIS manager.You can run that and see whether it is working or not.



If the web site is working it will open in your default browser.



Next step is important.To add your own web site to IIS server please follow the steps mentioned below.


1.Save project folder in following directory.
   C:\inetpub\wwwroot

2. Right click on sites and click add site.





3.Give a site name.
4.Enter the physical path of your web site.
5.Enter your IP address-Under IP address section there is a drop down menu.If you are connected to a local area network,your IP address will be displayed in that list or else you can get the IP address by typing ipconfig in command prompt.Do not change the port number.

6.Give host name you prefer.
   eg:-www.mysite.example.com





Now you might think configuration is finished.Let's run the web site.




Browser gives an error mentioning "server DNS address could not be found".It cannot identify the host name unless it is clearly defined.Therefore you have to do one more thing.Run notepad as administrator and open host file in following folder.

C:\Windows\System32\drivers\etc



Then define your IP address and host name.




Now you can see the web site works.Hope this article will help you.If you have any question please comment below.Thank you.

Ruchira Peiris.

Comments

  1. Thanks Ruchira for exchange your knowledge. Your publication helps to me. thanks.

    ReplyDelete

Post a Comment