Sitecore 9 Installation Guide

Bernard Lim
Sitecore Series
Published in
7 min readMar 30, 2018

My own version of Sitecore 9 installation guide. This time my experience of installing Sitecore 9 on Windows 10 for dev purposes. Also referred to a number of references for guidance. References listed at the bottom of the post. Hope this is as complete and will help you save time!

Pre-requisite Software

  • Powershell
  • Solr 6.6.1
  • SQL Server 2016
  • Java JRE. Add JAVA_HOME environment variable to point to the respective Java JRE folder.’keytool’ under bin as a system environment variable for ‘PATH’
  • WebAdministration module (Comes with IIS)
  • WebDeploy 3.6 for Hosting Servers
  • URL Rewrite 2.1
  • Microsoft SQL Server Data-Tier Application Framework (DacFx)
  • Solr 6.6.1
  • SQL Server 2016

Sitecore 9 Prerequisite Software Installation Steps

Install Java JRE

Also set JAVA_HOME system environment variable to point to your installed JAVA JRE folder

Install Powershell version 5.1 or later

Comes along with Windows 10

Install Web Platform Installer 5.0

Download Source: https://www.microsoft.com/web/downloads/platform.aspx

Enable Contained Database Authentication

Run the following command in SQL Server Management Studio:
sp_configure 'contained database authentication, 1;
GO RECONFIGURE;
GO

Install SIF Prerequisites

Install through Web Platform Installer:

  • Web Deploy 3.6 for Hosting Servers
  • URL Rewrite 2.1
  • Microsoft SQL Server Data-Tier Application Framework (DacFx) version 2016. Download

Install SIF (Sitecore Installation Framework)

  1. Register Powershell NuGet repository
    Register-PSRepository-NameSitecoreGallery-SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2
  2. Register repository as ‘trusted’
    Set-PSRepository-NameSitecoreGallery-InstallationPolicyTrusted
  3. Install ‘Sitecore Install Framework’ module
    Install-Module-NameSitecoreInstallFramework-RepositorySitecoreGallery
  4. Update ‘Sitecore Install Framework’ module
    Update-ModuleSitecoreInstallFramework

Install Solr

Download Source:
http://archive.apache.org/dist/lucene/solr/6.6.1/solr-6.6.1.zip

Check compatibility table before downloading. https://kb.sitecore.net/articles/227897
As of writing, Solr 6.6.1 is officially supported.

Unpack the zip file into a specific location from where your Solr will be running from.

Start Solr by running the following command:
bin\solr.cmd start

Access Solr by the following URL in browser: http://localhost:8983/solr/
If the Solr admin page loads, this will verify it was installed properly.

Generate Keystore

Download the following script: https://kamsar.net/index.php/2017/10/Quickly-add-SSL-to-Solr/ It is a powershell script that will automatically generate a self-signed cert for you to install to Solr.

Script can be found saved as: solr-ssl.ps1

Command to run:
./solr-ssl.ps1 -KeystoreFile C:\solr\solr-6.6.2\server\etc\solr-ssl.keystore.jks

Replace the last parameter with your respective Solr installation directory path and preferred keystore name. Point to 'etc' subfolder inside this directory.

If your Powershell is not setup to run scripts, this error will appear:

cannot be loaded because running scripts is disabled on this system

Run Set-ExecutionPolicy RemoteSigned to enable this.

keytool.exe not on path. Enter path to keytool (found in JRE bin folder):

Enter fullpath to access Directory\keytool.exe

Once finished running, verify that the solr-ssl.keystore.jks or your preferred keystore name will appear in your specified folder.

Generate Certificate

To generate the .p12 certificate from the generated keystore.

Enter the following command:
"C:\Program Files (x86)\Java\jre1.8.0\_144\bin\keytool.exe" -importkeystore -srckeystore solr-ssl.keystore.jks -destkeystore solr-ssl.keystore.p12 -srcstoretype jks -deststoretype pkcs12

Source/Destination keystore password should be the one specified under your script’s $KeystorePassword variable.

A .p12 file should be generated as a result.

Add generated certificate to Trusted Root CA list for local

Also add it to the Trusted Root Certification Authorities store for your local computer after successful generation of the .jks and .p12.

To add certificates to the Trusted Root Certification Authorities store for a local computer

  1. Click Start, click Start Search, type mmc, and then press ENTER.
  2. On the File menu, click Add/Remove Snap-in.
  3. Under Available snap-ins, click Certificates,and then click Add.
  4. Under This snap-in will always manage certificates for, click Computer account, and then click Next.
  5. Click Local computer, and click Finish.
  6. If you have no more snap-ins to add to the console, click OK.
  7. In the console tree, double-click Certificates.
  8. Right-click the Trusted Root Certification Authorities store.
  9. Click Import to import the certificates and follow the steps in the Certificate Import Wizard.

This entry will be found after successful adding of the generated cert to the Trusted Root CA list:

Install SSL as a Windows Service

Download ‘NSSM’ to and point to Solr install path to configure Solr as a Windows Service. Download source: https://nssm.cc/download

To install Solr as a service, run the command ‘nssm install {service name}’ **Note: Add -f parameter to the arguments else will fail eventually with SolrCore error when running the Powershell script.

Open ‘bin/solr.in.cmd’ file and uncomment the following config lines to point to the respective keystore file. (Remove the REM)

Start the service and access it through https://localhost:8983/solr to ensure it is working.

Sitecore 9 Installation

Sitecore 9 Installation Files

Following files are to setup on premise development machine. Other machine types might required different files.

URL for Sitecore 9 Update 1 files: https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/90/Sitecore_Experience_Platform_90_Update1.aspx

