How to Install Sitecore 9.2 on a Scaled Environment

Sitecore 9.2 comes with a graphical installation wizard type called SIA (Sitecore Install Assistant) which is very convenient for the developers and for a stand-alone installation and it will save many working hours but, unfortunately, it does not support scaled installation.

I had a case where we have the following a scaled topology and we need to automate the installation and replicate it over different environments.

    Sitecore has an extensive guide covers the Installation for the XP Scaled topology it’s a must read for any scaled setup but for this case we decided the best route is to modify the single XP installation script and tailored it to fit our need, we did that by doing the following steps:

    First, I removed the XConnect & Solr JSON file from the Includes section in the “XP0-SingleDeveloper.json”

    Then I removed the ConfigureSolrSchemas section from “XP0-SingleDeveloper.json”:

    Third, I modified the installation PowerShell script to 4 separated tasks.

    I will just list the script parameters that usually the developers modify, but you can download the scripts from here.

    1. Install Solr 7.5.0 :

    The script can download any Solr version and install it to a specific folder, and register the Solr windows service.


    2. Install Solr Sitecore & Xconnect Cores:

    After setting up the Solr server we need setup the Solr core for Sitecore & xconnect. We placed this in a separate file from the Solr installation script as it would be efficient and easier to rollback if either installation failed


    3. Install Xconnect:


    4. Install Sitecore 9.2


    Prerequisites 

    Before running the installation script make sure to install the appropriate prerequisites for each server, they can be summarized as:

    1. Sitecore 9.2 supports SQL Server 2017.

    2. Enable contained databases on SQL Server, run this SQL script through SQL Server Management Studio:

        EXEC sp_configure ‘contained’, 1;
        RECONFIGURE;

    3. For Sitecore Identity server, you must install:.NET Core 2.1.7 Windows Hosting module

    4. NET Framework: 4.7.1 or later, Download Here

    5. Microsoft Visual C++ 2015 Redistributable, Download here

    6. Microsoft Powershell 5.1 or later: Ensure PowerShell will allow for the running of unsigned modules, by opening a PowerShell prompt as Admin and running: Set-ExecutionPolicy Unrestricted

    7. Web Platform Installer 5.0

    8. Web Deploy 3.6 for Hosting Servers: Use Web Platform Installer to install this tool

    9. URL Rewrite 2.1: Use Web Platform Installer to install this tool

    10. IMPORTANT You must enable the Transport Layer Security (TLS) protocol version 1.2 on all of your Sitecore Experience Platform content management and Dedicated Dispatch servers (DDS). For more information about enabling TLS 1.2, see Microsoft’s documentation

    When the server is ready one last piece of advice is to make sure to select the correct SIF by doing the following:

    - Open the 64-bit PowerShell version as an administrator.

    - Register the repository, in a PowerShell command line, run the following cmdlet:

    Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2

    - Make sure to install the compatible SIF version with the Sitecore version you are planning to install. The following table lists the versions of SIF and itsSitecore XP 9.X compatible version:

    If you have multiple version you can select the required one by using the command:

    Import-Module -Name SitecoreInstallFramework -Force -RequiredVersion x.x.x

    Finally, remember you can uninstall any script simply by changing the Install-SitecoreConfiguration to Uninstall-SitecoreConfiguration and run it again!

    Common issues while installing Sitecore 9.x

    Below are the most common issues we collected though many Sitecore 9.X installations. You may not see any, but in case you do, I hope that these can save you some time.

    1. Failed to start service 'Sitecore Marketing Automation Engine’

    There are multiple different reasons for the failure of the Marketing Automation Engine, so the first thing to do is to check the logs, you can find it in this location:

    “sc.xconnect\App_Data\jobs\continuous\AutomationEngine\App_Data\Logs”

    2. Error initializing XConnect client

    2020-01-07 13:54:59.430 -06:00 [Error] Error initializing XConnect client.

    System.AggregateException: One or more errors occurred. ---> Sitecore.XConnect.XdbCollectionUnavailableException: The HTTP response was not successful: Forbidden

       at Sitecore.XConnect.Client.WebApi.ConfigurationWebApiClient.<Refresh>d__6.MoveNext()

    --- End of stack trace from previous location where exception was thrown ---

       at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()

       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

       at Sitecore.XConnect.Client.XConnectClientConfiguration.<InitializeAsync>d__32.MoveNext()

       --- End of inner exception stack trace ---

    3. HTTP 403 Error Message

    Kam Figy wrote an excellent article that covers most of the xconnect issues, you can find it at https://kamsar.net/index.php/2017/10/All-about-xConnect-Security/

    4. Identity Server

    If the identity Server failed to start or redirected to a black page after login, the first way to troubleshoot this problem is to enable logging by changing the web.config at the IdentityServer root folder.

    <aspNetCore processPath="dotnet" arguments=".\Sitecore.IdentityServer.Host.dll" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />

    For example, here is a sample error of what you might find in the enabled logs:

    15:14:32] IdentityServer4.Hosting.IdentityServerMiddleware [Fatal] Unhandled exception: "Keyset does not exist"

    Internal.Cryptography.CryptoThrowHelper+WindowsCryptographicException: Keyset does not exist

       at Internal.NativeCrypto.CapiHelper.CreateProvHandle(CspParameters parameters, Boolean randomKeyContainer)

       at System.Security.Cryptography.RSACryptoServiceProvider.get_SafeProvHandle()

       at System.Security.Cryptography.RSACryptoServiceProvider.get_SafeKeyHandle()

       at System.Security.Cryptography.RSACryptoServiceProvider..ctor(Int32 keySize, CspParameters parameters, Boolean useDefaultKeySize)

       at System.Security.Cryptography.RSACryptoServiceProvider..ctor(CspParameters parameters)

       at Internal.Cryptography.Pal.CertificatePal.<>c.<GetRSAPrivateKey>b__61_0(CspParameters csp)

       at Internal.Cryptography.Pal.CertificatePal.GetPrivateKey[T](Func`2 createCsp, Func`2 createCng)

       at Internal.Cryptography.Pal.CertificatePal.GetRSAPrivateKey()

       at Internal.Cryptography.Pal.CertificateExtensionsCommon.GetPrivateKey[T](X509Certificate2 certificate, Predicate`1 matchesConstraints)

       at Microsoft.IdentityModel.Tokens.X509SecurityKey.get_PrivateKey()

       at Microsoft.IdentityModel.Tokens.X509SecurityKey.get_PrivateKeyStatus()

       at Microsoft.IdentityModel.Tokens.AsymmetricSignatureProvider..ctor(SecurityKey key, String algorithm, Boolean willCreateSignatures)

       at Microsoft.IdentityModel.Tokens.CryptoProviderFactory.CreateSignatureProvider(SecurityKey key, String algorithm, Boolean willCreateSignatures)

       at Microsoft.IdentityModel.JsonWebTokens.JwtTokenUtilities.CreateEncodedSignature(String input, SigningCredentials signingCredentials)

       at System.IdentityModel.Tokens.Jwt.JwtSecurityTokenHandler.WriteToken(SecurityToken token)

    Make sure the SSL certificates are setup correctly, you can use the same steps we used in troubleshooting the xconnect issues. In addition, make sure the APP POOL user has read permission to the SSL certificate by opening the Certificates Console -> Right-click the certificate -> All Tasks -> Manage Private Keys.

    Post-Installation:

    Don’t forget to correct the connection strings for each environment and to set the server role in the web.config by updating the following app settings

    <add key="role:define" value="ContentDelivery" />

    I hope these tips were helpful as you navigate your Sitecore installation. If you have any further questions, reach out to one of our Sitecore experts here. 


    About Author

    Naim Al
    Naim holds a Bachelor Degree in Information Technology and an MBA in Finance. He started his career in programming in 2001 building desktop financial applications. In 2004 he shifted his focus to develop websites. In 2016 Naim joined Americaneagle.com as a Senior Sitecore Developer. In 2020 Naim won the 1st place in Sitecore Hackathon 2020 competition with American Eagle XTeam Winner, over 82 teams from more than 23 countries were participating. When he is not coding, he likes to spend time with his wife and two kids, watching TV, or relax in his backyard.


    Featured Posts