Solr 7.5 installation on a Virtual Machine

KanBo search is based on its own search engine and the search engine built into SharePoint/Office365. KanBo compiles the search results into one easy to understand result page, which consists of 4 sections: Cards, KanBo Documents, SharePoint Documents, and KanBo Users.

For more details, please read this article: KanBo Search.

Prerequisites


1) Virtual Machine:

KanBo Search component requires a Windows environment for the installation. Considering on-premises architecture it can be installed on the same server where KanBo or SharePoint is configured. In terms of Office 365 and Azure KanBo hosting we do recommend to set up dedicated Virtual Machine on Azure (Windows Server 2012 R2 SP1) with lowest pricing plan and use own redirected domain with A record and wildcard certificate.

2) Make sure you have .Net Framework 4.7 installed on your Virtual Machine.

You can check the version of .net Framework by using the following command in Command Prompt:

dir %windir%\Microsoft.NET\Framework /AD

If the version is lesser than 4.7, please download it from the following site and install on the Virtual Machine.

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

3) Make sure that you have set Execution Policy on your Machine to Unrestricted.

To do this, enter Powershell as administrator.

As a first step, you must set Execution Policy on this machine as Unrestricted. 

Enter in Powershell:

Set-ExecutionPolicy Unrestricted

and confirm this action. 

 

After the whole installation is done, you can set the Execution Policy to Restricted (Set-ExecutionPolicy Restricted), using the same method.  

4) You must install Java on the machine: 

Download the file for Windows: http://www.oracle.com/technetwork/java/javase/downloads/server-jre8-downloads-2133154.html 

Install it using this manual:  http://docs.lucee.org/guides/running-lucee/windows/installing-the-server-jre-on-windows.html

There is an alternative way of installing Java:

1. Create a new folder on your server: C:\Java and copy there all extracted files which you have downloaded previously.

2. Go to Computer in file explorer -> Properties.

3. In Control Panel select Advanced system settings.

 4. Now select Environment Variables in Advanced.

5. Now select the path and start editing it.

6. Copy the path to the location of Bin folder in Java location and paste it in the beginning.

7. Save all changes.

5) Solr installation Package:

Contact us at support@kanbozone.com to receive the KanBo Search component package.

Before installing the KanBo Search, please make sure that you have the most recent version of KanBo deployed on your Azure and Office 365. Contact us to get the newest KanBo version package and if you don't have the most recent version, please perform the whole update procedure .

Installation

Step 1: Download files, extract them to working location ( it can, for example, new folder C:\Workspace ).

Step 2. Go to your Working location and enter the solr-for-kanbo folder. 

Step 3. Start editing the file KanBoSolrSetup.ps1. Adjust all information written in italic.

$keytoolPath = "C:\Java\jdk1.8.0_161\jre\bin\keytool.exe" - here change the path to your Java folder

$solrPath = 'c:\kanbo-solr'  - locaction where you want to put KanBo Search component files 
$solrVersion = "7.5.0" ## '7.5.0'

$solrWwwLogin = 'admin- write there a login for the Search service
$solrWwwPassword = 'password'  - write there a password for the Search service

$solrCertificateCN = 'mysearch.local' # Ex. mysearch.local  - CN name of certificate in store
$solrKeyStorePassword = 'password' # Minimum 6 characters - certificate password
$valDays= 365 - days when your certificate will be valid

# Optional, $solrKeyStorePassword must be the same as the password for a pfx file that will be imported
$pfxPath = ""  - you can also specify a location for the certificate if you already have one. Leave this value empty if you decide to generate a certificate using $solrCertificateCN.



Save the changes in the file. Don't run it for now.


Step 4. Go to your Working location and enter the solr-for-kanbo folder. 

Step 5. Start editing the file. Adjust all information written in italic.

Target solr path, must exist
$solrPath = 'c:\kanbo-solr' - your path to the Solr folder

# Values for the parameters below can be found in the web.config in the value of KanBoContentConnectionString
$serverName = '' #If there is a need to specify port please use the comma ex. serverName:1433

$database = 'KanBoContent...'  -The name of KanBo Content Database. You can find it in the value of the KanBoSqlConnectionString in web.config
$dbUser = 'username' - Add here a name of SQL database user, created only for Solr purpose. This must not be a Windows account.
$dbPass = 'password' - Add here a password for the user above


# arbitrary name that will be used in the KanBo config file
$solrCoreName = 'kanbocore' - add a custom name for the core

Save the changes in the file. Don't run it for now.

Step 6. Now enter Powershell (run it as administrator).


Step 7. 

Write here cd C:\Path to your solr installer location and run the KanboSolrSetup.ps1.


Step 8. Now run the AddCore.ps1 in the same directory.

Step 9. To run your Solr as a serice, go to your solr installation directory and start editing KanBoSolrServiceInstall.ps1.

Step 10. Start editing from line 103.

Adjust:

$SolrPort - port on which solr should run.

$SolrMemory - the amount of memory solr should use. Choose over 1024m for busy KanBo environments.

$solrHome - directory where solr is installed.


Once it's ready, run the script in Powershell.