Files to download

  • Packages for XP Single under ‘Download options for On Premises deployment’ sub section

Files Required

Unpack the ‘Sitecore 9.0.1 rev. 171219 (WDP XP0 packages)zip file that is the downloaded file above to get another 3 zip files.

  • Sitecore 9.0.1 rev. 171219 (OnPrem)_single.scwdp
  • Sitecore 9.0.1 rev. 171219 (OnPrem)_xp0xconnect.scwdp
  • XP0 Configuration files 9.0.1 rev. 171219.zip (Unzip this file)

Place all these files along with License.xml in a folder. Folder should look like this before installation starts.

Configuration Variables

All config values are stored in sitecore-XP0.json, xconnect-xp0.json files.
Config variables include SQL connection details, site physical path, SOLR instance URL and more.

Sitecore 9 Installation Process

Save the following Powershell script that we will be using for Sitecore Installation. (Script can be copied directly from the official Sitecore 9 Installation PDF as well)

#define parameters
$prefix = “prefixforyourwebsite”
$PSScriptRoot = “Full path to the folder created above”
$XConnectCollectionService = “$prefix.xconnect”
$sitecoreSiteName = “$prefix.local”
$SolrUrl = “https://localhost:8983/solr"
$SolrRoot = “C:\solr-6.6.1”
$SolrService = “solr6.6.1_ssl”
$SqlServer = “sqlservername”
$SqlAdminUser = “sqlserveradminacct”
$SqlAdminPassword = “sqlserverpassword”
#install client certificate for xconnect$certParams =
@{
Path = "$PSScriptRoot\xconnect-createcert.json"
CertificateName = "$prefix.xconnect_client"
}
Install-SitecoreConfiguration @certParams -Verbose#install solr cores for xdb
$solrParams =
@{
Path = "$PSScriptRoot\xconnect-solr.json"
SolrUrl = $SolrUrl
SolrRoot = $SolrRoot
SolrService = $SolrService
CorePrefix = $prefix
}
Install-SitecoreConfiguration @solrParams -Verbose#deploy xconnect instance
$xconnectParams =
@{
Path = "$PSScriptRoot\xconnect-xp0.json"
Package = "$PSScriptRoot\Sitecore 9.0.1 rev. 171219 (OnPrem)_xp0xconnect.scwdp.zip"
LicenseFile = "$PSScriptRoot\license.xml"
Sitename = $XConnectCollectionService
XConnectCert = $certParams.CertificateName
SqlDbPrefix = $prefix
SqlServer = $SqlServer
SqlAdminUser = $SqlAdminUser
SqlAdminPassword = $SqlAdminPassword
SolrCorePrefix = $prefix
SolrURL = $SolrUrl
}
Install-SitecoreConfiguration @xconnectParams -Verbose#install solr cores for sitecore$solrParams =
@{
Path = "$PSScriptRoot\sitecore-solr.json"
SolrUrl = $SolrUrl
SolrRoot = $SolrRoot
SolrService = $SolrService
CorePrefix = $prefix
}
Install-SitecoreConfiguration @solrParams -Verbose#install sitecore instance
$sitecoreParams =
@{
Path = "$PSScriptRoot\sitecore-XP0.json"
Package = "$PSScriptRoot\Sitecore 9.0.1 rev. 171219 (OnPrem)_single.scwdp.zip"
LicenseFile = "$PSScriptRoot\license.xml"
SqlDbPrefix = $prefix
SqlServer = $SqlServer
SqlAdminUser = $SqlAdminUser
SqlAdminPassword = $SqlAdminPassword
SolrCorePrefix = $prefix
SolrUrl = $SolrUrl
XConnectCert = $certParams.CertificateName
Sitename = $sitecoreSiteName
XConnectCollectionService = "https://$XConnectCollectionService"
}
Install-SitecoreConfiguration @sitecoreParams -Verbose
  1. Edit the ‘#define parameters’ section to match your local environment values.
  2. Run the above powershell script to start installation process.
  3. Once Powershell output window says ‘transcript stopped’, Sitecore should be up and running.

On successful installation, there should be 2 instances on your IIS. Example:

Potential Errors and Solutions

Unable to connect to master or target server ‘xp0_Processing.Pools’. You must have a user with the same password in master or target server ‘xp0_Processing.Pools’.

Set the value of $SqlServerwith the following syntax: “localhost{SQL Instance Name}” rather than with just the Ensure that your SQL Server has mixed authentication enabled, to allow for SQL Server Authentication connections. Also ensure that login user has Login enabled.

“There are errors” in Experience Analytics

Ensure that any certificate-related connection string under ConnectionStrings.config has the correct certificate thumbprint value for ‘FindValue’ attribute. To get the correct certificate thumbprint value, go to IIS. Click on ‘Server Certificates’. Choose the respective client certificate (would probably be named as ‘prefix’.xconnect_client), choose ‘Details’ tab. Check the value of the ‘Thumbprint’ attribute. This should match the ‘FindValue’ attributes above. If already matches, also ensure that ‘XConnect’ instance & XConnect App Pool is running.

References

https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/90/Sitecore_Experience_Platform_90_Initial_Release.aspx#

https://medium.com/redhotminute-australia/setting-up-solr-with-ssl-for-sitecore-9-acdf009edd93

https://blogs.perficient.com/sitecore/2017/10/26/setup-and-basic-preparation-for-sitecore-9-installation/

http://blog.baslijten.com/gotchas-while-installing-sitecore-9-using-the-sitecore-installation-framework/

Originally published at .

--

--

Bernard Lim
Sitecore Series

@thebernardlim. Code. Sitecore. Fitness. Food. Random