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.# Configure multi-regional deployment with authentication
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
restrictionLevelin section<telerik>. - Ensure that all Sitefinity CMS instances in each region have the same values for
machineKeyproperty.
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:XML<telerik> <sitefinity> <sitefinityConfig storageMode="Auto" restrictionLevel="ReadOnlyConfigFile" /> </sitefinity> </telerik> ```# Configure multi-regional deployment with authentication
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 havereplication="Master"and the Secondary database to havereplication="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.configfile of all Sitefinity CMS instances that participate in the Primary region should look in the following way:XML<?xml version="1.0" encoding="utf-8"?> <dataConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type" initialized="True"> <connectionStrings> <add connectionString="" dbType="SqlAzure" replication="Master" readOnly="false" name="Sitefinity" /> <add connectionString="" dbType="SqlAzure" name="SessionConnection" /> </connectionStrings> </dataConfig>Secondary region(s): The
DataConfig.configfile of all Sitefinity CMS instances that participate in the Secondary region should look in the following way:XML<?xml version="1.0" encoding="utf-8"?> <dataConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type" config:version="11.1.7000.0" initialized="True"> <connectionStrings> <add connectionString="" dbType="SqlAzure" replication="Slave" readOnly="true" name="Sitefinity" /> <add connectionString="" dbType="SqlAzure" name="SessionConnection" replication="None" /> <add connectionString="" dbType="SqlAzure" name="SitefinityShared" /> </connectionStrings> </dataConfig>
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).
TheLibrariesConfig.configfile of all Sitefinity CMS instances that are part of the Secondary region, should look like this:XML<?xml version="1.0" encoding="utf-8"?> <librariesConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type"> <images allowDynamicResizing="False" storeDynamicResizedImagesAsThumbnails="True" /> <providers> <add connectionString="SitefinityShared" name="OpenAccessDataProvider" config:flags="1" /> </providers> </librariesConfig>
NOTE: If you do not have a
LibrariesConfig.configfile, create one and place it in folder~\App_Data\Sitefinity\Configuration.# Configure multi-regional deployment with authentication
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).
TheSchedulingConfig.configfile of all Sitefinity CMS instances that are part of the Primary and the Secondary region, should look like this:XML<?xml version="1.0" encoding="utf-8"?> <schedulingConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type"> <providerSettings> <add connectionString="SessionConnection" name="OASchedulingProvider" config:flags="1" /> </providerSettings> </schedulingConfig>
NOTE: If you do not have a
SchedulingConfig.configfile, create one and place it in folder~\App_Data\Sitefinity\Configuration.
- 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).
TheStatisticsConfig.configfile of all Sitefinity CMS instances that are part of the Primary and the Secondary region, should look like this:XML<?xml version="1.0" encoding="utf-8"?> <statisticsConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type"> <providers> <add connectionString="SessionConnection" name="OpenAccessDataProvider" config:flags="1" /> </providers> </statisticsConfig>
NOTE: If you do not have a
StatisticsConfig.configfile, 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).
TheUserActivityConfig.configfile of all Sitefinity CMS instances that are part of the Primary and the Secondary region, should look like this:XML<?xml version="1.0" encoding="utf-8"?> <userActivityConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type"> <providers> <add connectionString="SessionConnection" name="OpenAccessUserActivityProvider" config:flags="1" /> </providers> </userActivityConfig>
NOTE: If you do not have a
UserActivityConfig.configfile, create one and place it in folder~\App_Data\Sitefinity\Configuration.# Configure multi-regional deployment with authentication
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).
TheUserProfilesConfig.configfile of all Sitefinity CMS instances that are part of the Secondary region, should look like this:XML<?xml version="1.0" encoding="utf-8"?> <userProfilesConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type"> <providers> <add connectionString="SitefinityShared" name="OpenAccessProfileProvider" config:flags="1" /> </providers> </userProfilesConfig>
NOTE: If you do not have a
UserProfilesConfig.configfile, create one and place it in folder~\App_Data\Sitefinity\Configuration.# Configure multi-regional deployment with authentication
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).
TheMetadataConfig.configfile of all Sitefinity CMS instances that are part of the Primary and the Secondary region, should look like this:XML<?xml version="1.0" encoding="utf-8"?> <metadataConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type" > <providers> <add connectionString="SessionConnection" type="Telerik.Sitefinity.Data.Metadata.OpenAccessMetaDataProvider, Telerik.Sitefinity" name="SessionProvider" /> </providers> </metadataConfig>
NOTE: If you do not have a
MetadataConfig.configfile, 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).
TheOutputCacheConfig.configfile of all Sitefinity CMS instances that are part of the Primary and the Secondary region, should look like this:XML<?xml version="1.0" encoding="utf-8"?> <outputCacheConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type"><providers> <add connectionString="SessionConnection" type="Telerik.Sitefinity.Web.OutputCache.Data.OpenAccessOutputCacheRelationsProvider, Telerik.Sitefinity" name="OpenAccessOutputCacheRelationsProvider" /></providers> </outputCacheConfig>
NOTE: If you do not have a
OutputCacheConfig.configfile, create one and place it in folder~\App_Data\Sitefinity\Configuration.# Configure multi-regional deployment with authentication
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).
TheFormsConfig.configfile of all Sitefinity CMS instances that are part of the Secondary regionshould look like this:XML<?xml version="1.0" encoding="utf-8"?> <formsConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type"> <providers> <add connectionString="SitefinityShared" name="OpenAccessDataProvider" config:flags="1" /> </providers> </formsConfig>
NOTE: If you do not have a
FormsConfig.configfile, 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
redisSettingsnode, change theConnectionStringattribute to the Redis instance connection string
- Locate this setting:
- 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
addnode, change theConnectionStringattribute to the Redis instance connection string
- Locate this setting:
- 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).
TheSystemConfig.configfile of all Sitefinity CMS instances that are part of the Primary and the Secondary region should look like this:XML<?xml version="1.0" encoding="utf-8"?> <systemConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type" disableBackendUI="True" > <loadBalancingConfig> <redisSettings ConnectionString="***************" /> <replicationSyncSettings Enabled="True"> <Transporter> <add ConnectionString="***************" Prefix="sf-replication" TypeName="Telerik.Sitefinity.LoadBalancing.Replication.RedisMessageTransporter" config:flags="1" /> </Transporter> </replicationSyncSettings> </loadBalancingConfig> </systemConfig>
NOTE: If you do not have a
SystemConfig.configfile, 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
Prefixattribute from the replication transport RedisPrefixsetting. Unless you explicitly change it, the default value for load balancing Redis prefix is "sf-".# Configure multi-regional deployment with authentication
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,validationKeyanddecryptionKeyproperties. - Configure membership, role, and security providers in the Secondary region to use
SitefinityShareddatabase connection. Point this connection to the Primary database.
EXAMPLE: Use the following configuration for the
Secondary region(s).
TheSecurityConfig.configfile of all Sitefinity CMS instances that are part of the Secondary region, should look like this:XML<?xml version="1.0" encoding="utf-8"?> <securityConfig xmlns:config="urn:telerik:sitefinity:configuration" xmlns:type="urn:telerik:sitefinity:configuration:type">… <securityProviders> <add connectionString="SitefinityShared" name="Default" config:flags="1" /></securityProviders><roleProviders> <add connectionString="SitefinityShared" name="Default" config:flags="1" /> <add connectionString="SitefinityShared" name="AppRoles" config:flags="1" /></roleProviders><membershipProviders> <add connectionString="SitefinityShared" name="Default" config:flags="1" /></membershipProviders> </securityConfig>
13. Restart the application.
Restart Sitefinity CMS by restarting the IIS application pool.