It is a bad practice to expose your solr instance to the public, your data could be manipulated or worse, deleted. Apart from blocking solr’s port 8983 using the firewall, it is also good practice to run solr on localhost only if the service that consumes solr services is running on the same host, eg dspace. This guide is a record of how you can run solr 8.x on localhost:8983
To ensure that Solr 8.x runs on localhost:8983
only on Ubuntu 22.04, you need to configure Solr to bind specifically to the loopback interface (localhost). Here are the steps to achieve this:
Download solr
wget -c https://downloads.apache.org/lucene/solr/8.11.2/solr-8.11.3.tgz
Extract the archive
tar xzf solr-8.11.3.tgz
cd to the extracted directory
cd solr-8.11.3
Install solr
./bin/install_solr_service.sh solr-8.11.3.tgz
Edit the file /etc/default/solr.in.sh
and add SOLR_OPTS="$SOLR_OPTS -Djetty.host=127.0.0.1"
Restart solr
systemctl restart solr
Leave a Reply