November Happy Hour will be moved to Thursday December 5th.

Running EPiServer Community in a web cluster

Product version:

EPiServer Community 3.2

Document version:

1.0

Document last saved:

09-01-2008

Introduction

This article describes how to set up cache replication and file share access for EPiServer Community deployed in a web cluster environment.

Cache replication system

EPiServer Common contains functionality to clear cached data on all remote nodes in a web cluster when data is cleared locally; this is to make sure that cached data on all nodes is kept synchronized when changes are made. To do this, special UDP datagrams are broadcasted to all nodes.

The settings for the replication system are stored in the episerver.common/sites/site/replication/subscriber element in web.config. This node has the following attributes:

Attribute name Description
siteName

A name that is shared by all web applications running the same site in the cluster. Individual nodes only act upon broadcasts that are sent from nodes sharing the same siteName.

serverName The name of the web server, used to uniquely identify a single node within the cluster.

port and alternatePort

UDP ports that will be used to send and receive requests. The port configuration must be identical for all web applications running the same site in the cluster. Only one of the ports will be used at any time, the reason for having two ports configured is that when the application is recycled it may not be possible to reclaim the same port that was used before the recycle.
broadcastAddress

An address for a locally connected network that all nodes are reachable on.

 

When running multiple EPiServer Community instances on the same server port and alternatePort should, unless set to 0, be different for each instance. If several instances running on the same server are configured with the same ports they will experience startup errors as they will not be able to bind to their assigned ports.

File share for Image Gallery and Document Archive

In addition to setting up cache replication you need to make sure that each application in the cluster stores images and documents in the same directories. These directories can be located anywhere as long as they are accessible by all web servers. Here follows an example of how to set up shared folders:

Set up the file shares

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 which contains three subfolders;

  • ImageOriginals
  • ImageThumbnails
  • Documents

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, please see the instructions 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.

Configure IIS and web.config settings

Create two virtual folders for each web application in the cluster;

  • one named "Thumbnails" that points to "\\FileServer\MyWebSiteFiles\ImageThumbnails"
  • one named "Documents" that points to "\\Fileserver\MyWebSiteFiles\Documents"

Next modify each application's web.config file, you need to configure the image gallery and document archive functions to use the new file share. Both the imageGallery and documentArchive elements are children of the episerver.common/sites/site element.

For the imageGallery element set the following attributes;

  • imageAbsoluteFilePath="\\FileServer\MyWebSiteFiles\ImageOriginals"
  • thumbnailVirtualFilePath="~/Thumbnails"

For the documentArchive node set the following attributes;

  • physicalPath="\\FileServer\MyWebSiteFiles\Documents"
  • virtualPath="~/Documents"