Sitecore 9 Installation Step by Step

The installation of Sitecore 9 is really an easy one. But if some of the component is not configured correctly then you may run into issues. So I’m sharing my experience below to help you to make it trouble free.

Part 1: Java and SOLR setup

Before starting the installation process I’d to install and set up JRE and  SOLR. So downloaded JRE from http://www.oracle.com/technetwork/java/javase/downloads/jre10-downloads-4417026.html

Setup Java_Home environment variable

Please make sure to set JAVA_HOME environment to your JRE installation folder.
You can use this Powershell command to set it up:

$env:JAVA_HOME=”$env:JAVA_HOME=”C:\Program Files\Java\jre1.8.0_171″

After that, please run this Powershell command to verify if the path is correct:

echo $Env:JAVA_HOME

JRE

Setting up Solr as service

Download Solr from here  and unzip to C:\Program Files\solr-6.6.2

Create Keystore

Open windows command prompt with admin privilege ( Please not that if you use Windows power shell you may get error. So use windows command prompt) and run below command

“C:\Program Files\Java\jre1.8.0_171\bin\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 -dname “CN=localhost, OU=Organizational Unit, O=Organization, L=Location, ST=State, C=Country”

you may want to change keytool.exe path based on your jave installation path. Please note that the solr-ssl.keystore.jks file will be created on the current directory.

Run below command in command promt with admin privilege.

“C:\Program Files\Java\jre1.8.0_171\bin\keytool.exe” -importkeystore -srckeystore solr-ssl.keystore.jks -destkeystore solr-ssl.keystore.p12 -srcstoretype jks -deststoretype pkcs12

This will ask for source and destination pass key which is secret

Install certificate

Double click on solr-ssl.keystore.p12 and follow the prompt.When you reach the Certificate Store window, make sure to place the certificate in the Trusted Root Certification Authorities.

Then copy solr-ssl.keystore.jks, solr-ssl.keystore.p12 to C:\Program Files\solr-6.6.2\server\etc\

Enable SSL in Solr

To enable SSL, edit the file C:\Program Files\solr-6.6.2\bin\solr.in.cmd. Uncomment properties starting with Solr_SSL_*:

Test start Solr

type cd “C:\Program Files\solr-6.6.2\bin” on windows powershell and enter

then ./solr.cmd -p 8984 and enter

SOLR.PNG

Enter https://localhost:8984/solr/#/ in web browser to test .

Setup Solr to run as a Windows service

Download and extract Non-Sucking Service Manager from https://nssm.cc/download.

Run following command “C:\Assets\Sitecore9\nssm-2.24\nssm-2.24\win64\nssm.exe” install SOLR6. Change the path of nssm.ex to where you extracted it.

 

Set the path to ‘C:\Program Files\solr-6.6.2\bin\solr.cmd’ and Arguments to ‘start -f -p 8983’:

The go to service by typing service.msc in the run command and start the service “SOLR6”

Browse https://localhost:8983 to make sure it works.

Step2:

Sitecore 9 prerequisite installation

 Microsoft PowerShell® version 5.1 or later.
 Web Platform Installer 5.0.

If you have powershell already installed in your computer then run below command to check the version

$PSVersionTable.PSVersion

Download and install following

webdeploy from https://www.microsoft.com/en-us/download/details.aspx?id=43717

URL REewrite https://www.iis.net/downloads/microsoft/url-rewrite

Microsoft SQL Server Data-Tier Application Framework ( https://www.microsoft.com/en-us/download/details.aspx?id=55255

Download the SIF Configuration Files

Download Sitecore 9 XP0 package from sitecore.net and then unzip. In my case I copied it to C:\resourcefiles

Add below script to a notepad and update as required. Then save as install.ps1

 

#define parameters
$prefix = “qa.sitecore9”
$PSScriptRoot = “C:\resourcefiles”
$XConnectCollectionService = “$prefix.xconnect”
$sitecoreSiteName = “$prefix.sc”
$SolrUrl = “https://localhost:8983/solr”
$SolrRoot = “C:\Program Files\solr-6.6.2”
$SolrService = “SOLR6”
$SqlServer = “DINLAS\xyd”
$SqlAdminUser = “sitecore_admin”
$SqlAdminPassword=”password”
#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
#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 = “Sitecore”
SqlServer = $SqlServer
SqlAdminUser = $SqlAdminUser
SqlAdminPassword = $SqlAdminPassword
SolrCorePrefix = $prefix
SolrURL = $SolrUrl
}
Install-SitecoreConfiguration @xconnectParams
#install solr cores for sitecore
$solrParams = @{
Path = “$PSScriptRoot\sitecore-solr.json”
SolrUrl = $SolrUrl
SolrRoot = $SolrRoot
SolrService = $SolrService
CorePrefix = $prefix
}
Install-SitecoreConfiguration @solrParams
#install sitecore instance
$xconnectHostName = “$prefix.xconnect”
$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

 

Run powershell in admin mode and go to C:\resourcefiles (cd C:\resourcefiles command)

Then run ./install.PS1

Installation Failed

My installation failed at UpdateSolrSchema task in C:\resourcefiles\Sitecore-XP0.json . S i tried to manually do this task but website was not accessible. When I tried this in browser was getting service not available message. So checked the host entry and tried to trouble shoot using https://serverfault.com/questions/452268/hosts-file-ignored-how-to-troubleshoot but no luck. Then I added my sitecore site URL to do not use proxy list which resolved the issue.proxy

After fixing the issue I manually populated Solr managed schema (On the Sitecore Launchpad, click Control Panel, and in the Indexing section, click populated Solr managed schema).

Everything looks good !!!!!