Академический Документы
Профессиональный Документы
Культура Документы
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
Home Help!
Articles
Quick Answers
Discussions
Zones
Features
The Lounge
See Also
More like this More by this author
During last few days, I was deploying my application and I faced a lot of issues. I found deploying an application properly is as much as important as developing application. If application is not deployed properly, it can be very harmful to you application Here I want to share my learning to you all. For deployment, first we need to understand IIS, it's request processing and then we'll go for deployment of the website and various configuration available in IIS, their key features, advantages and disadvantages etc.. IIS IIS and URL Processing IIS6.0 Process Model Managing a Virtual directory Making a Virtual Directory Virtual Directories Settings Managing a Application Pool Creating Application pools Application pools Configurations Deploying application
IIS
IIS at root level, a Windows Service that is responsible for processing requests received on specific ports. For it, a service called the World Wide Web Publishing Service runs on the system. For deploying an application, we cerate a Virtual directory and the convert it into an application. Actually Virtual Directory is nothing more than a configuration entry in IIS for sharing a physical path for access through Web Server.
1 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
Related Articles
Http 500 Error resolution ScrollBar Control with Different Visual Style using VB.NET 2008 Iterating through menustrip items Mocking the generic repository LINQ on the command-line Stored Procedure Data Gateway User Feedback For Long Running Tasks in ASP.NET 8-Puzzle solving using the A* algorithm using Python and PyGame Authoring Documentation with DocProject and Sandcastle ASP.NET automatic Object to UI Binding Logging information in Oracle Using DataPlotter implementing three kinds of Scan-converting Line Segments algorithm Dynamically Pointing to Shared Data Sources on SQL Reporting Services using a Report Definition Customization Extension (RDCE) Design the WCF service without implementing interface Merge DataGrid Header Wcf.js: Call WCF web services from Node.js Simple C Hashtable NodeJS REST server trials to validate effective scripting How To Lock Device Screen For Windows Mobile A new version of my 3D asteroid game in OpenGL with C# Creating animations with Dundas Chart for ASP.NET
The complete configuration (with all its settings) is stored in a file, called a metabase, on local system. IIS metabase is a XML -based data store in IIS6.x and it can be configured through IIS management console.
2 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
All the reliability and security options are configured at the applications pool level.Therefore,when running ASP.NET on IIS6.0,the classic ASP.NET process model with the configuration of the <processModel> element in the machine.config is desabled ,cause all the options introduced for the <processModel> are configured for IIS6.0 worker process.
WAS monitors each workers process and if one fails it restarts it so that it application doesn't go down abruptly.
We can define separate identity for each worker process ie it allows to configure additional isolation through permissions of the account that's configured for the worker process and these are configured through application pools in IIS management console i e every application pool has itself own worker process and every Virtual Directory can be be assigned to these application pools as I discuss in the last section.Each application pool can run as many application as needed. Application pools allows us to easily configure different web applications to run under different account with different resource usage limits and provide more web application isolation
3 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
all settings. When IIS is installed a directory named "c:/Inetpub /wwwroot" is created automatically.Any files in this directory will appear as they're in the root of the web server.using the wwwroot directory fro creating a virtual directory makes a very poor organisation so try to avoid it.That's why I coosen the second option as below
4 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
5 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
Read: It is most basic and is mandatory to access the webpage of your application. Run Scripts: It is required for the aspx pages not for the static HTML pages because aspx pages need more permissions sp that they could conceivably perform operations. Execute: This allows the user to run an ordinary executable file or CGI application. This can be a security risk so allow when it is really needed. Write: It allows to add, modify or remove files from the web server. This should never be allowed. Browse: This allows one to retrieve a full list of files in the virtual directory even if the contents of the file are restricted.It is generally disabled. 5. Right Click on the Virtual Directory and go to properties and clock on create to set it as application
6 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
7 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
S No 1
Description These are ASP.NET WebPages These are ASP.NET user controls. It can't be accessed directly, to access it it must be hosted on ASP.net pages. These are ASP.NET web services, which is used for exposing functionality to other applications over HTTP. These are for Glo9bal application file which is used for global events like when user starts the application. These are HTTPHandlers,which allow to process requests without using the full-fledged ASP.NET web-page model. These are used for the trace.axd application extension, which
.ascx
.asmx
.asax
.ashx
.axd
8 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
allows to trace messages while debugging These extn identify that IIS is hosting an object that can be called by .NET Remoting
These files are used by ASP.NET, but that can't be directly called by clientsAlthow,ASP.NET .cs,.csproj,.licx,.config,.resx,.webinfo registers them so that it can explicitly prevent users from accessing these files, regardless of the IIS security settings.
Normally, if we have multiple versions of ASP.NET installed at one point of time, one may want to configure the mappings deffrently in different directories. Documents: This tab allows one to specify the default documents for a Virtual Directory. Like if user just type "http://MyServer/MyApplication" then IIS simply redirect to the user to that default page. If none page is found, IIS will return the HTTP 404 (page not found error). To see and set the default page, in the properties of the Virtual Directories, Click on the documents tab
9 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
displayed for specific type of HTTP errors (see below picture) .One can use ASP.NET configuration to replace HTTP errors or application errors with custom messages. This only work if the web request makes it to ASP.NET service.
10 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
separate pools .Might be on a server, there are multiple sites hosted for saparate parties then it doesn't allow to access the resources of another pools. Note: Recycling an application pool (worker process) means stoppinng the old worker proceses which have already take lots of resources and start new instance of it for the application pool. To create the application pool follow the below steps ( Please keep in mind that IIS should be installed on the machine) 1. Go to run -> type inetmgr then click ok. You will get the following window.
2.
3.
11 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
Here you have two options First, if you want to use default settings (use it when you want to create it with new settings) Second, If you want to have a new pool with just same settings as some another pool then you can can select this one and change the template pool from the dropdown (It'll save your time from doing the same settings again) 4. You can configure the application pool by right click on the pool created and select properties
5. You can configure the identity of every application pool by selecting Identity tab from the property window of application pool as above window
12 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
Here in the dropdown ,one has three options: Network Service: This account is restricted account with least privileges in the three.This is mainly used for applications that require access to network and need to be accessed from other machines in the network. Local Service: This account is having more restricted than Network service and mainly to be used for services that don,t require additional network access. Local system: Generally this account is not recommended to use, because it is most powerful account of the system. It can perform any action on the local system. so the basic motto , one should provide that much of privilege that the application needed so it can't be hacked easily. you can also configure it as selecting your own user account by specifying the the Windows user name and password for this account.
13 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
Deploying Application:
Deploying is nothing more than copying the published code of the application to target machine and configure the environment as needed. this is true for simple application but for application using database or access other resources, one need to perform additional steps. 1. Copy required file to target machine: Check whether all assemblies are in place. If not use install it using gacutil.exe. 2. Create and configure the Database 3. Add IIS file mappings as per requirement 4. Update web.config for any application settings or connection strings etc. 5. Rest settings can be done as per requirement as we discussed above like application pool etc. Hope you all like this article. Please do post your comments it'll help me a lot to improve this article as well as my upcoming articles.
License
This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)
14 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
currently serving a MNC as a Sr. developer. He is a very passionate .NET developer and have expertise over Web technologies like ASP.NET 2.0/3.5/4.0, jQuery, JSON, Javascript, IIS and related technologies. He is also a Exchange Server (EWS) Specialist. He has Software Developer (Senior) great experience in design patterns and N-Tier Architecture. India
Member Follow on Twitter
He is also certified as Microsoft Certified Technologies Specialist-ASP.NET and Microsoft Certified Technologies Specialist4.0. He has also received several awards at various forums and his various articles got listed as "Article of the day" at ASP.NET Microsoft Official Website www.asp.net. He has done MCA from NIT Durgapur and completed his graduation from Lucknow University. Learning new technologies and sharing knowledge excites him most. Blogging, solving problems at various forums, helping people, keeps him busy entire day.
Visit his Blog: Brij's arena of .NET Area of Expertise : C#, ASP.NET 2.0,3.5,4.0, AJAX, JQuery, JSON, XML, XSLT, ADO.Net, WCF, Active Directory, Exchange Server 2007 (EWS), Java script, Web Services ,Win services, DotnetNuke, WSS 3.0,Sharepoint Designer, SQL Server 2000/2005/2008 Article Top
Rate this: Poor Excellent Vote
Go
Normal
Layout
Per page
25
Update Refresh Site Problem My vote of 4 Re: My vote of 4 Member 8544094 viji@sampathraj Brij First Prev Next 23:26 6 May '12 1:26 21 Mar '12 9:02 13 Apr '12
15 of 16
05-06-2012 22:22
http://www.codeproject.com/Articles/32210/Deployment-of-a-Website...
How to change default port My vote of 3 HTTP 403: This website requires you to log in Automatic Deploy? Re: Automatic Deploy? Missing word? Re: Missing word? My vote of 2 Re: My vote of 2 Re: My vote of 2 [modified] Fantastic Work Brij Re: Fantastic Work Brij Very Good Job Re: Very Good Job Last Visit: 1:48 5 Jun '12 General Rant News Admin
Gopal Hatekar Monjurul Habib Member 4253016 pl.2 Brij paulo.nascimento Brij Tom Lennon Brij Abhijit Jana Abhijit Jana Brij bbm2k3 Brij
7:39 19 Sep '11 10:57 11 Feb '11 11:49 28 Oct '10 7:41 12 Jan '09 19:52 12 Jan '09 14:17 8 Jan '09 18:54 8 Jan '09 23:51 5 Jan '09 2:02 6 Jan '09 2:20 6 Jan '09 20:23 4 Jan '09 20:31 4 Jan '09 2:15 4 Jan '09 7:20 5 Jan '09 1 Bug Answer Joke
Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.
Permalink | Advertise | Privacy | Mobile Article Copyright 2009 by Brij Web02 | 2.5.120604.1 | Last Updated 3 Jan 2009 Everything else Copyright CodeProject, 1999-2012 Layout: Terms of Use fixed | fluid
16 of 16
05-06-2012 22:22