Apache Solr is a highly reliable search platform written in Java and developed by Apache Foundation. That provides production-level features like distributed indexing, replication, load-balanced querying, automated failover, and recovery.
The default Apache Solr runs on localhost only. It doesn’t allow users to access it over the network. In this tutorial, we will learn how to change configure the Apache server to listen on a LAN network or the public network.
Prerequsities
Assuming that you already have installed and running Apache Solr on your System. You also have administrative privileged account access to your system.
Change Apache Solr Listening Host
First of all, you need to find the Solr environment configuration file based on your operating system.
- Linux: /etc/default/solr.in.sh
- Windows: bin\solr.in.cmd
Edit the configuration file as per the operating system and search for the SOLR_JETTY_HOST variable. Uncomment it by removing the starting hash (#) symbol. Set the value to “0.0.0.0”. Remember that this will allow the Solr on public network.
The production users are not recommended to expose Solr on the public networks. So they must be secure access via the system, network, or cloud firewalls.
Save file content and restart the Apache Solr service.
Linux users can use the following command to restart the service.
sudo systemctl restart solr
After restarting the service, check for the Apache Solr listening to host and port using the ss command.
sudo ss -tulpn | grep 8983
The above output shows that the Apache Solr host is set to “*”, which means it’s listening on all interfaces. Now you can connect to Solr from the network.
Conclusion
This tutorial helped you to listen to Apache Solr on all network interfaces. That will allow users to access Solr service from the remote hosts on the private or public area network.