Sitecore 9 Installation step by step Guide

Sitecore 9 is here!! We all are excited about the new features of the Sitecore like xConnect, Sitecore Forms, Federated Authentication, Sitecore Cortex and many more. Lot’s of changes is made from Sitecore end to explore the more possibilities in the CMS + DMS domain. There is a lot of talk about new installation framework that is SIF. So let’s jump in and setup sitecore9 XP0 in our local environment.

Step-1: Pre-Requisite

  • Windows 10 Latest Release
  • Microsoft Windows Powershell 5.1
  • Web Deploy 3.6 for Hosting Server
  • URL Rewrite 2.1
  • Microsoft SQL Server Data-Tier Application framework
  • Microsoft SQL Server Transact SQL Dcom

You need to install all of this pre-requisite before going further. Make sure you have the exact version as mentioned in the list.

Step-2: Install JAVA Runtime

Install Java runtime environment and set the JAVA_HOME path in the Environment Variable in System Properties.

Step-3: Download OpenSSL and set the path in the System Properties.

**This will helpful when generating SSL Certificates for the Solr

Step-4: Install Solr 6.6.2

One major changes in the Sitecore 9 is Search Component. By default, Solr is the search provider and Lucene is no longer supported. So you have to install the Solr 6.6.2 as service for Sitecore 9.

To setup Solr as service you can download the NSSM then go to Command Prompt as administrator and run the following command:

<Path-To-NSSM>/nssm.exe install solr6

nsssm
NSSM Solr as Service

Step-5: Enable SSL for SOLR(Self Signed Certificate)

Sitecore 9 required Solr as Secure Service so we have to enable SSL for Solr before beginning the installation.

  • Open Command Prompt as Administrator.
  • Generate the Certificate for SOLR

keytool -genkeypair -alias solr-ssl -keyalg RSA -keysize 2048 -keypass secret -storepass secret -validity 9999 -keystore solr-ssl.keystore.jks -ext SAN=DNS:localhost,IP:192.168.1.3,IP:127.0.0.1 -dname “CN=localhost, OU=Organizational Unit, O=Organization, L=Location, ST=State, C=Country”

  • Convert Certificate to PEM Module:
keytool -importkeystore -srckeystore solr-ssl.keystore.jks -destkeystore solr-ssl.keystore.p12 -srcstoretype jks -deststoretype pkcs12
  • Convert to PCKS12 Format

openssl pkcs12 -in solr-ssl.keystore.p12 -out solr-ssl.pem

  • Add following Lines to solr.in.sh
    SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks
    SOLR_SSL_KEY_STORE_PASSWORD=secret
    SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks
    SOLR_SSL_TRUST_STORE_PASSWORD=secret
    SOLR_SSL_NEED_CLIENT_AUTH=false
    SOLR_SSL_WANT_CLIENT_AUTH=false
    SOLR_SSL_KEY_STORE_TYPE=JKS
    SOLR_SSL_TRUST_STORE_TYPE=JKS
  • Add following lines to solr.in.cmd
    set SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks
    set SOLR_SSL_KEY_STORE_PASSWORD=secret
    set SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks
    set SOLR_SSL_TRUST_STORE_PASSWORD=secret
    set SOLR_SSL_NEED_CLIENT_AUTH=false
    set SOLR_SSL_WANT_CLIENT_AUTH=false

Step-6: Enable Contained Database authentication.

sp_configure ‘contained database authentication’, 1
GO
RECONFIGURE
GO

Step-7: Setting Up the Execution Policy in Powershell using following command:

set-executionpolicy unrestricted

Step-8: Register and Install the Sitecore Installation Wizard.

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

After registering the module to PowerShell execute the following command to install the framework:

Install-Module SitecoreInstallFramework

Step-9: Prepare the Powershell Script for the installation of the Sitecore 9:

  • Unzip the Sitecore XP0 to your local directory.
  • Set the variables of the Powershell Script with your system locals.
  • Finally, Execute the PowerShell script.

Step-10: Post Install Steps:

  • Add recognized user to the shard database using SQLCMD Mode.

    :SETVAR DatabasePrefix xp1

    :SETVAR UserName collectionuser

    :SETVAR Password Test12345

    :SETVAR ShardMapManagerDatabaseNameSuffix _Xdb.Collection.ShardMapManager

    :SETVAR Shard0DatabaseNameSuffix _Xdb.Collection.Shard0

    :SETVAR Shard1DatabaseNameSuffix _Xdb.Collection.Shard1

    GO

    IF(SUSER_ID(‘$(UserName)’) IS NULL)

    BEGIN

    CREATE LOGIN [$(UserName)] WITH PASSWORD = ‘$(Password)’;

    END;

    GO

    USE [$(DatabasePrefix)$(ShardMapManagerDatabaseNameSuffix)]

    IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N’$(UserName)’)

    BEGIN

    CREATE USER [$(UserName)] FOR LOGIN [$(UserName)]

    GRANT SELECT ON SCHEMA :: __ShardManagement TO [$(UserName)]

    GRANT EXECUTE ON SCHEMA :: __ShardManagement TO [$(UserName)]

    END;

    GO

    USE [$(DatabasePrefix)$(Shard0DatabaseNameSuffix)]

    IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N’$(UserName)’)

    BEGIN

    CREATE USER [$(UserName)] FOR LOGIN [$(UserName)]

    EXEC [xdb_collection].[GrantLeastPrivilege] @UserName = ‘$(UserName)’

    END;

    GO

    USE [$(DatabasePrefix)$(Shard1DatabaseNameSuffix)]

    IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N’$(UserName)’)

    BEGIN

    CREATE USER [$(UserName)] FOR LOGIN [$(UserName)]

    EXEC [xdb_collection].[GrantLeastPrivilege] @UserName = ‘$(UserName)’

    END;

    GO

  • Rebuild the Search Indexes and the Link Databases.
  • Deploy Marketing Definitions.

2 Comments

  1. Usually I never comment on blogs but your article is so convincing that I never stop myself to say something about it. You’re doing a great job Man,Keep it up.

  2. The blog is quite good and simple but i don’t agree with your statement about the search techniques. Lucene can also be used as a search provider in sitecore 9. The only limitation is that we won’t be able to use it for further except for Content Search. So the statement that “Lucene is no longer supported” is completely false.

Leave a Reply

Your email address will not be published. Required fields are marked *