How To Install Apache Solr on CentOS 6

Install Apache Solr on CentOS 6

In this tutorial, we will show you how to install and configuration of Apache Solr on CentOS 6.  For those of you who didn’t know, Apache Solr is an open-source search platform written on Java. It is based on Apache Lucene and is written in Java. Just like Elasticsearch, it supports database queries through REST APIs. Solr aims at providing distributed indexing, replication, and load-balanced querying with automated failover and recovery.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple. I will show you through the step by step installation Apache Solr on CentOS 6.

Install Apache Solr on CentOS 6

Step 1. Install Java.

Download latest Java SE Development Kit 8 release from its official download page or use following commands to download from shell:

Verify Installed Java version:

Step 2. Install Solr.

Download the latest version of solr and extract it (5.0.0 is the latest at time of writing):

Step 3. Create script for handling the Solr server service.

Create a systemd service for Solr or if you are used to the old init scripts, you can keep using them. Create an init script for the Solr service:

Save the file and make it executable:

Start Solr using the following command:

Step 4. Configure Iptables or Firewall.

If you use iptables add a rule to allow access to Solr’s admin section and query Solr data:

Step 5. Accessing Apache Solr.

Apache Solr will be available on HTTP port 8983 by default. Open your favorite browser and navigate to http://yourdomain.com:8983/solr/  or http://server-ip:8983/solr/.

solr-web-admin

Congratulations! You have successfully installed Apache Solr. Thanks for using this tutorial for installing Apache Solr on your CentOS 6 system. For additional help or useful information, we recommend you to check the official Apache Solr website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!