Close

Sitecore 9.1 – Local Installation

Requirements

Solr Setup

Sitecore 9.1 XP requires Solr with SSL enabled. You can use this guide in order to create a self-signed certificate. 

Check this quick guide on how to enable SSL on Solr.

Sitecore Installation Framework (SIF)

SIF is a module required to install Sitecore. If you want to know more about it, visit the Sitecore Developer site

First, we need to confirm which version of PowerShell is installed in our machine. Use the command $PSVersionTable to check the current version

2018-11-30 12_44_34-Window

Here we can see that our current version is 5.1.* which is a prerequisite to install Sitecore 9.1.

Then, we need to execute the following scripts to install SIF successfully. Remember to open PowerShell in administrator mode.

# Register the Sitecore Repository
Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2
# Install the Sitecore Install Framwork module
Install-Module SitecoreInstallFramework

If you already have the SIF module installed and just want to update it. Use the following script:

# Update the Sitecore Install Framwork module
Update-Module SitecoreInstallFramework

You can also install Sitecore Fundamentals which is a PowerShell module that is used to configure security certificates and transport level security for Sitecore websites. Sitecore Fundamentals is automatically installed when you install SIF.

# Install the Sitecore Fundamentals module
Install-Module SitecoreFundamentals

In order to validate the installation, we can use the following command

# Validate the installation
Get-Module SitecoreInstallFramework –ListAvailable

2018-11-30 12_53_23-Window

Here you can see the installed versions in the current machine. 

Sitecore 9.1

Download Sitecore 9.1.0 rev. 001564 (WDP XP0 packages) from the Developer Site – select the Packages for XP Single (XP0) Instance configuration. This is the correct resource if you want to install it locally. 

Create a folder under the root path (c:\). Extract the file and you will see four packages.

2018-11-30 14_36_12-Window

Extract, in the same folder, the file XP0 Configuration files 9.1.0 rev. 001564.zip which has the main configuration files. 

2018-11-30 14_38_20-Window

Do not forget to paste your Sitecore license.xml file in the same folder.

First, we will need to install the prerequisites – this is one of the things new that differs from older Sitecore installations. Open PowerShell in administrator mode and navigate where your files were unzipped and execute the following command. 

Install-SitecoreConfiguration -Path .\Prerequisites.json

