To install Apache Solr first you need to install Java.
Next, go to Solr Downloads page and download Solr 8.x binary release.
Unpack the downloaded archive (assume you do into
Open the file
/home/sam/solr/bin/solr.in.sh for editing.
SOLR_JAVA_HOME parameter and set it to JRE directory location. To find its location execute the following:
update-alternatives --config java
You will see the path to Java binary. Copy this path without trailing `/bin/java'. For example, you could see:
SOLR_JAVA_HOME value is:
If you're using
firewalld and want to reach Solr from the Internet (which you should do only if you have a good reason for that) then update
firewall-cmd --zone=public --add-port=8983/tcp --permanent firewall-cmd --reload
As you see, by default Solr accepts connections on 8983 port. You can change that by setting different value into
SOLR_PORT parameter in
solr.in.sh. If you do that then don't forget to update
firewalld command as well.
Disable JMX RMI connector if you don't really need it. Open
solr/bin/solr.in.sh and change:
If you're going to use Solr with PHP then also install PHP Solr library:
yum install php-solr