Friday, November 23, 2018

Layered Configuration in Sitecore 9

Hi All ,Welcome back. In this post we will see about layered configuration in sitecore 9.

Let's Move

Sitecore Divides Configuration files into Layers. Each Layer Consists of Dedicated folder under 
the website/App_Config/Folder.

There are four layers
  1. Sitecore
  2. Modules
  3. Custom
  4. Environment
Sitecore Divides the Configuration files into layers in order to,
  •    Give you better control over when sitecore loads files at runtime.
  •   Allow you to disable all configuration files in a layer at once.


Folder
Location
Purpose
Sitecore
/App_Config/Sitecore

1. Reserved for sitecore use.

2. Contains all the default sitecore Config Files.

3. Don’t touch anything in here, because components are depend on each other. If we need to change something then use a patch file in the custom layer below.

4. Making Changes in this layer might cause something to stop working or cause issues in the future when you try to Upgrade.

Modules
/App_config/Modules

1. Reserved for sitecore use.

2. Contains configuration files for sitecore modules such as WFFM.

3. Modules config’s will be loaded in the order they were installed. Again we don’t touch here, Use a Patch in Custom.

Note: Do not modify or Patch files in the Sitecore or Modules Layer. Changes in the files in the layer lost Duringg an Update and Affect the Stability of the platform

Custom
/App_Config/Include

1. This is the folder in which we should create your own 
     patch files in order to modify sitecore Settings.

Environment
/App_config/Environment

1. Contains the patch files you create to configure sitecore for non-production environments such as QA,Development. For ex.You may wish to add patch files for SMTP servers.


Note:  To Change the Sitecore settings, You can place the patch files in the custom and environment Layers.


Load Order of Configuration Files
  • System files such as layers.config, ConnectionStrings.config, Web.config.
  • System, Modules, Custom, Environment Layers .
  • Note: Do not Change the order in which the layer load. Within each layer, by default goes through all the sub-folder in the layer recursively and loads in alpha order. Files in the root of a folder are merged before files in the sub-folder within the folder.


Web.config

We normally do not deploy the web.config as part of our builds.

It holds App settings and Server role configurations.

Configure Server:

In order to Configure a server Simply Update
            <AppSettings>
                   <add key="role:define" value="[server role]"/>
         </AppSettings>

Server Roles:
      Content delivery
Content Management
Processing
Reporting
Standalone

By default, the instance is configured as Standalone(for Local Development),Meaning it will Perform all the roles.

You can also combine server roles
       <AppSettings>
                  <add key="role:define" value="ContentManagement, Processing, Reporting"/>
      </AppSettings>

Configure Search Provider:

    <AppSettings>
           <!-- SUPPORTED SEARCH PROVIDERS    
            Specify the search provider that you want this server to use. The supported search providers are:        
            Lucene
            Solr
            Azure        
            Default value: Lucene
           -->
           <add key="search:define" value="Solr" />
   </AppSettings>


Custom Configuration Roles:

We can also Define own Custom Roles.

    <!-- default setting for all server -->
       <setting name="MailServer" set:value="smtp.liveserver.com" />
    <!-- override for UAT environment -->
     <setting name="MailServer"
              set:value="smtp.testservice.net" role:require="EnvironmentUAT" />

That's all, Please share with this to your friends and comment me if anything wrong in this post. Happy Coding :)

No comments:

Post a Comment

Check the users Logged into the sitecore backend

Hi, Today I'm going to discuss about " how to check the concurrent users logged into the sitecore backend ? ". For this ...