1 of 9 12/27/2012 5:01 PM +83 Recommend this on Google Home Freshers Career Advice Articles Interviews Videos Forums Codes Blogs Jobs Job Support Community Jokes Chat MVPs ASP.NET, WPF, SSIS etc. tutorials Catalog Coding Horror Downloads Quick Links Top Posts Top Authors.NET News Bookmarks Search Subscribe Online : 20020 Welcome, Guest! Register Login Home > Articles > ASP.NET > How to host asp.net application on the web server (IIS) How to host asp.net application on the web server (IIS) 6 vote(s) Rating: 4.67 out of 5 Winners Article posted by SheoNarayan on 3/10/2011 Views: 75450 Category: ASP.NET Level: Beginner Points: 250 Tweet 1 Share 9 Submit Article Search Articles Articles Home Winners & Prizes Announcements Like us on Facebook In this article, I am going to show how to host an asp.net application on IIS 7 (I have shown this example on Windows 7 Home Premium OS), however similar steps can be followed to host the application on the Windows Server 2008 R2 as well. Introduction In general hosting part of the application is not done by developer however in some scenario where the team size is small or we need to host the application on the local server, we developer does all the work. In this article, I am going to show how to host an asp.net application on IIS 7.5 in Windows 7 Home Premium Operating System. Step 1 Open the IIS either from the Start Menu by writing the "inetmgr" command in the search box or at the command window (you must have the administrative priviledge). Top Articles Authors Thu, 27-Dec-2012 Authors All Time Authors 31550 15850 12250 Latest members More... (Statistics delayed by 5 minutes) Ads You can also achieve the same by going to Control Panel and clicking on Administrative Tools > Internet Information Services (IIS) Manager as displayed in the picture below.
2 of 9 12/27/2012 5:01 PM If you are not able to see the Internet Information Service (IIS) Manager, your computer might not have IIS installed. To install the IIS, follow below steps. Installing IIS on Windows 7 Go to Control Panel > Programs > Turn Windows Features on or off as displayed in the picture below. Articles Categories.NET Framework Articles ADO.NET Articles ASP.NET Articles ASP.NET AJAX Articles ASP.NET MVC Articles Azure Articles Best Practices Articles BizTalk Server Articles C# Articles CMS Articles CSS Articles Error and Resolution Articles F# Articles Advertisements Ensure that from the Tree View, the Checkboxes against the Internet Information Services (IIS) is checked, even explore the depth of this root folder and check almost all checkboxes as displayed in the picture below. Checking almost all checkboxes will install more than enough (extra components as well that is not required for web hosting) component to get started and you may not use all the components. However later on you can uncheck to un-install those.
3 of 9 12/27/2012 5:01 PM I have written hundreds of.net How to's solution (ebook + source code + video) series based on real time project problems, click here to get it. Step 2 Once you have opened the Internet Information Service (IIS) Manager, your screen should look like below (displayed the left panel in the below picture). Now, right click the Sites and select Add Web Site... and your screen should look like below
4 of 9 12/27/2012 5:01 PM Enter the Site Name (in my case its SampleWebSite), select the physical folder where you have kept your website files (this may be your Visual Studio solution folder if you are setting it up at your local machine or the unpackaged folder path or the root folder of the website or web application). Now you can click on the OK button. Clicking OK button may give you above alert box, complaining about the port you are going to use as by default port 80 is used for the default website of your IIS so you might want to change it. Click on No button at above alert box and change the port. I have changed the port to 8123 as displayed below and clicked on OK button. Clicking OK should give you a screen something similar to below picture where you will have a SampleWebSite created (notice at the left panel). Step 3
5 of 9 12/27/2012 5:01 PM Now, you may click on the Advance Settings... from the right panel and modify some settings that you want to modify. In general it is not needed and you can keep it default. Step 4 Now, your website is ready to be browsed, you can right click on the website name (SampleWebSite in my case) and go to Manage Web Site > Browse and you should have an Internet Explorer window open displaying the default page of your website or web application. Below is the screenshot of the default page of my SampleWebSite. Step 5 (Optional) Notice: Your website may not work if you have developed your it Visual Studio 2010 as your web.config file may have some tags that is not identified by the IIS. This is becuase creating the website the way we created just now will host your website in its own application pool that will have.net Framework version 2 as target version. So you will need to change to the.net
Framework 4.0 version. Click on Application Pools from the left panel and double click the Application pool for your webiste (generally application pool for your website is your website name so in my case SampleWebSite) and you should see a dialogue box similar to above. Select.NET Framework v4.xxx from the.net Framework version dropdown and click OK. Now follow the Step 4 above again and your should see the default page. Conclusion Hope these 5 steps of hosting an application to the IIS will be helpful. Thanks for reading and keep sharing your knowledge. Pleaase me know your comment or feedback. If you like this article, subscribe to our RSS Feed. You can also subscribe via email to our Interview Questions, Codes and Forums section. Found interesting? Add this to: Tweet 1 Share 9 More Bookmark It Please Sign In to vote for this post. Latest Articles from SheoNarayan How to start your software career? How to read MS Excel file and populate into GridView Customizing asp:chart Label font styles and intervals etc. How to use Rotating, Skew and Multiple background image in CSS3? How to use Opacity, Scale and box shadow and Zooming in CSS 3? About Sheo Narayan Experience: 8 year(s) Home page: http://www.snarayan.com Member since: Tuesday, July 08, 2008 Level: HonoraryPlatinum Status: [Microsoft_MVP] [Administrator] Biography: Microsoft MVP, Author, Writer, Mentor & architecting applications since year 2001. More from SheoNarayan... Connect me on Facebook Twitter LinkedIn Blog Responses Posted by: Prabhakar Posted on: 10 Mar 2011 07:14:06 AM Points: 25 Gud and very use full article... Posted by: Raja Posted on: 10 Mar 2011 07:15:23 PM Points: 25 Thanks, much awaited topic and very well explained. Keep it up Sir. 6 of 9 12/27/2012 5:01 PM
7 of 9 12/27/2012 5:01 PM Posted by: Akiii Posted on: 10 Mar 2011 11:08:46 PM Points: 25 Thank you Sir for the tutorial regarding "how to host asp.net application on the web server IIS", but can you please explain the advance setting panel? There are many things and i want to know it. Thanks and Regards Akiii Posted by: Jthakker Posted on: 11 Mar 2011 01:34:09 AM Points: 25 Thank u sir for providing us with such a nice and useful article. I have a question for my already existing site hosted on iis 7.5 and.net framework version 3.5. I hosted the same site again with the mentioned steps whereby changing framework to 4.0 now.can you please help me know what other steps need to be followed making work such site like changes in web.config and all. I changes the version of sections included in web. config to 4.0 but didn't work. Many Thanks once again, Posted by: SheoNarayan Posted on: 11 Mar 2011 01:49:49 AM Points: 25 Thanks Akiii, The Advance Settings dialogue box has many settings and if you look at it carefully, you will feel that it is self explanatory. Also it gives you description of each settings at the bottom of the dialogue (above the Ok and Cancel buttons). Just few of them that is important to focus normally are 1. Application Pool - you will be able to change the application pool if you want. 2. ID : ID of the website, not important for you, used to log files and trace files 3. Physical Path - Physical root path of your application 4... Logon credentials.. - in case your physical path is at remote locations etc. 5. Start Automatically - if you want to start the the website automatically when IIS starts. 6. Connection Limits - Maximum number of seconds a connection can remain active 7. Max. Bandwidth - To control the bandwidth consumption of your website 8. Max. Concurrent Connections - Maximum number of concurrent connections your website can accepts 9. Enable Protocols - Helps you to setup the protocol used to access your website (useful when you want to host your wcf services on IIS - WAS), for example you can mention "http,net.tcp" in this case your website will be accessible over http as well as net.tcp connection. 10. Rest three are related with tracing of your web site in case of failure. Hope this helps. @Jthakker, What error you are getting? Posted by: Akiii Posted on: 11 Mar 2011 05:33:01 AM Points: 25 Thank you very much Sir for your prompt reply. I have read and understood itl. I have also made a web application and hosted it by the help of your tutorial. It helped me a lot. Looking for more good stuffs. Thanks and Regards Akiii Posted by: Tripati_tutu Posted on: 12 Mar 2011 12:19:20 AM Points: 25 Nice one. Well this is helpful for us. Posted by: Binary0018 Posted on: 03 May 2011 03:43:36 AM Points: 25 Not sure if this off-topic. Since they're inside the same machine, is there a need to secure communication betw web & app server?... Assuming we want to take precautions in the production environment. Thks Posted by: Reddrakon Posted on: 03 May 2011 08:15:45 AM Points: 25 Thank you very much Sir. I have some questions. 1. How can I access to my web site with, for example, www.samplewebsite.com and SampleWebSite.com, and maybe with another name? 2. What is difference between Web site and Web application? Thanks. Posted by: Ps2011 Posted on: 20 May 2011 03:05:21 AM Points: 25 Hello Mr Siba Narayan, I need WCF related videos, can you please help me in this regard. Thanks, Partha S.
8 of 9 12/27/2012 5:01 PM Posted by: Deepu.Oct5 Posted on: 04 Apr 2012 01:15:21 AM Points: 25 I did the same process sir..but, when i select the browse option it is showing an error as follows: HTTP Error 500.19-Internal Server Error Error code: 0x80070005 The requested page cannot be accessed because the related configuration data for the page is invalid. Plz help me to recover this..thank u. Posted by: Abhishek.Chakladar Posted on: 03 Jun 2012 12:20:29 AM Points: 25 Hi Thanks a lot. It worked for me. Posted by: Jayakumarv Posted on: 13 Jul 2012 03:35:42 AM Points: 25 Thanks, it work fine, I want to invoke my site on my remote system, and i typed my system name and host name, but it thrown error (404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.) Regards, Jai Posted by: Jtan Posted on: 04 Aug 2012 04:14:35 AM Points: 25 Hi Sir, I am new to this and is the first time i am going to build my own website. I have now subscribed to a host godaddy. And its a virtual dedicated. Unfortunately i do not have a clue how to get it up and running so people around the world can see my website. It is on a windows server 2008. 1. I think your steps here could work for me. But I see that your site is local host. For a website to be accessed by the world, is it the same steps as u have described above? 2. Would u advise me where (as in which folder) i should copy my website files to? Pls advise and thanks in advance. Posted by: Jtan Posted on: 04 Aug 2012 04:59:33 AM Points: 25 I have tried these steps, still not able to pull up my home page. I am trying to run nopcommerce, which is a.net4 and mvc 3 open source cart. I am not able to follow step 5 as well. in the app pool, my site is not in it. >> Write Response - Respond to this post and get points (Outbound) - Step by Step approach Related Posts More... Latest Articles Image uploading in to Amazon s3 Consuming a REST based JSON service using WinJS in Windows 8 Metro - Day 3 Let us learn about some Win JS Controls in Windows Metro using HTML, CSS and JavaScript - DAY 2 Using Mule Studio to read Data from REST based Web Services and store only the value part in a PostgreSQL database - Step by Step approach Read a REST service that returns a JSON object and store the same into PostgreSQL. Parse JSON keys to insert records into PostgreSQL Database using Mule Studio Speech Recognition in Kinect How to generate edit, delete, update and select buttons automatically? Perform a simple arithmetic operation using Windows Metro using HTML, CSS and JavaScript - Step by Step - DAY 1 Using Mule Studio to read XML Data from File(Inbound) and write it to PostgreSQL To generate Edit, Delete, Update and Select buttons automatically in the GridView, we can follow this approach. Boxing and Unboxing in C#.Net In this article I will explain the concepts of Boxing and UnBoxing. C# provides us with Value types and Reference Types. Value Types are stored on the stack and Reference types are stored on the heap. The conversion of value type to reference type is known as boxing and converting reference type back to the value type is known as unboxing. Creating ASP.Net Menu Control using CSS Creating ASP.Net Menu Control using CSS Reduce ASP.NET Page Output Size Reduce ASP.NET Page Output Size How to get the primary key value of the GridView rows in JavaScript or popup page? To get the primary ke value of the GridView records in JavaScript, we can follow this approach. More...
9 of 9 12/27/2012 5:01 PM About Us Contact Us The Team Advertise Software Development Write for us Testimonials Privacy Policy Terms of Use Link Exchange Members Go Top General Notice: If you find plagiarised (copied) contents on this page, please let us know the original source along with your correct email id (to communicate) for further action. Copyright DotNetFunda.Com. All Rights Reserved. Copying or mimicking the site design and layout is prohibited. Logos, company names used here if any are only for reference purposes and they may be respective owner's right or trademarks. 12/27/2012 1:37:03 AM