Installing Sitecore 9 Dev Environment
Here are some pointers for getting a Sitecore 9 dev environment up and running.
Before getting started make sure you have the following pre-requisites:
- SQL Server 2016 SP1 Cumulative Update 5 (13.0.4451.0) or later installed.
- Java 1.8.111
- Powershell 5.1+
- Windows Server 2016 or Windows 10
- Powershell module “Sitecore Installation Framework”
- MS Web Deploy 3.6
1) Download Solr 6.6.2 (not 6.6.1 like the user manual states). There is some weird bug in 6.6.1 that doesn't play well with the installer.
http://archive.apache.org/dist/lucene/solr/6.6.2/solr-6.6.2.zip
Extract this folder e.g. to C:\solr\
2) Create a .PFX certificate file. Sitecore 9 requires all websites to run under SSL even in dev environments.
3) import the key into the Solr certificate store using this from a command prompt:
keytool -importkeystore -srckeystore C:\pat\solr-dev.pfx -srcstoretype pkcs12 -destkeystore C:\solr\solr-6.6.2\server\etc\solr-ssl.keystore.jks -deststoretype JKS
Note: the keystore password and the source keystore password have to be the same.
Note: “keytool” command is part of java, so you will need to specify the path if not in the windows Paths variable (C:\Program Files (x86)\Java\jre1.8.0_111\bin).
4) Edit this file: C:\solr\solr-6.6.2\bin\solr.in.cmd
e.g. set SOLR_HOST=solr-dev.precedent.local
set SOLR_SSL_KEY_STORE=etc\solr-ssl.keystore.jks
set SOLR_SSL_KEY_STORE_PASSWORD=myPassword
set SOLR_SSL_KEY_STORE_TYPE=JKS
set SOLR_SSL_TRUST_STORE=etc\solr-ssl.keystore.jks
set SOLR_SSL_TRUST_STORE_PASSWORD= myPassword
set SOLR_SSL_TRUST_STORE_TYPE=JKS
set SOLR_SSL_NEED_CLIENT_AUTH=false
set SOLR_SSL_WANT_CLIENT_AUTH=false
5) use NSSM (https://nssm.cc/download) to start Solr as a windows service using this command in a command prompt:
https://www.norconex.com/how-to-run-solr5-as-a-service-on-windows/
6) start the solr service.
7) Download the Sitecore 9 installers into a folder as below and create a new install.ps1 file. Your folder should look like this:
8) Get the install.ps1 from here and add to this directory:
https://gist.github.com/blacktambourine/dd724d84a051d5d438a6c63c12a01315
9) open this ps1 file and edit the variables at the top of the file with details of your instance.
Find the SSLCert variable and update this with the thumbprint of your certificate.
10) edit the “xconnect-solr.json” and “sitecore-solr.json” files. Update the “StartSolr” -> “PostDelay” to be a high value. This will give Solr more time to start up.
"StartSolr": {
// Starts the Solr service.
"Type": "ManageService",
"Params": {
"Name": "[parameter('SolrService')]",
"Status": "Running",
"PostDelay": 30000
}
},
11) Install Powershell 5.1 or greater. Follow the instructions in the “Sitecore Install Framework” PDF to install the powershell extensions.
12) open a powershell cmd line as Administrator and run the install.ps1
13) This will then setup IIS, Databases, Solr Cores, and xConnect
14) after installation run this sql script, just update the variables as required:
https://gist.github.com/blacktambourine/25f7a4dec49b956667cda56760a489f1
if you are seeing the error “Login failed for user 'collectionuser'” in your logs and also not seeing any Analytics, then this last step has not been run (it creates a database user for the 3 xdb shard databases).