Santry Technology Solutions, Content Management, DotNetNuke, SharePoint Consulting
Register | Login
Thursday, November 20, 2008

Sections
  
About Us
  
Partners
Downloads
  
 WWWCoder.com Resource Directory

Use DFS for Storing Your ASP.Net Application
2/10/2004 1:07:26 PM

There is a lot of talk on the Web on how to run applications on a Web farm. In a previous article we talked about how to write code so files can be replicated or copied to several servers in one process. Another option is to use the Distributed File System provided by Windows 2003 Server. DFS provides you with the ability to replicate content across the enterprise. It accounts for bandwidth restrictions for replication as well as localization of requests for your enterprise. This article takes a look at using DFS for storing the source for an ASP.Net application. By using DFS in this way you can configure a DFS share to store your application, thus providing redundancy and even mirroring across geographical locations in the enterprise.

Before we get started with configuring our application to run on a DFS share, you should first familiarize yourself with the basic concepts of DFS. You can find out more information by visiting Microsoft TechNet: "Creating a DFS Root Share" article.

It is sometimes necessary to configure IIS to use a remote share or DFS share to configure a website.  Prior to .NET, this was as simple as configuring IIS to use a share on another computer.  This possibly had negative consequences as malicious code would then have access to network resources.

With the .Net framework, the Common Language Runtime's (CLR) implementation of code access security protects us from potentially malicious code. Code access security is based on the following two concepts, permission set, and code groups. A permission set allows you to define what an application has access to (like shares, registry information). While a code group is what you're providing the permissions for based on certain criteria the code meets. Therefore, in order to use a remote share for an ASP.Net application, the code must be trusted by defining permissions.  This is done by configuring the Microsoft .NET Framework 1.1 (or 1.0) Configuration utility located in Administrative Tools within the Control Panel.

This article will demonstrate how to setup that trust.

1.  On your web server, go to Control Panel --> Administrative Tools --> Microsoft .NET Framework 1.1 Configuration (fig. 1)


Figure 1 - .Net Configuration MMC

2.  Expand Runtime Security Policy\Machine\Code Groups\All_Code,

3.  Right click All_code and select New (fig. 2)...


Figure 2 - Create New Code Group dialog box.

4.  Create a new code group is already selected, enter a name and description for the code group (fig. 3).  Click Next.


Figure 3 - Specifying description properties for new code group.

5. In the drop down box, select URL.  A text box will then appear that informs you to enter the URL with either ftp:// or http://.  This is not necessary as it will add file:// for you.

6. In the text box, enter \\server\share\* It is important to enter the *. (fig. 4) Click Next.


Figure 4 - Identifying the share path for the application.

7. The next page is to assign a permission set to the code group (fig 5).  I used FullTrust, though you could create a new permission set that is specific to your ASP.Net application. The following permissions are available:

  • FullTrust - full access to resources.
  • SkipVerification - initial verification is skipped.
  • Execution - allows for code execution.
  • Nothing - all privileges are denied.
  • LocalIntranet - default rights for a typical configuration for intranet applications.
  • Internet - default rights for a typical Internet application.
  • Everything - full access to all resources without skipping of verification.

I decided that in my environment, it was fine to use FullTrust. In this configuration the ASP.Net worker process must have the appropriate rights in order to access the share. For additional information on account permissions and security refer to the MS knowledge base.   To continue click Next.


Figure 5 - Assigning the permission set for the code group.

8.  You are then told to click Finish to create the new code group.  Click Finish and you are almost done.

 

9.  From a command prompt, enter iisreset and then press enter.

Following these steps, will now allow your web server to run ASP.Net applications, from a remote or DFS share.

By: Jeff Overstreet - LucasLabs.Net contributor and PortalPro.Net co-founder. Jeff has over 7 years of experience in system administration (Novell, UNIX, and Windows), network design and administration, and web application architecture and development. You can view his personal website at http://www.jeffoverstreet.net/  or read his weblog at http://www.lucaslabs.net/blogs/overstreet.


Page Options:
format for printing  Format for Printer
email article  Email Page
add to your favorites   Add to Favorites
How would you rate the quality of this content?
Poor - - Excellent
Comments?
Overall Rating:
Comments Left:
Left on 2/16/2007 8:27:44 AM by Anonymous
Comments:
Left on 4/10/2005 9:23:28 PM by Anonymous
Comments: Comments from the following blog: .Net Matters, located at: http://dotnetmatters.com/archive/0001/01/01/166.aspx
No ratings available.
Left on 4/7/2005 2:31:30 PM by Anonymous
Comments: Comments from the following blog: J. Ferguson, located at: http://ferguson-consulting.biz/archive/0001/01/01/166.aspx
No ratings available.
Left on 4/7/2005 2:27:11 PM by Anonymous
Comments: Comments from the following blog: J. Ferguson, located at: http://ferguson-consulting.biz/archive/2005/04/07/166.aspx
No ratings available.
Left on 6/16/2004 4:19:27 AM by Anonymous
Comments: kiri bood
Left on 6/15/2004 8:42:18 PM by Anonymous
Comments: Comments from the following blog: Patrick Santry's Blog, located at: http://blogs.wwwcoder.com/psantry/archive/0001/01/01/485.aspx
No ratings available.
Left on 3/2/2004 11:26:34 PM by Anonymous
Comments: Comments from the following blog: Jeff Overstreet's Weblog, located at: http://lucaslabs.net/blogs/overstreet/archive/0001/01/01/524.aspx
No ratings available.
Left on 3/2/2004 11:15:37 PM by Anonymous
Comments: Comments from the following blog: Jeff Overstreet's Weblog, located at: http://lucaslabs.net/blogs/overstreet/archive/2004/03/02/524.aspx
No ratings available.
Left on 2/23/2004 12:45:47 AM by Anonymous
Comments: You might consider discussing how to setup a DFS root, and how they work, and so forth.
Left on 2/22/2004 11:24:26 AM by Anonymous
Comments: Comments from the following blog: Jeff Overstreet's Weblog, located at: http://lucaslabs.net/blogs/overstreet/archive/2004/02/22/501.aspx
No ratings available.
Left on 2/10/2004 4:58:46 PM by Anonymous
Comments: Comments from the following blog: Patrick Santry's Blog, located at: http://blogs.wwwcoder.com/psantry/archive/2004/02/10/281.aspx
No ratings available.
Left on 2/10/2004 2:21:55 PM by Anonymous
Comments: Perfect! We've been looking at this for quite a while. So simple but just never thought about it.
  

 Latest Articles
  

 Latest News
  

 

Spotlight
Syndication

 


 


Digg This
 


DotNetNuke Platinum Benefactor

  
 

 Terms Of Use | Privacy Statement
 Copyright 2008 - Santry Technology Solutions, Box 172, Girard, PA 16417, (814) 774-0970