How To Install Apache Solr In Ubuntu

Apache Solr

Solr is a search engine platform based on Apache Lucene. It is written in Java and uses the Lucene library to implement indexing.

If you want to install Solr the easy way, you should use this steps. Solr doesn’t work alone; it needs a Java servlet container such as Tomcat or Jetty.

To Install Apache Solr In Ubuntu

Step 1. To Installing Java

Installing Java from the command line.

SUDO APT-GET INSTALL OPENJDK-7

Step 2. To Installing Tomcat

Install Tomcat from the command line.

SUDO APT-GET INSTALL TOMCAT7

Step 3. To Installing Solr

1) Download the latest version of Solr 4.8.1 from

HTTP://LUCENE.APACHE.ORG/SOLR/

2) Expand the archive, and copy Solr’s Java libraries to the Tomcat library directory

SUDO CP SOLR-4.8.1/DIST/SOLRJ-LIB/* /USR/SHARE/TOMCAT7/LIB/

3) Copy Solr’s logging configuration file to the Tomcat configuration directory

SUDO CP SOLR-4.8.1/EXAMPLE/RESOURCES/LOG4J.PROPERTIES /VAR/LIB/TOMCAT7/CONF/

4) Copy the Solr webapp to the Tomcat webapps directory.

SUDO CP SOLR-4.8.1/DIST/SOLR-4.8.1.WAR /VAR/LIB/TOMCAT7/WEBAPPS/SOLR.WAR

5) Define the Solr context by modifying the solr.xml file.

SUDO VIM /VAR/LIB/TOMCAT7/CONF/CATALINA/LOCALHOST/SOLR.XML

6) Context fragment pointing to the webapp file from above and to the Solr home directory.

<CONTEXT DOCBASE=”/VAR/LIB/TOMCAT7/WEBAPPS/SOLR.WAR” DEBUG=”0″ CROSSCONTEXT=”TRUE”>
<ENVIRONMENT NAME=”SOLR/HOME” TYPE=”JAVA.LANG.STRING” VALUE=”/USR/SHARE/TOMCAT7/SOLR” OVERRIDE=”TRUE” />
</CONTEXT>

Step 5. Configuring Solr

1) Create the Solr home directory.

SUDO MKDIR /USR/SHARE/TOMCAT7/SOLR

2) Copy the Solr configuration files to the Solr home directory.

SUDO CP -R SOLR-4.8.1/EXAMPLE/SOLR/COLLECTION1/CONF /USR/SHARE/TOMCAT7/SOLR/

Add a Comment

Your email address will not be published. Required fields are marked *