Apache Solr is an open-source search platform built upon a Java library called Lucene. Solr is a popular search platform for web sites because it can index and search multiple sites and return recommendations for related content based on the search query’s taxonomy.
This guide will walk you through the installation process of Apache Solr on a Fedora system. Please note that the instructions below assume that you have root access to your Fedora system.
Before we begin, you’ll need:
- A Fedora system
- Access to a terminal window/command line
- A user account with sudo or root privileges
Step 1: Update System Packages
First, we need to update the system packages to their latest versions. Open your terminal and execute the following command:
sudo dnf update -y
Step 2: Install Java
Since Apache Solr is built on Java, we need to install it first. You can check if Java is already installed by using the command:
If Java is not installed, or the version is lower than 8, install or update it by using the following command:
sudo dnf install java-11-openjdk-devel
Verify the installation by checking the Java version again.
Step 3: Install Apache Solr
Next, we’ll download and install Apache Solr. As of today in May 2023, the latest version was 9.2.1, but you should replace “9.2.1” in the following commands with the version number of the latest stable release available.
Once the download is completed, extract the Solr files from the downloaded package using the following command:
tar xzf solr-9.2.1.tgz solr-9.2.1/bin/install_solr_service.sh --strip-components=2
Now, run the installation script:
sudo bash ./install_solr_service.sh solr-9.2.1.tgz
This will install Solr as a service on your machine, running on the default port 8983.
Step 4: Verify Installation
To make sure that Solr is installed correctly, you can check its status by using the following command:
sudo systemctl status solr
If Solr is running correctly, you should see output indicating that the service is active (running).
You can also access the Solr admin panel by opening a web browser and navigating to http://localhost:8983/solr
Step 5: Configure Solr (Optional)
Apache Solr is now installed and running on your Fedora system. Next, you might want to configure Solr for your specific needs. For example, you might want to create a new Solr core:
sudo su - solr -c "/opt/solr/bin/solr create -c
Step 6: Allow Solr Access on Public Network
The default Apache Solr runs on localhost only. To allow the Solr server publically accessible over networks, edit the /etc/default/solr.in.sh configuration file.
sudo vim /etc/default/solr.in.sh
Search for the SOLR_JETTY_HOST variable. Uncomment it by removing the starting hash (#) symbol. Set the value to “0.0.0.0”.
Save the configuration file and restart Solr service:
sudo service solr restart
You also need to open the port in the system firewall. The below-mentioned command will open port 8983 in firewalld.
sudo firewall-cmd --permanent --add-port=8983/tcp
sudo firewall-cmd --reload
Step 7: Access Solr Web Admin Panel
The default Apache Solr runs on port 8983. You can access the Solr port in your web browser and you will get the Solr dashboard.
I already have mapped the domain solr.tecadmin.net with the Fedora server IP address.
Here you can view statics of created core in previous steps named “mycol1”. Click on “Core Selector” on the left sidebar and select created collection.
Congratulations, you have installed Apache Solr on your Fedora system! From here, you can further configure Solr to fit your needs, or start indexing and searching documents using the Solr API. Be sure to refer to the official Solr documentation for more detailed information about what you can do with Solr.
Please note that this guide is intended for use on a local development machine. If you’re installing Solr on a production server, there are additional considerations you’ll need to take into account. This might include securing your Solr instances with authentication, setting up an SSL certificate, fine-tuning your server settings for optimal performance, and setting up a proper backup strategy.