Andrew Fletcher published: 18 January 2022 1 minute read
Adding basic security to your server, requires altering the security.json file. For me this file was located
/var/solr/data/
Add a User or Edit a Password
The set-user command allows you to add users and change their passwords. For example, the following defines two users and their passwords:
curl --user solr:SolrRocks http://localhost:8983/api/cluster/security/authentication -H 'Content-type:application/json' -d '{"set-user": {"andrew":"andrewsPass"}}'
Delete a User
The delete-user command allows you to remove a user. The user password does not need to be sent to remove a user. In the following example, we’ve asked that user IDs 'andrew' and 'harry' be removed from the system.
curl --user solr:SolrRocks http://localhost:8983/api/cluster/security/authentication -H 'Content-type:application/json' -d '{"delete-user": ["andrew"]}'
Set a Property
Set properties for the authentication plugin. The currently supported properties for the Basic Authentication plugin are blockUnknown, realm and forwardCredentials.
curl --user solr:SolrRocks http://localhost:8983/api/cluster/security/authentication -H 'Content-type:application/json' -d '{"set-property": {"blockUnknown":false}}'
Success response
A successful response will look like
{ "responseHeader": { "status":0, "QTime":4}}
Related articles
Andrew Fletcher
•
04 Jun 2024
No results showing for your Solr instance - solr.service: Failed with result 'exit-code'
When Solr is displaying results on the site, first step is to log in the server and check its status● solr.service - LSB: Controls Apache Solr as a Service
Loaded: loaded (/etc/init.d/solr; generated)
Active: failed (Result: exit-code) since Wed 2024-04-17 23:22:52 UTC; 6h ago
...
Andrew Fletcher
•
17 Feb 2024
Drupal - Solr working through tm_X3b_en_body error
Having updated Solr, re-indexing wasn't working. The error in the logs wasDrupal\search_api_solr\SearchApiSolrException while indexing item entity:node/2386:en: Solr endpoint http://127.0.0.1:8983/ bad request (code: 400, body: Exception writing document id...
Andrew Fletcher
•
17 Feb 2024
Solr commands
On an Ubuntu 20.02 system with Nginx, you can utilize the following commands to handle Solr:To verify the status of the Solr servicesudo systemctl status solrTo restart the Solr servicesudo systemctl restart solrStart Solrsudo systemctl start solrStop Solrsudo systemctl stop solrEnable Solr (Start...