--- title: Prepare the main Sitecore content manager for a scaled environment slug: '2416' canonical_url: https://docs.coveo.com/en/2416/ collection: coveo-for-sitecore-v5 source_format: adoc --- # Prepare the main Sitecore content manager for a scaled environment Once you correctly built the whole Sitecore infrastructure, you may proceed to configure Coveo for Sitecore on your main content management instance (CM1). ## Step 1: Configure an additional database search index Sitecore suggests adding a `pub` database, as illustrated in [Sitecore infrastructure setup](https://docs.coveo.com/en/3156#sitecore-infrastructure-setup). Whether this additional database is called `pub` or something else (for example, `web2`), add a new index definition for it. . On `CM1`, open the `\Website\App_Config\Include\Coveo\Coveo.SearchProvider.Custom.config` file in a text editor. > **Important** > > You shouldn't modify the `Coveo.SearchProvider.config` file directly, as it may cause unexpected upgrade issues and loss of configuration. . Inside the `contentSearch/configuration/indexes` element, add another `` element as the last child by copy-pasting the code block for your Sitecore version. > **Important** > > Disable indexing of the `pub` database on all your additional CMs and CDs. > Patch delete the `database` parameter from your `coveoOnPublishEndAsyncPub` index update strategy. > > Configuration patching to disable indexing on CD and non-indexing CM servers is included directly in the code block below. > This patch relies on the [enabling of the indexing sub-role](https://doc.sitecore.com/xp/en/developers/100/platform-administration-and-architecture/enable-the-indexing-sub-role.html) on your main content manager and only on the main content manager. Copy and paste the following content to create the new child of the `` element: ```xml $(id) pub /sitecore/content true pub /sitecore/media library/Files true false false ``` . Apply the following changes to the `` element that you just added. .. The `id` attribute is set to `Coveo_pub_index` in the copied block. If your additional database isn't named `pub`, change the `id` attribute value to reflect the name of your database (for example, `Coveo_web2_index`). .. The text value of the `` elements in the copied block is `pub`. If your additional database isn't named `pub`, change the text value to reflect the name of your database (for example, `web2`). . Add the following `` element as an immediate child of the `` element: ```xml pub true ``` . The text value of the `` element in the block you just copied is `pub`. If your additional database isn't named `pub`, change the text value to reflect the name of your database (for example, `web2`). > **Important** > > If you make changes to the `` element (that is, to the element name or its `name` attribute value), ensure you match these changes in the child `` elements of the `` element you added earlier. . Save your changes. ## Step 2: Rebuild the search index for the additional database Your additional database is now properly configured and can be indexed by Coveo for Sitecore. Use the Coveo **Command Center** Indexing Manager to [rebuild the newly created index](https://docs.coveo.com/en/2426/). > **Important** > > Your Sitecore items are indexed with clickable URI values matching a `hostName` value assigned to your content management instance. > However, the clickable URI is [automatically recomputed](https://docs.coveo.com/en/2930#automatic-recomputation-of-the-clickable-uri-at-query-time) whenever a Coveo-powered search interface receives search results from the index to ensure that the intended content delivery instance is hit whenever a website visitor clicks a search result. ## Step 3: Configure the `UseHostHeaderForRequestURL` setting Under the hood, Coveo for Sitecore performs HTTP requests on its own. To ensure that these internal HTTP requests are targeting the expected endpoint, the `aspnet:UseHostHeaderForRequestUrl` setting must be set properly (see [ASP.NET `appSettings` Element](https://learn.microsoft.com/en-us/previous-versions/aspnet/hh975440(v=vs.120)) for details). > **Note** > > The `aspnet:UseHostHeaderForRequestUrl` setting must be set to `true` when the Sitecore instance is deployed behind a network load balancer (NLB). > Omitting this setting may cause URL-resolving issues. Follow these steps to configure the setting on the `CM1` instance: . Open your `web.config` file. . Inside `configuration/appSettings`, add the following element: ```xml ``` . Save your changes. ## Step 4: Configure the farm name on the instance to be scaled When scaling Sitecore instances, you must set a `Farm name` to ensure all the Sitecore instances share the same resources. Setting a `Farm name` affects the names of the sources, field sets, security provider, and user identities. Instead of assigning them an individual name, you give them the same label. Follow the [Assign a farm name to resources](https://docs.coveo.com/en/2149/) guide to configure the `CM1` instance. > **Important** > > When choosing a `Farm name` different from the `CM1` host name, rebuild your Coveo indexes (see [Coveo for Sitecore indexing guide](https://docs.coveo.com/en/2216/)). > Some resources, like the sources, need to be rebuilt to apply the name change. > Skipping the rebuild would cause naming inconsistencies that would prevent queries and components from reaching the right resources. ## What's next? Now that you installed Coveo for Sitecore on your first content management instance, you may proceed either to: * Deploy Coveo for Sitecore on an additional content management instance (see [Deploy on additional content managers](https://docs.coveo.com/en/2265/)). OR * Deploy Coveo for Sitecore on your content delivery servers (see [Deployment on the content delivery servers](https://docs.coveo.com/en/2264/)).