Install Sitecore XP 9.0.2 on premises

Tags: Sitecore XP, Sitecore 9.0.2, Sitecore XP 9.0.2, Installation

This post covers the step by step guide for installing Sitecore XP 9.0.2 on local machine

These are some minestones:

  • Prerequisites
  • Ensure basic components
  • Ensure Sitecore Installation Framework
  • Ensure Solr service
  • Prepare installation assets
  • Install new Sitecore XP 9.0.2 instance
  • Install to custom web root
  • Troubleshooting

Prerequisites

  • OS: Windows Server 2016 / 2012 R2 (64-bit), Windows 8.1/10 Pro (32/64-bit)
  • DB: MS SQL Server 2016 SP1 or later
  • .NET Framework 4.6.2 or later
  • Web server: IIS 8.5/10.0
  • Web Deploy 3.6
  • Windows PowerShell 5.1 or later
  • Sitecore Installation Framework (SIF) PowerShell module
  • Search index provider: Solr 6.6.2

Ensure basic components

Install following component if it does not exist:

  • IIS 8.5/10.0
  • .NET Framework 4.6.2 or newer version
  • Web Deploy 3.6
  • Web Platform
  • Open Web Platform and install following features:
    • URL Rewrite
    • Microsoft SQL Server Data-Tier Application Framework
    • SQL Server 2012 Transact-SQL ScriptDom
    • SQL Server System CLR Types 11.0
    • Share Management Object
  • MS SQL Server 2016 SP1 or newer version

Ensure Sitecore Installation Framework

Install SIF if it does not exist:

  • Launch PowerShell as administrator
  • Run the following cmdlet to register the repository:
    Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2
  • Install SIF module:
    Install-Module SitecoreInstallFramework
  • When prompted to install, press Y, and then press ENTER:

  • Install SitecoreFundamentals module:
Install-Module SitecoreFundamentals
  • Then import 2 above modules:
Import-Module SitecoreFundamentals
Import-Module SitecoreInstallFramework

Ensure Solr service

Sitecore XP 9.0.2 supports Solr, Lucene, and Azure Search as search providers. But it is recommended to use Solr to work in both analytics and content search

Setup Solr as a Windows service

  • Ensure Java is available in Solr server. If not, download, install and set JAVA_HOME environment variable
  • Download Solr package then exact zip file to target directory used to store Solr. For example: D:\DB\Solr\solr-6.6.2
  • Down load NSSM and unzip.
  • From NSSM root directory Open Command Line & execute following command (replace <win platform> by yours):
<win platform>/nssm.exe install Solr662
  • Configure in next dialog, then "Install service":

  • Run service.msc then start Solr service:

Setup SSL

  • Launch Command Prompt as administrator
  • Change directory to bin folder of existing JRE (ex: C:\Program Files\Java\jre1.8.0_151\bin)
  • Generate solr keystore by executing following command:
.\keytool.exe -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,IP:10.0.1.30 -dname "CN=localhost, OU=Organizational Unit, O=Organization, L=Location, ST=State, C=Country"
  • New keystore file named solr-ssl.keystore.jks will be generated in the current directory
  • Convert the JKS keystore into PKCS12 format:
.\keytool.exe -importkeystore -srckeystore solr-ssl.keystore.jks -destkeystore solr-ssl.keystore.p12 -srcstoretype jks -deststoretype pkcs12
  • The keytool application will prompt you to create a destination keystore password and for the source keystore password, which was set when creating the keystore ("secret" in the example above).
  • solr-ssl.keystore.p12 file should be generated. Copy this file to <solr-root>/server/etc
  • Edit <solr-root>/bin/solr.in.cmd file by uncomment then edit following section:
set SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.p12
set SOLR_SSL_KEY_STORE_PASSWORD=secret
set SOLR_SSL_KEY_STORE_TYPE=PKCS12
set SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.p12
set SOLR_SSL_TRUST_STORE_PASSWORD=secret
set SOLR_SSL_TRUST_STORE_TYPE=PKCS12
set SOLR_SSL_NEED_CLIENT_AUTH=false
set SOLR_SSL_WANT_CLIENT_AUTH=false

  • Add the certificate .jks (or .p12) above to trusted root (refer this doc):

Prepare installation assets

  • Extract to specific folder, let say C:\Install\SitecoreXP902
  • Extract C:\Install\SitecoreXP902\XP0 Configuration files 9.0.2 rev. 180604.zip, you will see several json files
  • Copy Sitecore license file (license.xml) to C:\Install\SitecoreXP902

Install new Sitecore XP 9.0.2 instance

  • Download install_default.ps1 file to C:\Install\SitecoreXP902 folder then edit following parameters (and other params if you need):
    • $prefix: site prefix
    • $PSScriptRoot: path to root installation folder
    • $SolrRoot: path to Solr root folder
    • $SolrService: name of Solr service
    • $SqlServer: SQL server
    • $SqlAdminUser: username for acessing SQL
    • $SqlAdminPassword: password of sql user
  • Launch Windows Powershell as administrator
  • Check SIF version by running following script:
Get-InstalledModule SitecoreInstallFramework

  • If SIF version = 1.2.1, you can skip this step. Otherwise (= 2.0.0), do the following changes:
    • Edit xconnect-createcert.json file: Update "StoreLocation": "CurrentUser" to "StoreLocation": "LocalMachine"
    • Edit sitecore-solr.json & xconnect-solr.json files: find "CreateCores" task and update "Name" to "name":

  • Execute above script file:
C:\Install\SitecoreXP902\install_default.ps1
  • Take a cup of coffee and enjoy the result.

Install to custom web root

I personally like to put web root out of default location (C:\inetpub\wwwroot). So I updated installation script and configuration files to make it happen.

If you interested in those one, please download following files:

Replace sitecore-XP0.json and xconnect-xp0.json files, then use install_902_custom_web_root.ps1 to install new instance.

Troubleshooting

Same database exist

If your first installation failed, following error might occur next time:

Solution: delete all DBs from previous installation

Index timeout

Solution: re-index manually by browing this URL manually http://<site>/sitecore/admin/PopulateManagedSchema.aspx?indexes=all

Miss dependency

ERROR_DACFX_NEEDED_FOR_SQL_PROVIDER

Solution: install following features using Web Platform Installer:

  • Microsoft SQL Server 2012 Data-Tier Application Framework
  • SQL Server 2012 Transact-SQL ScriptDom
  • SQL Server System CLR Types 11.0

ERROR_SMO_NEEDED_FOR_SQL_PROVIDER

Solution: Install the latest version of Share Management Object using Web Platform Installer

Using SIF 2.0.0

If you're using SIF 2.0.0 instead of 1.2.1, you might see this error:

Solution: follow the 7th step in "Install new Sitecore XP 9.0.2 instance" section above

No Comments

Add a Comment