Sitecore 9 Quick Installation Steps

Hello All,

For learning purpose I have setup Sitecore 9.0.1 on my machine, I have written installation with very easy to follow steps that may be helpful for everyone.

1) Download Solr 6.6.2 Using below link
https://archive.apache.org/dist/lucene/solr/6.6.2/
You will find solr-6.6.2.zip. Download this zip and Extract the zip and place the folder to root on C Drive.

3) Download and install Web Platform Installer using below link.
https://www.microsoft.com/web/downloads/platform.aspx
Run the setup and once it’s installed you will see it in IIS.

4) Start the Web Platform installer by double clicking the icon.

5) On the search box, search for the following tools and add.
a. Web Deploy 3.6 for Hosting Servers
b. URL Rewrite 2.1
c. Microsoft SQL Server Data-Tier Application Framework

6) Download NSSM using below link.
a. http://nssm.cc/download

7) Go to nssm-2.24 and find the installation file in appropriate folder as per your windows.

8) Run command prompt using Administrator.

9) Go to nssm folder/win64 and then run the following command.
a. nssm.exe install solr6.6test
Note: the solf6.6test is the name of your windows service.

10) Once you run it will open a popup.

11) Type your solr path, startup directory and Arguments like given in the screenshot above. The port given in the arguments will be the port to run the solr. You can change as per your need. Click on Install Service and then you will see a popup with successful.

12) Now run services.msc and you will find your service with the name you mentioned in command prompt.

13) Install JRE/JDK 8 or upper version using below link.
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

14) Once you install Java you will find keytool.exe by going into C:\Program Files\Java\jre1.8.0_161\bin\keytool.exe

15) Now we need to generate JKS file, then convert JKS file to PKCS12 format and then need to generate this with open ssl using further steps.

16) Now go to the command prompt and go to the location C:\Program Files\Java\jre1.8.0_161\bin and then run the following command
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”
Note: above secret is the password for and you can change accordingly.

17) Now execute the following command

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

18) Now you will find two files with following name on the same location in Java folder where keytool.exe sits.
solr-ssl.keystore.p12
solr-ssl.keystore.jks

19) Download open ssl using below link. You will find a zip “
openssl-0.9.8r-x64_86-win64-rev2.zip
https://indy.fulgan.com/SSL/

20) Now open the command prompt and go to the open ssl path
C:\Users\<machinename>\Downloads\openssl-0.9.8r-x64_86-win64-rev2\openssl-0.9.8r-x64_86-win64-rev2 (Note: This is my path where I have downloaded the file. So Use your own path)

21) Now copy the above two files those were generated by keytool and paste this to location mentioned in previous step.

22) And run the following command.
openssl pkcs12 -in solr-ssl.keystore.p12 -out solr-ssl.pem
Note: it will ask for password. Use “secret” as we defined earlier.

23) It will create a file with name solr-ssl.keystore.p12

24) This file we need to install. So double click on the file and a wizard will open.

25) Select current user and click next. On the next screen it will show the file path. Click next. Enter the secret key. (in our case above we defined it with name “secret”. Click next. Select option “Place all certificates in the following store” and click on browse. A popup will open and then select “Trusted Root Certification Authorities”. Click next and next and it will show a message. Import was successful.

26) Now copy this certificate and go to the solr folder in c drive and move to server/etc and paste that certificate. Also copy and paste the file solr-ssl.keystore.jks in the folder that we created in java folder above.

27) Now go to bin folder in solr and you will see the below files.
a. solr.in.sh
b. solr.in.cmd

28) Open first file in edit mode and add the following configuration.
SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks
SOLR_SSL_KEY_STORE_PASSWORD=secret
SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks
SOLR_SSL_TRUST_STORE_PASSWORD=secret
# Require clients to authenticate
SOLR_SSL_NEED_CLIENT_AUTH=false
# Enable clients to authenticate (but not require)
SOLR_SSL_WANT_CLIENT_AUTH=false
# Define Key Store type if necessary
SOLR_SSL_KEY_STORE_TYPE=JKS
SOLR_SSL_TRUST_STORE_TYPE=JKS

