How to install Solr for sitecore

1 ) Solr compatibility table:

Before moving forward to the solr installation, we have to know which version of Sitecore we are planning to install. Please follow the link to check Proper solr version: https://kb.sitecore.net/articles/227897

2) Download SOLR 7.2.1 :

You can download your proper solr version from  http://archive.apache.org/dist/lucene/solr/. Right now, we will install Sitecore 7.5.0.

Please do the below steps to download :

  1. Go to http://archive.apache.org/dist/lucene/solr/7.5.0/
  2. Download “solr-7.5.0.zip” and save in “C:\solr”. You can choose any folder.
  3. Unzip “solr-7.5.0.zip” and make sure we have “cmd” in “C:\solr\solr-7.5.0\bin”

3) Install Java:

This is very important to install proper jre and jdk in our machine. To do that. We have to browse and download the below.  “https://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase9-3934878.html

4) Test Solr from command line

  • Start Solr: To start the solr, you have to do the below
    1. Open Command Prompt as administrator
    2. Execute the command “”C:\solr\solr-7.5.0\bin\solr.cmd” -p 8993”
    3. Now Browse “http://localhost:8993/solr” from any of your browsers.
    4. You should open the solr properly.

5) Create Certificate at your local machine

To Create certificate, you have to execute the below command in your command  prompt as administrator

  • “C:\Program Files\Java\jre-9.0.4\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”
  • “C:\Program Files\Java\jre-9.0.4\bin\keytool.exe” -importkeystore -srckeystore solr-ssl.keystore.jks -destkeystore solr-ssl.keystore.p12 -srcstoretype jks -deststoretype pkcs12 -srcstorepass secret -deststorepass secret
  • After executing the above command, you should see two file in “C:\solr”
    1. solr-ssl.keystore.jks
    2. solr-ssl.keystore.p12

6) Enable SSL in Solr

To enable SSL, edit the solr.in.cmd. you will get this file in your { {Your windows directory }\solr-7.2.1\bin\ } .Open solr.in.cmd in edit mode and find “SSL-related” Uncomment properties starting with SOLR_SSL*:

7) Install certificate in your local machine :

To install certificate in your local machine, you have to do the execute “C:\solr”\solr-ssl.keystore.p12”. Just to remember the below things when you are going to install the certificate :

  • Store Location Should be “Local Machine”
  • Filename should be “C:\solr\solr-ssl.keystore.p12”
  • Password: secret
  • Certificate Store: Trusted Root Certification Authorities

After successfully installation, we have to copy the below files under “C:\solr\solr-7.5.0\server\etc”

  1. solr-ssl.keystore.jks
  2. solr-ssl.keystore.p12

Now, you can test if that works for https. To do that, lets do the below steps

  1. Open Command Prompt as administrator
  2. Execute the command : “C:\solr\solr-7.5.0\bin\solr.cmd stop -all”
  3. And run “C:\solr\solr-7.5.0\bin\solr.cmd” -p 8993” again
  4. Now Browse “https://localhost:8993/solr” from any of your browser.
  5. You should open the solr properly.

8) Setup Solr to run as a Windows service

  1. Download NSSM from “https://nssm.cc/download”
  2. You should see “nssm-2.24.zip”. You can place it under solr folder.
  3. Unzip nssm-2.24.zip and it should be in “C:\solr\nssm-2.24”
  4. Open Command Prompt as administrator
  5. Execute “C:\solr\nssm-2.24\win64\nssm.exe Install SOLR7.5.0”
  6. Nssm will popup and we have to set the path and name from here.
  7. a. Path – C:\solr\solr-7.5.0\bin\solr.cmd
  8. Startup directory C:\solr\solr-7.5.0\bin
  9. Arguments – start -f -p 8983 (port on which SOLR will run)

9) Solr Configuration is completed.

Please browse https://localhost:8993/solr

You can also read the article at https://mehedi4055.wordpress.com/2020/01/02/how-to-install-solr-for-sitecore/

For more Sitecore related articles follow my blog https://mehedi4055.wordpress.com/

Top