Once it{s completed, a reboot might be needed.

Next, you need to edit the script XP0-SingleDeveloper.ps1. Update each
line with the settings that are applicable to your environment.

2018-11-30 14_47_34-Window

One of the settings you should consider changing is SitecoreAdminPassword. By default, it has “SIF-Default” which means that the admin password will be auto-generated. The admin password is not “b” anymore unless you specify it as its value

$SitecoreAdminPassword = “b”

Once you have confirmed all the values and saved the script, we will need to run that script.

2018-11-30 15_06_29-Window

It will take some time to complete the process but in the end, you will see the generated password. 

2018-11-30 14_52_43-Window

You can also check the logs (XP0-SingleDeveloper.log) 

[---------------------------- SitecoreXP0_UpdateSolrSchema : SitecoreUrl ---------------------------------------------]
[SitecoreXP0_UpdateSolrSchema]:[Authenticating] http://sc910.sc/sitecore/admin/PopulateManagedSchema.aspx?indexes=all
[SitecoreXP0_UpdateSolrSchema]:[Requesting] http://sc910.sc/sitecore/admin/PopulateManagedSchema.aspx?indexes=all
[SitecoreXP0_UpdateSolrSchema]:[Success] Completed Request

[----------------------------- SitecoreXP0_DisplayPassword : WriteInformation ----------------------------------------]
Sitecore Admin Password: JEw2fYRIbLU7ENMP1weQ
[TIME] 00:15:13

Finally, browse to your site, which is $SitecoreSiteName = “$prefix.sc” (i.e. http://sc910.sc/sitecore) and verify that Sitecore login page shows up.  

Go to the control panel and do these three important things:

1. Rebuild your indexes

2018-11-30 15_36_28-Control Panel

2. Rebuild link databases

2018-11-30 15_35_49-Control Panel

3. Deploy Marketing definitions

2018-11-30 15_35_04-Control Panel

….and now you have Sitecore 9.1 up and running

Happy Sitecoring 😉

Solr – Enabling SSL

This guide will help you to enable SSL on Solr so it can run over HTTPS.

1. Download and install JRE or JDK 8.0 or later version

  • This will come with the Keytool.exe tool that will help us create the certificateJava Keytool

2. Download Solr 6.6.*-7.2.*

3. In the installation folder, find the etc folder. i.e.  C:\solr\solr-6.6.2\server\etc and create a PowerShell script.

  • Make sure the that the Keytool.exe is pointing to your local JRE/JDK
param(
	[string]$KeystoreFile = 'solr-ssl.keystore.jks',
	[string]$KeystorePassword = 'secret',
	[string]$SolrDomain = 'localhost',
	[switch]$Clobber
)

$ErrorActionPreference = 'Stop'

### PARAM VALIDATION
if($KeystorePassword -ne 'secret') {
	Write-Error 'The keystore password must be "secret", because Solr apparently ignores the parameter'
}

if((Test-Path $KeystoreFile)) {
	if($Clobber) {
		Write-Host "Removing $KeystoreFile..."
		Remove-Item $KeystoreFile
	} else {
		$KeystorePath = Resolve-Path $KeystoreFile
		Write-Error "Keystore file $KeystorePath already existed. To regenerate it, pass -Clobber."
	}
}

$P12Path = [IO.Path]::ChangeExtension($KeystoreFile, 'p12')
if((Test-Path $P12Path)) {
	if($Clobber) {
		Write-Host "Removing $P12Path..."
		Remove-Item $P12Path
	} else {
		$P12Path = Resolve-Path $P12Path
		Write-Error "Keystore file $P12Path already existed. To regenerate it, pass -Clobber."
	}
}

try {
	$keytool = (Get-Command 'C:\Program Files\Java\jre1.8.0_144\bin\keytool.exe').Source
} catch {
	$keytool = Read-Host "keytool.exe not on path. Enter path to keytool (found in JRE bin folder)"

	if([string]::IsNullOrEmpty($keytool) -or -not (Test-Path $keytool)) {
		Write-Error "Keytool path was invalid."
	}
}

### DOING STUFF

Write-Host ''
Write-Host 'Generating JKS keystore...'
& $keytool -genkeypair -alias solr-ssl -keyalg RSA -keysize 2048 -keypass $KeystorePassword -storepass $KeystorePassword -validity 9999 -keystore $KeystoreFile -ext SAN=DNS:$SolrDomain,IP:127.0.0.1 -dname "CN=$SolrDomain, OU=Organizational Unit, O=Organization, L=Location, ST=State, C=Country"

Write-Host ''
Write-Host 'Generating .p12 to import to Windows...'
& $keytool -importkeystore -srckeystore $KeystoreFile -destkeystore $P12Path -srcstoretype jks -deststoretype pkcs12 -srcstorepass $KeystorePassword -deststorepass $KeystorePassword

Write-Host ''
Write-Host 'Trusting generated SSL certificate...'
$secureStringKeystorePassword = ConvertTo-SecureString -String $KeystorePassword -Force -AsPlainText
$root = Import-PfxCertificate -FilePath $P12Path -Password $secureStringKeystorePassword -CertStoreLocation Cert:\LocalMachine\Root
Write-Host 'SSL certificate is now locally trusted. (added as root CA)'

Write-Host ''
Write-Host '########## NEXT STEPS ##########' -ForegroundColor Green
Write-Host ''
Write-Host '1. Copy your keystore to $SOLR_HOME\server\etc (MUST be here)' -ForegroundColor Green

if(-not $KeystoreFile.EndsWith('solr-ssl.keystore.jks')) {
	Write-Warning 'Your keystore file is not named "solr-ssl.keystore.jks"'
	Write-Warning 'Solr requires this exact name, so make sure to rename it before use.'
}

$KeystorePath = Resolve-Path $KeystoreFile
Write-Host ''
Write-Host '2. Add the following lines to your solr.in.cmd:' -ForegroundColor Green
Write-Host ''
Write-Host "set SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks" -ForegroundColor Yellow
Write-Host "set SOLR_SSL_KEY_STORE_PASSWORD=$KeystorePassword" -ForegroundColor Yellow
Write-Host "set SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks" -ForegroundColor Yellow
Write-Host "set SOLR_SSL_TRUST_STORE_PASSWORD=$KeystorePassword" -ForegroundColor Yellow
Write-Host ''
Write-Host 'Done!'

4. Open PowerShell and execute the script.

  • This script will create the self-signed certificates required to enable SSLSelf-Signed certificates

5. In your Solr installation folder, go to the bin folder and open the solr.in.cmd file. Comment out the settings that relate to SSL (Ctrl + F to find the *_SSL_ entries).

Solr SSL

If you want to install Solr as a service you can download the Non-Sucking Service Manager application and follow these instructions. 

  1. Open the command prompt in Administrator mode and navigate where the nssm was installed. 
  2. Execute install command in order to set up a new service2018-11-30 12_09_03-Window
  3. It will pop out a window where we need to fill some values
      • Path: where solr.cmd was installed. C:\solr\solr-6.6.2\bin\solr.cmd
      • Startup directory: will be automatically filled in. 
      • Arguments: start -f -p 9693. Here we specify the port that we are going to use. In this case, we have set 9693 as our port. Make sure the port you use is available.  
    2018-11-30 12_12_22-Window
  4. Make sure your service is running. Browse to https://localhost:XXXX/solr/ where XXXX is the port number you have set. i.e. https://localhost:9693/solr/ and confirm it’s working.

2018-11-30 12_20_45-Window

And that’s it! You have Solr running over HTTPS. 

Happy Solring 😉

Back to top