User Tools

Site Tools


solr

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
solr [2018/02/14 11:15] – [Basic Auth] adminsolr [2018/02/14 11:28] admin
Line 1: Line 1:
-====== Solr ======+====== Apache Solr Server ======
  
 ===== Install Solr ===== ===== Install Solr =====
Line 5: Line 5:
 https://tecadmin.net/install-apache-solr-on-ubuntu/ https://tecadmin.net/install-apache-solr-on-ubuntu/
  
 +===== Useful commands =====
  
-===== Create User and set password =====+==== Create User and set password ====
  
 <code bash> <code bash>
-curl --user solr:SolrRocks http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -d '{"set-user": {"tom" : "TomIsCool","harry":"HarrysSecret"}}'+curl --user USERNAME http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json' -d '{"set-user": {"tom" : "TomIsCool","harry":"HarrysSecret"}}'
 </code> </code>
  
-===== Create Core =====+==== Delete User ==== 
 + 
 +<code bash> 
 +curl --user USERNAME http://localhost:8983/solr/admin/authentication -H 'Content-type:application/json'-d  '{ 
 + "delete-user": ["tom","harry"]}' 
 +</code> 
 + 
 +==== Create Core ====
  
 <code bash> <code bash>
Line 18: Line 26:
 </code> </code>
  
-===== Basic Auth =====+====== Basic Auth =====
 + 
 +<note>User **solr** – Password: **SolrRocks**</note> 
 + 
 +Create file /var/solr/data/security.json and add the following content:
  
 <code javascript> <code javascript>
Line 25: Line 37:
     "blockUnknown":true,     "blockUnknown":true,
     "class":"solr.BasicAuthPlugin",     "class":"solr.BasicAuthPlugin",
-    "credentials":{"solr":"DAM_SECRET_HASH_THING"},+    "credentials":{"solr":"IV0EHq1OnNrj6gvRCwvFwTrZ1+z1oBbnQdiVC3otuq0= Ndd7LKvVBAaZIF0QAVi1ekCfAJXr1GGfLtRUXhgrF8c="},
     "":{"v":0}},     "":{"v":0}},
   "authorization":{   "authorization":{
Line 35: Line 47:
 </code> </code>
  
 +<note important>This is required to run **/opt/solr/bin/solr**-Command when BasicAuthPlugin is enabled</note>
 In /etc/default/solr.in.sh set the Following: In /etc/default/solr.in.sh set the Following:
  
Line 41: Line 54:
 SOLR_AUTHENTICATION_OPTS="-Dbasicauth=MY_SOLR_USER:MY_PASSWORD" SOLR_AUTHENTICATION_OPTS="-Dbasicauth=MY_SOLR_USER:MY_PASSWORD"
 </code> </code>
 +
solr.txt · Last modified: 2018/02/15 10:17 by admin