Download - Deploying ASP.net Websites on IIS 7.0
9,623,746 members (34,106 online)
Sign in
home quick answers discussions features community help Search for articles, questions, tips
Articles » Web Development » ASP.NET » General
Article
Browse Code
Stats
Revisions (4)
Alternatives
Comments &Discussions (68)
About Article
This article describes somefeatures and architecture ofIIS 7.0 and deployment ofASP.NET sites on IIS
Type Article
Licence CPOL
First Posted 19 Aug 2008
Views 367,623
Bookmarked 204 times
IIS7 ASP ASP.NET IIS
Ajax
Top News
Introducing the $99 LinuxSupercomputer
Get the Insider News free eachmorning.
Next
Deploying ASP.NET Websites on IIS 7.0By Abhijit Jana, 4 Sep 2008
Introduction1. Introduction to IIS 7.02. Features of IIS 7.03. Basic Architecture of IIS 7.04. How to Deploy ASP.NET Websites on IIS 7.05. How to Create Application Pool6. Assign Application Pool To Your Application7. Configure Web Garden on IIS 7.0
What is Application Pool?
Types of Application PoolIdentity Of Application Pool
How To Create An Application Pool and Assign To a Web ApplicationWhat is Web Garden?How To Create Web Garden?Is it Recommended to use Web Garden ?
8. IIS 6.0 Vs IIS 7.09. Where Do I Get IIS 7.0
10. References11. History
Introduction to IIS 7.0
Microsoft Internet Information Services (IIS) 7.0 in Windows Server 2008 and Windows Vista provides asecure, manageable platform for developing and administrating and hosting Web applications andservices. It has been completely redesigned and Restructured .IIS 7.0 provides features and functionalityfor administrators to effectively manage Web infrastructures; developers to rapidly build Web applicationsand services; and hosters to Web hosting.
Features of IIS 7.0
4.73 (99 votes)
×Sign up for our free weekly Web Developer Newsletter.
articles
Related ArticlesCreating animations withDundas Chart for ASP.NET
Smarter Data Labels withDundas Chart SmartLabels
Understanding Chart Areas withDundas Chart for .NET
Add "Select All" to parameterlists in SQL Reporting
Using screensavers inside theWindows Media Player
Making Sense of GeographicData with Dundas Map andAJAX
Handling connectionnotification between a desktopmachine and Windows CE baseddevices
Create data-driven applicationswith the Hera ApplicationFramework
Towards the self-documentingdatabase: extended properties
Accessibility audit vs.accessibility testing
Digital Signatures and PDFDocuments
Color Scale Filter
WMP Power Hour APP
Merge Landscape and PortraitPDFs using ASP.NET
How to conduct an SMS surveyusing a cell phone connectedSMS gateway and MS Access
Using Barcodes in Documents –Best Practices
How to Retrieve EMC CenteraCluster/Pool Capabilities
"Hey! Is That My Car? How toSharpen a QuickBird SatelliteImage Using DotImage"
Integrate your SharePointenvironment into the openstandards-based WebSpherePortal platform using the VisualStudio IDE
VBScript / Excel 2007 - An easyway to access DBF files
Retrieving and Storing CallHistory
Following are some features of IIS 7.0:
IIS 7.0 provides features and functionality that enable administrators to reliably and effectivelymanage Web infrastructures.IIS 7.0 has a distributed file-based configuration system that enables IIS settings to be stored inweb.config files along with the ASP.NET settings.IIS 7.0 provides a cost-effective, more scalable Web server platform for delivering reliable Webhosting to a broad set of customers.
Major innovations in IIS 7.0:
A modular, extensible core Web serverA unified, distributed file-based configuration systemIntegrated health monitoring and diagnosticsA set of new administration tools with delegation support
For more features and product understanding, check here.
Basic Architecture of IIS 7.0
The following diagram shows the Overall Architecture of IIS 7.0 which contains HTTP.Sys, SvcHost.exe,Application Pool and Worker Process(W3Wp).
The main components of IIS 7.0 are HTTP.Sys, Svchost.Exe, Application Pool , Worker Process(W3WP.exe) and Configuration Store.
HTTP.Sys: It the Kernel mode Protocol stack which listens to the HTTP and HTTPS Request. W3SVC and
WAS are the parts of Svchost.exe. W3SVC is the Listener of Request from kernel mode that is passed bythe HTTP.Sys. W3SVC also interacts with Windows Activation Process which is managed by the
worker process by starting, stopping and recycling the application pool. It was also responsible for HealthMonitor of Application Pool during runtime. Configuration stores all web.config and ASP.NET Settings andother configuration in XML Hierarchy form. W3wp.exe is a long-running process that processes requestsand generates responses.
The following diagram shows you the process flow of IIS 7.0. This is the flow of User Request to IIS andgets the Response from IIS.
User Request Pass from Kernel Level to User Level Via Http.Sys and then passes to svchost, and then
goes to Application Pool.
For more details, please click here.
How to Deploy ASP. Net Websites on IIS 7.0
From now onwards, I will describe one example to deploy your ASP.NET websites on IIS 7.0.
Step 1: From Visual Studio, publish your Web application.
Step 2: Copy the published application folder to "C:\intepub\wwwroot" [default] folder.
Step 3: From RUN - > inetmgr -> OK
The following screen will come. This is the main page for any application. There are three panels.
"TestWeb" is a recently pasted webapplication on your wwwroot folder.
Step 4: We need to convert it to an application, just right click and then Click on "ConvertToApplication"as shown in the following picture:
After converting it to application, its icon will be changed and then you can set the property for your webapplication from the middle pane. You can set IIS Authentication Mode, Default Page Just like IIS 6.0:
You can change Security Settings on Authentication Section. By default Setting will be set from yourweb.config itself. As in my web.config Form Authentication was set that's why, Forms Authentication hasbeen Enabled. If we want to change the status, just double click and update status to Enabled to Disabledor Vice Versa.
Now one most important part is to set the Application Pool for your application.
How to Create Application Pool
A site can contain many applications including that site’s default application, which is called the rootapplication. In addition to belonging to a site, an application belongs to an application pool, which isolatesthe application from applications in other application pools on the server .
Step 1: Right Click on Application Pool and give the name of your pool. Here, I have given "pool" andselect Framework and click on OK:
Step 2: If you are writing some thing on the server [may be writes Error Events Logs], you need tochange the Pool Identity to Local System. Right click on Pool Identity setting as shown in the followingimage:
There are three identities of Application Pool:
Network ServiceLocal ServiceLocal System
Assign Application Pool To Your Application
Now, we need to assign the Application Pool to our web application.
Step 1: Right Click on "TestWeb" Application and Select "Advanced Settings":
Step 2: Finally assign your created Application Pool "pool" to "TestWeb" Application.
Now you can run your application by just typing http:\\localhost\testweb and it can be accessible onnetwork by IP also.
Configure Web Gardens in IIS 7.0
I have split this section into some parts. These are:
What is Application Pool?How To Create An Application Pool and Assign To a Web ApplicationWhat is Web Garden?How To Create Web Garden?Is it Recommended to use Web Garden ?
What is Application Pool ?
Application pools are used to separate set of IIS worker processes that share the same configuration.Application pools enable us to isolate our web application for better security, reliability, and availability.The worker process serves as the process boundary that separates each application pool so that whenone worker process or application is having an issue, other applications or worker processes are notaffected.
Figure: Application Pool With Worker Process On IIS Server
In your IIS, there may be more on Web sites hosted and by creating Application Pool, you can just assigna Separate Worker Process to your application. I have already discussed how you can assign ApplicationPool to your web application.
Types of Application Pools
There are two predefined Application Pools is IIS 7.0:
1. DefaultAppPool (Integrated)
2. ClassicAppPool
None of the Application Pools are Installed by default when IIS 7.0 is installed. Classic Application Pool isinstalled when ASP.NET 2.0 is installed in the System.
Identity Of Application Pool
Application pool identity configuration is an important aspect of security in IIS 7.0, because it determinesthe identity of the worker process when the process is accessing resource. This Settings comes form IIS6.0. in IIS 5.0. There the Application pool runs under the local system account. In IIS 7.0, there are threepredefined Identities that are the same as IIS 6.0
Applicationpool Identity Description
LocalSystemLocalSystem is a built-in account that has
administrative privileges on the server. It
can access both local and remote resources
LocalServicesLocalServices built-in account has privileges
of an authenticated local user account. It does nothave any network access permission.
NetworkServices
This is the default Identity of Application Pool.NetworkServices has privileges of
authenticated local user account and it can haveaccess remote resource as machine account.
How to Create An Application Pool and Assign It to a Web Application?
This has already been discussed.
Creating Application Pool and Assigning it to a Web Application
What is Web Garden?
By default each Application Pool runs with a Single Worker Process (W3Wp.exe). We can assign multipleWorker Processes With a Single Application Pool. An Application Poll with multiple Worker process iscalled "Web Gardens". Many worker processes with the same Application Pool can sometimes providebetter throughput performance and application response time. And each worker process should havetheir own Thread and Own Memory space.
Fig: General Block Diagram of Web Garden.
As given in the picture, in IIS Server there may be multiple Applicationpool and each application pool hasat least a single Worker Process. Web Garden should contain multiple Worker processes.
There are certain restrictions to use Web Garden with your web application. If we use Session Mode to "inproc", our application will not work correctly because session will be handled by different Worker Process.To avoid this type of problem, we should have to use Session Mode "out proc" and we can use "SessionState Server" or "SQL-Server Session State".
Main Advantage: The worker processes in a Web garden shares the requests that arrive for thatparticular application pool. If a worker process fails, another worker process can continue to processrequests.
How to Create Web Garden?
Create a New Application Pool. Right Click -> Advance Setting -> Go To Process Model Section, setthe Value for Maximum Worker Process.
Is It Recommended to use Web Garden?
It not always recommended to use Web Garden to your Application. It effects the performance of yoursites except in very specific cases like some long running synchronous requests or application is veryunstable.
IIS 6.0 Vs IIS 7.0
The main advantages of IIS 7.0 is Modular Design which gives some benefits to IIS 7.0 over IIS 6.0. Thefollowing table shows you some differences of IIS 6.0 and IIS 7.0.
Features IIS 6.0 IIS 7.0
Architecture Monolithic Modular
Setup Most Features Installed Minimum installation based onrole
Extended Features ISAPI Filter and ISAPI Extension Added Module and handler inmanaged or native code
Customize UI Normal Customize for .NET
There are many more differences.
Where Do I Get IIS 7.0
IIS 7.0 will not be available with all Operating Systems. There are some specific OS and specific Versionsfor IIS 7.0.
Operating System With Edition Available
Windows Server 2008 Yes
Windows Vista (Home Basic) No (Default) need to install
Windows Vista (Home Premium) No (Default) need to install
Windows Vista (Business) Yes
Windows Vista (Ultimate) Yes
Reference
Article Top 4 TweetTweet 3
Sign Up to vote Poor Excellent Vote
Search this forum Go
IIS ResourceIIS Learn
History08/20/2008:
Article published
08/28/2008:
Added Section: Web Garden on IIS 7.0Modified some text
License
This article, along with any associated source code and files, is licensed under The Code Project OpenLicense (CPOL)
About the Author
Abhijit JanaSoftware Developer (Senior)
India Member
Follow on Twitter
.NET Consultant | Former Microsoft MVP - ASP.NET | CodeProject MVP, Mentor, Insiders| TechnologyEvangelist | Author | Speaker | Geek | Blogger | Husband Blog : http://abhijitjana.netWeb Site : http://dailydotnettips.comTwitter : @AbhijitJanaMy Kinect Book : Kinect for Windows SDK Programming Guide
Comments and Discussions
You must Sign In to use this message board.
Profile popups Spacing Relaxed Noise Very High Layout Open All Per page 10 Update
First Prev Next
Maddy_1008 9 Jan '13 - 0:17
Nice. would like to read about IIS 7.5...
Sign In · View Thread · Permalink
Member 2127089 10 Dec '12 - 5:00
Great tutorial but you indicated that users should change to Local System to allow them to writeto the folder - "you need to change the Pool Identity to Local System" Please use Local System with caution as it creates a security threat, opening your application tomalicious users who can take over your machine. Instead modify security permissions forNETWORK SERVICE.
Like 11
My vote of 5
Caution/ Recommendation
Sign In · View Thread · Permalink
ANJYR 29 Aug '12 - 6:25
Thanks Sir... I have one major doubt..How to deploy website with database..means in which path i have to keep my database if that willbe in SQL
Sign In · View Thread · Permalink
hariom_soni 18 Aug '12 - 5:11
Dear Sir, I tried to configure iis7 website but i got only error "Not found" Please suggest me to solve error
Sign In · View Thread · Permalink
Suvabrata Roy 19 Jul '12 - 22:55
Will you please elaborate something on AppDomain and Worker Process .... Thanks for The article
Sign In · View Thread · Permalink
Member 9273998 18 Jul '12 - 11:33
Hello I have a problem: web1‐app1 web2‐app2, a UserA enters your PC and supposedly closes the session of the application, a UserB login on the same PC user and UserB can see and it is mixed with the information of UserA. the implementation of Web Garden, I would solve this problem? or how I can fix? Note: Your theme is excellent
Sign In · View Thread · Permalink
Suvabrata Roy 11 Jul '12 - 22:06
Its really helps
Sign In · View Thread · Permalink
Member 8687094 15 May '12 - 16:19
Do not criticise, if you don't have any better idea.
Sign In · View Thread · Permalink
Shahin Khorshidnia 12 May '12 - 20:37
Good
Do not criticise, if you don't have any better idea.
Sign In · View Thread · Permalink
sravani.v 7 May '12 - 19:32
My 5! Nice
My vote of 5
IIS7 configuration error
Nice Article
Session Problem
Nice Artical Thanks...
greta article
My Vote of 5
My vote of 5
Permalink | Advertise | Privacy | Mobile Web03 | 2.6.13022.3 | Last Updated 5 Sep 2008
Article Copyright 2008 by Abhijit JanaEverything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid
Sign In · View Thread · Permalink
Last Visit: 31 Dec '99 - 19:00 Last Update: 31 Jan '13 - 3:11 Refresh 1 2 3 4 5 6 7 Next »
General News Suggestion Question Bug Answer Joke Rant Admin