Configure multi-regional deployment with authentication
To configure the delivery of static personalized content in multiple regions, while allowing users to login and submit forms, you need to make several adjustments to some of the configuration files.
1. Modify the Web.config file
Open the web.config file of all Sitefinity CMS instances that are part of the Primary and the Secondary region and make the following configurations:
-
Turn on read-only mode of configurations, by adding
restrictionLevel
in section <telerik>
.
-
Ensure that all Sitefinity CMS instances in each region have the same values for
machineKey
property.
EXAMPLE: Use the following configuration for the Primary region and the Secondary region(s).
The <telerik>
section of all Sitefinity CMS instances that are in the primary and the secondary regions, should look in the following way:
2. Modify the DataConfig.config file
Open the DataConfig.config
file and make the following configurations:
- Define the connection strings to the primary, the secondary, and the session database.
The Primary region must have a connection to the Primary database and the Session database. The Secondary region should have a connection to the Secondary database and the Session database.
- Define the replication type.
You should set the Primary database to have replication="Master"
and the Secondary database to have replication="Slave"
.
- Define the read-only state.
The Primary database must not be read-only, while the Secondary database must be read-only.
- In Secondary region(s) define database connection named
SitefinityShared
. Point this connection to Primary database.
EXAMPLE: Use the following samples for the configuration of both regions:
Primary region: The DataConfig.config
file of all Sitefinity CMS instances that participate in the Primary region should look in the following way:
Secondary region(s): The DataConfig.config
file of all Sitefinity CMS instances that participate in the Secondary region should look in the following way:
NOTE: Take note of the following configurations:
- The
replication="Master"
attribute is mandatory in the database connection string for the Primary region.
- The
replication="Slave"
attribute is mandatory in the database connection string for the Secondary region(s).
- The
replication="None"
attribute in the Session database connection string is not required and could be omitted.
3. Modify the LibrariesConfig.config file
Open the LibrariesConfig
file of the Secondary region and for every Sitefinity CMS instance that is part of the region, make the following configurations:
- Enable dynamic resizing of images.
- Because dynamic resizing of images requires database writes operations, reconfigure the metadata provider in the Secondary region(s) to use the Primary database.
EXAMPLE: Use the following configuration for the Secondary region(s).
The LibrariesConfig.config
file of all Sitefinity CMS instances that are part of the Secondary region, should look like this:
NOTE: If you do not have a LibrariesConfig.config
file, create one and place it in folder ~\App_Data\Sitefinity\Configuration
.
4. Modify the SchedulingConfig.config file
Open the SchedulingConfig
file of the Primary and the Secondary region and for every Sitefinity CMS instance that is part of the respective region, reconfigure the config file to use the respective Session database, which is dedicated per region.
EXAMPLE: Use the following configuration for the Primary region and the Secondary region(s).
The SchedulingConfig.config
file of all Sitefinity CMS instances that are part of the Primary and the Secondary region, should look like this:
NOTE: If you do not have a SchedulingConfig.config
file, create one and place it in folder ~\App_Data\Sitefinity\Configuration
.
5. Modify the StatisticsConfig.config file
Statistics must be stored in the respective Session database. Open the StatisticsConfig.config
file of the Primary and the Secondary region and for every Sitefinity CMS instance that is part of the respective region, reconfigure the config file to use the respective Session database, which is dedicated per region.
EXAMPLE: Use the following configuration for the Primary region and the Secondary region(s).
The StatisticsConfig.config
file of all Sitefinity CMS instances that are part of the Primary and the Secondary region, should look like this:
NOTE: If you do not have a StatisticsConfig.config
file, create one and place it in folder ~\App_Data\Sitefinity\Configuration
.
6. Modify the UserActivityConfig.config file
User activities must be stored in the respective Session database. Open the UserActivityConfig.config
file of the Primary and the Secondary region and for every Sitefinity CMS instance that is part of the respective region, reconfigure the config file to use the respective Session database, which is dedicated per region.
EXAMPLE: Use the following configuration for the Primary region and the Secondary region(s).
The UserActivityConfig.config
file of all Sitefinity CMS instances that are part of the Primary and the Secondary region, should look like this:
NOTE: If you do not have a UserActivityConfig.config
file, create one and place it in folder ~\App_Data\Sitefinity\Configuration
.
7. Modify the UserProfilesConfig.config file
Because user profiles requires database write operations, open the UserProfilesConfig.config
of all Sitefinity CMS instances that are part of the Secondary region(s) and reconfigure the corresponding provider to use the Primary database.
EXAMPLE: Use the following configuration for the Secondary region(s).
The UserProfilesConfig.config
file of all Sitefinity CMS instances that are part of the Secondary region, should look like this:
NOTE: If you do not have a UserProfilesConfig.config
file, create one and place it in folder ~\App_Data\Sitefinity\Configuration
.
8. Modify the MetadataConfig.config file
You should add a metadata provider that uses the respective Session database. Open the MetadataConfig.config
file of the Primary and the Secondary region and for every Sitefinity CMS instance that is part of the respective region, reconfigure the config file to use the respective Session database, which is dedicated per region.
EXAMPLE: Use the following configuration for the Primary region and the Secondary region(s).
The MetadataConfig.config
file of all Sitefinity CMS instances that are part of the Primary and the Secondary region, should look like this:
NOTE: If you do not have a MetadataConfig.config
file, create one and place it in folder ~\App_Data\Sitefinity\Configuration
.
9. Modify the OutputCacheConfig.config file
Output cache feature must use the respective Session database. Open the OutputCacheConfig.config
file of the Primary and the Secondary region and for every Sitefinity CMS instance that is part of the respective region, reconfigure the config file to use the respective Session database, which is dedicated per region.
EXAMPLE: Use the following configuration for the Primary region and the Secondary region(s).
The OutputCacheConfig.config
file of all Sitefinity CMS instances that are part of the Primary and the Secondary region, should look like this:
NOTE: If you do not have a OutputCacheConfig.config
file, create one and place it in folder ~\App_Data\Sitefinity\Configuration
.
10. Modify the FormsConfig.config file
Because form submission requires database write operations, open the FormsConfig.config
of all Sitefinity CMS instances that are part of the Secondary region(s) and reconfigure the corresponding provider to use the Primary database.
EXAMPLE: Use the following configuration for the Secondary region(s).
The FormsConfig.config
file of all Sitefinity CMS instances that are part of the Secondary region should look like this:
NOTE: If you do not have a FormsConfig.config
file, create one and place it in folder ~\App_Data\Sitefinity\Configuration
.
11. Modify the SystemConfig.config file
Open the SystemConfig.config file and make the following configurations:
- To set the Load Balancing Redis instance used for communication among nodes in each region, perform the following:
- Locate this setting: systemConfig » loadBalancingConfig » redisSettings
- In the redisSettings node, change the ConnectionString attribute to the Redis instance connection string
- Enable synchronization across the regions.
- To set the connection string to the replication transport Redis instance used as a communication channel between the regions, perform the following:
- Locate this setting: systemConfig » loadBalancingConfig » replicationSyncSettings » Transporter » add
- In the add node, change the ConnectionString attribute to the Redis instance connection string
- Define a prefix for cache records.
- Enable the backend UI of both regions.
EXAMPLE: Use the following configuration for the Primary region and the Secondary region(s).
The SystemConfig.config
file of all Sitefinity CMS instances that are part of the Primary and the Secondary region should look like this:
NOTE: If you do not have a SystemConfig.config
file, create one and place it in folder ~\App_Data\Sitefinity\Configuration
.
NOTE: Depending on your needs, you may use the same Redis instance or use two Redis instances for load balancing and replication transport.
NOTE: Ensure that the load balancing Redis setting is using a different value for the Prefix attribute from the replication transport Redis Prefix setting. Unless you explicitly change it, the default value for load balancing Redis prefix is "sf-".
12. Modify the SecurityConfig.config file
Open the SecurityConfig.config
file and make the following configurations:
- Ensure that all Sitefinity CMS instances in each region have exactly the same values for
authCookieName
, rolesCookieName
, loggingCookieName
, validationKey
and decryptionKey
properties.
- Configure membership, role, and security providers in the Secondary region to use
SitefinityShared
database connection. Point this connection to the Primary database.
EXAMPLE: Use the following configuration for the Secondary region(s)
.
The SecurityConfig.config
file of all Sitefinity CMS instances that are part of the Secondary region, should look like this:
13. Restart the application.
Restart Sitefinity CMS by restarting the IIS application pool.