Sitecore 9 - Installation

Sitecore has changed the architecture since Sitecore 9.0. Sitecore has introduced Sitecore Installation Framework (SIF) which helps in setting up Sitecore with the various scaled environment. This post we will walk through the installation of Sitecore 9.2 in a developer work station.

Software Requirements.

  1. SOLR 7.5 with SSL
  2. SQL Server 2017
  3. Sitecore Installation Framework
  4. Open SSL
  5. NSSM

Step 1: SQL Server 2017

We will install SQL Server 2017 Express. Express edition can be downloaded from Microsoft using below URL

https://download.microsoft.com/download/5/E/9/5E9B18CC-8FD5-467E-B5BF-BADE39C51F73/SQLServer2017-SSEI-Expr.exe 

The installation process is very simple where we do not have to specify any parameters. Once the installation is completed, it will provide options to customize it further. I have configured SQL with SQL server authentication with following details.

./SQLEXPRESS
UserName: scuser

Once installation complete we can see the connection details. It also provides an option to customize the installation and installing SQL Server Management Studio.


Step 2: SOLR 7.5 with SSL

Sitecore has decommissioned Lucene and provides SOLR as the default provider. Sitecore 9.2 architecture expects all the communication in SSL, so we have to install and configure Solr with SSL. SOLR is a java application, so ensure the required java version is installed.

Open a command prompt and run the command java and press enter to check if Java is installed. Verify JAVA_HOME Environment variable is configured.

A. Download and Install SOLR

SOLR can be downloaded from the below path. Once downloaded, unzip the content to c: \solr.

Download Path: https://archive.apache.org/dist/lucene/solr/7.5.0/solr-7.5.0.zip
B. Configure SSL For SOLR

We would need self-signed certificates for SOLR. We will use java keytool helper to generate a certificate. Then OpenSSL can be used to export the certificate to .pem format, which we will import to the certificate store.

Download Path: https://slproweb.com/download/Win64OpenSSL-1_1_0L.exe

Create a folder named certificate. Open command prompt in Administrator privilege and navigate to the certificate folder. Execute below command in order. 

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:127.0.0.1 -dname "CN=localhost, OU=Organizational Unit, O=Organization, L=Location, ST=State, C=Country"

This command generates .jks (Java Key Store) certificate with password "secret". You can add your local system IP along with localhost, 127.0.0.1

keytool -importkeystore -srckeystore solr-ssl.keystore.jks -destkeystore solr-ssl.keystore.p12 -srcstoretype jks -deststoretype pkcs12

This command imports the .jks certificate and create a .p12 with pkcs12 ( Public Key Cryptography Standards) encryption. Copy these two certificate (solr-ssl.keystore.jks and solr-ssl.keystore.p12) to c:\solr\server\etc. Now use open SSL to export to .pem certificate. When prompted use "secret" as the password.

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

Import these certificate to windows certification store

In the command prompt type mmc.exe. It will open the Microsoft Management Console window. 

Add the Certificate snap-in and import certificate to Personal and Trusted Certificate Certification Authority.



C. Run SOLR as Service

We will use NSSM (https://nssm.cc/release/nssm-2.24.zip) to host solr as a service. Download and unzip nssm to c:\solr\nssm. Open command prompt in Admin mode and navigate to this folder. Then run following command

nssm install solr

It will bring the following window. Select the c:\solr\bin\solr.cmd as executable location. In the parameter specify start -f -p 8983. Click on ok to install solr service. Then start the service. (either open Services.msc or execute netstat command)


Browse the URL https://localhost:8983/solr to ensure solr is installed successfully.

Step 3: Install Sitecore

Sitecore 9.2 comes with the installer that helps to setup Sitecore with all additional services and prerequisites. Here We are using Sitecore 9.2.0 rev. 002893 (Setup XP0 Developer Workstation rev. r150).zip. When you unzip it, it will have several applications and archives. Run setup.exe with administrative privileges.


1. Install all Pre Requisites.

As step 1 it installs all the windows server features and installs Sitecore Installation Framework. To know more in detail we can open the Prerequisites.json in the unzipped folder, which details out all the features and prerequisites. The process takes a bit time as it downloads and installs them.


2. Install Sitecore

This is a multistep process where it installs Sitecore, configure solr cores and install two additional websites (identity server and xConnect). 



Identity server replaces Sitecore's default login page with the externally hosted application. This is in line with most of the customers ask to have single sign-on with other applications/services. Sitecore still has the old login page hosted within Sitecore and can be enabled using few simple configurations.

Once setup is done you can browse the Sitecore instance and there comes the Sitecore launch pad with all familiar icons. :)



TIPS: Disable Identity Server/Use Old login page

Enable the file App_Config\Include\Examples\Sitecore.Owin.Authentication.IdentityServer.Disabler .example. It disables the identity server configuration and set the login page path.

<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" 
    xmlns:set="http://www.sitecore.net/xmlconfig/set/" >
    <sitecore>
        <federatedAuthentication>
            <identityProviders>
                <identityProvider id="SitecoreIdentityServer">
                    <enabled>false</enabled>
                </identityProvider>
            </identityProviders>
        </federatedAuthentication>
        
        <sites>
            <site name="shell" set:loginPage="/sitecore/login"/>
            <site name="admin" set:loginPage="/sitecore/admin/login.aspx"/>
        </sites>
    </sitecore>
</configuration>