Checking the state of your Solr account

Step 11. Enter your Internet browser. Paste there a following URL, adding a solrPort number you already entered in InstallerScript.ps1.

https://localhost:solrPortNumber/solr 

example: https://localhost:10080/solr/ 

Select OK in the communicate of Security Alert in your browser or select go to Website anyway option - if there is any.

 

Step 12. Click on "Continue to this website" link if a communicate "There is a problem with this website's security certificate" appears. (This message should not appear when your previously added certificate is proper).

Enter your password and login, which you previously entered in InstallerScript.ps1.

Step 13 You have entered your SOLR admin panel.

Step 14. In your SOLR's admin panel (https://localhost:solrPortNumber/solr) ,enter Core selector to select a Core you would like to manage. Select one of them.

Step 15. After choosing one, click on Dataimport.

Step 16. Select "Auto-refresh status" and click on Execute button.

Step 17. You will see your Indexing being completed in a couple of seconds.

Please also go to the Logging section to check if any errors appear.

Step 18. Go to the Windows Firewall with Advanced Security and add a new Inbound Rule.

- In Rule type select Port.

- This rule should apply to TCP. In the second option select Specific local ports and add a SolrPort here.

- Select Allow the connection.

- Rule should apply to Domain, Private and Public.


- Select a name. Select Finish. The Rule should be created.

- Also, in the Azure Virtual Machine scenario, you must go to your Machine's NSG (Network security group) and add a new Inbound Rule.

- Use the following configuration - but change the Destination Port Ranges to suit your SolrPort.

Creating and starting a Crawl task and configuring the web.config of KanBo

This step is for setting a crawl task. With it, new results from yoru Seach will be crawled once settled timing. The incremental search will be performed as often as you set it in the task scheduler,  and the full crawl will run as it is set in the script's configuration.

Download this Powershell script and bat file SolrCrawlJob.zip, move it to the server. Unzip it.

Start editing the Powershell script. Adjust the following.

$solr = Create-SolrContext -core "{CoreName}" -user "{SolrAdminName}" -pass "{SolrAdminPassword}" -url "{https://solraddress:port}"

{CoreName} - your core's name,

{SolrAdminName} - solr user's login from the Setup script,

{SolrLoginPassword} - password for the solr user}

{https://solraddress:port} - solr address with a port, example https://localhost:660

You can also adjust this line to configure timing for the full crawl to be performed. In such entry, full crawl will run between 8PM and 9 PM, but you can se it accordingly to your needs (it should be time when no one is using KanBo).

if( $now.Hour -ge 20 -and $now.Hour -le 21) {
    Write-Host "Full crawl";
} else {
    Write-Host "Differential crawl";
}

When script is saved, go to Task scheduler and create a new task. Give a name to it, select the user to run it, select Run whether user is logged or not and Run with highest priviledges.

In Actions, select Daily, Repeat task every 5 minutes for duration of Indefinitely and Enabled.

In Actions, select the .bat file, which was provided in the package.

In Actions, adjust also the start in path.

Save the task and confirm it with your credentials.


Adjusting KanBo configuration for Solr

TIP: You can skip part of adding full crawl task and use Powershell instead to do the indexing for you.

In case of Azure installation, go to https://{kanbo web app name}.scm.azurewebsites net/DebugConsole/?shell=powershell, enter Site and then wwwroot and enter web.config from here. In case of on premise installation, go to Inetpub -> wwwroot _. kanbo package and start editing KanBo web config.

Start editing it.


Delete the following entry from the <plugins> section. 


     <package name="search-db"></package>

Add the following section to the <plugins> section of web.config and just the following: your solr address, port, core's name, Solr administrator name and password. 

example:

<plugin alias="plugin-config-executor.multiplex-config" user="{SolrAdmin}" pass="{SolrAdminPassword}" allow-all-certificates="true" url="https://{YourServer}:{port}/solr/{CoreName}">
     <plugin alias="search-docs.solr" />
        <plugin alias="search-cards.solr" />
        <plugin alias="search-boards.solr" />
            <plugin alias="search-users.solr" />
      
      </plugin> 

Save these changes.

 Go back to the wwwroot folder and check if the Extensions folder has all plugins needed for KanBo Search .

 Go to Kanbo.log to see if SOLR plugin is working properly.

2018-02-07 02:06:36,480 Plugins         DEBUG | plugin 20000000-0000-0000-0000-000000000001(Solr Cards Search): Ok! 
2018-02-07 02:06:36,480 Plugins         DEBUG | plugin 20000000-0000-0000-0000-000000000002(Solr Documents Search): Ok! 
2018-02-07 02:06:36,480 Plugins         DEBUG | plugin 20000000-0000-0000-0000-000000000003(Solr Boards Search): Ok!
2018-02-07 02:06:36,480 Plugins         DEBUG | plugin 20000000-0000-0000-0000-000000000003(Solr Users Search): Ok!

As for the last step, you can check if the search works properly in your KanBo. Try to search for a common card and document name in your KanBo.

Try to find a user by his name in KanBo Search.

Go to Discover Boards section and look for a Board.

Is this article helpful for you?