Binding a Website to Local IIS

Raj.Trivedi
Posted by in ASP.NET category on for Beginner level | Points: 250 | Views : 85072 red flag
Rating: 4.5 out of 5  
 2 vote(s)

Hello Team,

In this article we will see how to bind website to IIS and also how can we convert a Virtual Directory to WebApplication

Introduction


Binding of a ASP.NET website in Local IIS and how to convert a Virtual directory to a Web Application



Objective


  1. Understanding IIS
  2. Understanding Application Pools
  3. Install IIS in Windows 7 or Windows Server 2008
  4. How to bind a website?
  5. Converting a Virtual Directory to Web Application



Using the code


What is IIS ?

IIS is Internet Information Services it was earlier known as Internet Information Server i.e. it is a place where an asp.net application resides.When the user sends a request to an Website it first arrives to IIS and then to the Web Site.

With Windows 7 and Windows Server 2008 you will get IIS 7.5

Here is the Look of IIS 7.5






Application Pools


It can be termed as Worker processor as a computer processor.You can assign same Application Pool to different Application but Web Application should have same Framework.

Different Framework Website should be mapped to different Application Pools.

Here is how Application Pools Looks

 

If you see there are some Application Pools with named as ASP.NET v 4.0 Classic and some with the names of the website and if you look closely then it will show you also the framework they are bounded to i.e 2.0 or 4.0

Now in the following steps we will see how to Install IIS.

For Windows 7 or Windows Server 2008 

To Install IIS 

Go to Start -> Control Panel -> Programs and Features -> Turn Windows Features on or Off on Left top side.

Here how it is you need to check all the things that i have surrounded with rectangle to get full features of IIS








The above all the Folders should be checked and after that you will have to click OK.Please check the following Images.





After this it will start Installing the Features it will take some time and then you will have to restart the Computer.

Once it is restarted and then just type IIS in start search of Windows 7 Start Menu as seen in screen shot






Now in the IIS Manager you can bind web site and also Add Application Pool.



How to bind a Website ?

  • Open IIS Manager = Start -> In search type IIS and you will see IIS Manager as you see in above screen.
  • Now you will see IIS Management Console as seen in first Screen.
  • Now to Add a Webite you will see a Sites folder right click on it and Click Add Website you will get the Dialog box of Add Web site.






Now we will have to add the details of the Website as in the below Screen.




  • In the above screen if you see we have given the name of the Site as Test.
  • Application Pool has taken the name as same of the Website name you can keep this same or assign any other pool by clicking on Select.
  • Since we are binding on Local Host the IP Address is unassigned and port number you can use any number.By default it will have 80.If you have not binded any site on Port 80 then you can use Port 80 but if the port 80 is allotted to any other web app then you can customize the port as you want over we have given as 1030. 
  • The host name should be blank as we are binding on the local host or the name of the domain of your website if it is a Production Server
  • Now Click Ok.
  • Since our Test Website is working on Framework 4.0 we will have to go to Application Pool and change the Framework because by default the App Pool takes v2.0 framework, we will have to change the application pool to verion 4.0 of .NET Framework.
  • To change the Framework we will have to go to Application Pool and change it as in screen below.
  • If we do not change the Application Pool then it will give us target Framework Error.








Now come to the sites folder and right click on the Test Website and Browse it will run in your default Browser


Add a Virtual Directory and convert it to Web App.



  • Open IIS Manager = Start -> In search type IIS and you will see IIS Manager as you see in above screen.
  • Now you will see IIS Management Console as seen in first Screen.
  • Now Expand the Sites folder and in that you will see Default website folder expand the default website folder and then right click the Default website and select Add Virtual Directory.





Now we will have to fill the details for the shown screen.

  • Alias is the name of the Web application that you want to refer.
  • Physical Path :-The place where you will have stored the Website.



Now we see a directory is created named TestApp. Now right click on the TestApp Virtual Directory and select Convert to Web Application.








Now if you see the Folder of TestApp has changed to Web Application the icon has changed.

Now if you want to call the this application from the Browser just type http://localhost/TestApp.

If you are binding this on Local Lan Server than you can just call the IP address and the Appname

Eg :- If your Server is ON LAN and its ip is 192.168.25.12 and other computer is in LAN

Then from another computer you can call the Web App from the other computer the following way


This is how you can call the web app from a Server which is in LAN.




Conclusion

Hope this will be a valuable information


Page copy protected against web site content infringement by Copyscape

About the Author

Raj.Trivedi
Full Name: Raj Trivedi
Member Level:
Member Status: Member,MVP
Member Since: 6/16/2012 2:04:41 AM
Country: India
Regard's Raj.Trivedi "Sharing is Caring" Please mark as answer if your Query is resolved
http://www.dotnetfunda.com/profile/raj.trivedi.aspx
Raj Trivedi i.e. me started my career as Support Professional and then moved on the Software development eventually reached at these skills Software Development | Enthusiastic Blogger | Content Writer | Technical Writer | Problem Solver | Lecturer on Technology Subjects | Runnerup Award Winner on www.dotnetfunda.com and firm believer in Sharing as a way of Caring Yet this much achieved its still a long way to go and there is biggest dream lying to be one of the best entrepreneurs of India in Technology Department. The Dream has just started and i hope it follows. Highlights are mentioned in details in my profile at http://in.linkedin.com/pub/raj-trivedi/30/61/b30/

Login to vote for this post.

Comments or Responses

Posted by: Singarapu_Kranthi on: 4/18/2013 | Points: 25
good one !!!
Posted by: Shanky11 on: 4/26/2013 | Points: 25
but ftp server is no;t coming in my iis node
how can i get that i m using windows 7 home edition
Posted by: Shanky11 on: 4/26/2013 | Points: 25
hi
ftp server option is not coming in iis + node
becauz in windows 7 home edition we don't have this iis feature
that's why i installed iis7.5 but how can i use this install this

Login to post response

Comment using Facebook(Author doesn't get notification)