Try our conversational search powered by Generative AI!

Setting Up File Shares for a Load Balancing Scenario

Product version:

EPiServer CMS 5, EPiServer CMS 6 / 6 R2

Document last saved:

Introduction

This document describes the steps you need to take in order to set up a common file share for a load balanced EPiServer CMS installation.

Set up the file share

Let's assume that we want to host our file share on a machine called FileServer, on this machine we create a new share folder that we call MyWebSiteFiles. Within MyWebSiteFiles you should create one sub folder for each file area you wish to share across the load balancing cluster. For example, a default installation of EPiServer CMS has three upload areas available for editors:

  • Documents
  • Global
  • PageFiles

Next we need to configure access rights for the share so that the web applications in the cluster can read and write to it. There are two different approaches that can be used to accomplish this;

 

Using machine accounts

The easiest way to allow one or several web servers to access a common share on a file server is to use the machine accounts and the NetworkService identity. Any worker process started by an application pool using the NetworkService identity will use the web server's machine account when asked to access a remote server. All you need to do to use this approach is;

  • make sure that the each application pool running your site uses the NetworkService identity
  • give each web server's machine account modify file access to the share

The downside of this approach is that the machine account is not exclusive for your web application; any other applications on the same web server using the NetworkService identity will also have access to the same shares. If you want to have more separation between the web applications on a server you should create unique domain accounts for them, this approach is described in the following section.

 

Using a custom domain account

If you wish to have more detailed control over network access for your web applications you should create a unique domain account for each website to use. Note the differentiation between application and site; several applications running the same site can use the same account, you don't need to create a unique account for each application. The procedure you need to follow is:

  • create a domain account
  • make sure that the each application pool running your site uses the new account as identity
  • give the new account modify file access to the share

How about access rights to the local files and folders on the webservers? Depending on which version of IIS your web servers are running you may have to set this up manually:

In IIS 7 any worker processes started by an application pool will automatically be assigned membership in the IIS_IUSRS group which means that no extra steps are needed to set up local file access.

In IIS 6 you manually have to add the domain account to the local IIS_WPG group.

 

Update configuration settings

Next modify each application's web.config (CMS 5) or episerver.config (CMS 6) file, you need to configure your VPPs to make use of your share. The VPP settings can be found in the /episerver/virtualPath/providers collection. For each VPP you wish to share you need to update the physicalPath attribute to point to a folder on the MyWebSiteFiles share. For example, if you want to share the three default VPPs you need to make the following changes:

  • <add ... virtualPath="~/Documents/" physicalPath="\\FileServer\MyWebSiteFiles\Documents" ... />
  • <add ... virtualPath="~/Global/" physicalPath="\\FileServer\MyWebSiteFiles\Global" ... />
  • <add ... virtualPath="~/PageFiles/" physicalPath="\\FileServer\MyWebSiteFiles\PageFiles" ... />