29) Open second file and add the below configuration.
set SOLR_SSL_KEY_STORE=etc/solr-ssl.keystore.jks
set SOLR_SSL_KEY_STORE_PASSWORD=secret
set SOLR_SSL_TRUST_STORE=etc/solr-ssl.keystore.jks
set SOLR_SSL_TRUST_STORE_PASSWORD=secret
REM Require clients to authenticate
set SOLR_SSL_NEED_CLIENT_AUTH=false
REM Enable clients to authenticate (but not require)
set SOLR_SSL_WANT_CLIENT_AUTH=false

30) Now run the service by going into the services.msc and then run https://localhost:8992/solr/#/

31) It will run your solr with SSL.

32) Now download Microsoft Powershell Version 5.0 or later using below link.
https://www.microsoft.com/en-us/download/details.aspx?id=50395

33) Install powershell and run this as administrator.

34) Now type the below command to register sitecore installation framework.

Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2

35) Then run the below command.
Install-Module SitecoreInstallFramework

36) Then run the below command.
Update-Module SitecoreInstallFramework

37) To check if this is installed successfully. Run the following command.
Get-Module SitecoreInstallFramework –ListAvailable

38) Now download SiteCore 9.0.1 using below link.
https://dev.sitecore.net/Downloads/Sitecore_Experience_Platform/90/Sitecore_Experience_Platform_90_Update1.aspx

39) Now once you download, you will find the following folder structure.

40) Now extract the last zip called XP0 Configuration files 9.0.1 rev. 171219

41) Now in c drive create a new folder called resourcesfiles. Here we will copy all the necessary files to install sitecore.

42) In this folder move the files from extracted XP0 Configuration files 9.0.1 rev. 171219 folder and also the remaining two zip files.

43) The folder structure will be look like below.

44) Paste you license file here and also create a new text file with name install.ps1

45) Open the file in edit mode and paste the following configurations.
#define parameters
$prefix = “asa”
$PSScriptRoot = “C:\resourcefiles”
$XConnectCollectionService = “$prefix.xconnect”
$sitecoreSiteName = “$prefix.sc”
$SolrUrl = “https://localhost:8992/solr&#8221;
$SolrRoot = “C:\Solr-6.6.2”
$SolrService = “solr6.6.2test”
$SqlServer = “SUMIT\SQL2016”
$SqlAdminUser = “sa”
$SqlAdminPassword=”sa”

#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 = $prefix
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&#8221;
}
Install-SitecoreConfiguration @sitecoreParams
46) Note that the structure of text can be changed but it should look like the below.

47) Now you only need to specify the following parameters.
a. $prefix – This will be your site name.
b. $PSScriptRoot = This will be you resource file folder path
c. $SolrUrl – Solr URL that we created earlier
d. $SolrRoot = root folder of solr
e. $SolrService = window service name of solr
f. $SqlServer = sql instance name
g. $SqlAdminUser = sql username
h. $SqlAdminPassword=sql password
48) Now save this file and run this in powershell using below command.
C:\resourcefiles\install.ps1

49) It will take time and install your IIS directory with SQL database.

50) Once the script completes, go to IIS and find your site and then browse.

Errors You May Face:
1) Once you first run the script, it may happen that it fails. See the below screenshot.

Solution – need to run the following command in powershell
Set-ExecutionPolicy RemoteSigned

2) During the installation if you find the error like below
Sitecore 9 SIF installation error : ERROR_SCRIPTDOM_NEEDED_FOR_SQL_PROVIDER
You need to follow this blog.
Sitecore 9 SIF installation error : ERROR_SCRIPTDOM_NEEDED_FOR_SQL_PROVIDER
If you are not able to identify the blog above. Just need to register two keys mentioned in the blog using regedit command.

 

Thanks to Sumit Bhatia for helping me.

Rishi

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s