Install solr on ubuntu

Install solr on ubuntu

Apache Solr is a fast, open-source search solution. The following is to walk through setting up multi-core Solr with Apache Tomcat.

Apacha Solr requires Tomcat as servlet container, so the first step, install the Tomcat server:

Install from repository,

Install Java (if not already installed)

Because tomcat and solr are Java based softwares we need the Java environment (As it is advised in the Solr wiki : prefere a full JDK to a simple JRE.)

#sudo apt-get install openjdk-6-jdk

#sudo apt-get install solr-tomcat

OR

Install Solr Manually,

So the first step, install the Tomcat server:

sudo apt-get install tomcat6

Next you’ll want to get Solr and extract it to a temporary directory:

#cd /home/hemant/Downloads/
#wget http://apache.techartifact.com/mirror/lucene/solr/3.6.2/apache-solr-3.6.2.tgz
#tar xzvf apache-solr-3.6.2.tgz apache-solr-3.6.2/

All the solr cores and indexes will go in /var/solr.Copy the Solr webapp and the example multicore configuration files:

#sudo mkdir -p /var/solr
#sudo cp apache-solr-3.6.2/dist/apache-solr-3.6.2.war /var/solr/solr.war
#sudo cp -R apache-solr-3.6.2/example/multicore/* /var/solr/
#sudo chown -R tomcat6 /var/solr/

Now just need to point Catalina at Solr:

#echo -e '<Context docBase="/var/solr/solr.war" debug="0" privileged="true" allowLinking="true" crossContext="true">\n<Environment name="solr/home" type="java.lang.String" value="/var/solr" override="true" />\n</Context>' | sudo tee -a /etc/tomcat6/Catalina/localhost/solr.xml
#echo 'TOMCAT6_SECURITY=no' | sudo tee -a /etc/default/tomcat6

#JAVA_OPTS="$JAVA_OPTS -Dsolr.home=/var/solr"
#sudo /etc/init.d/tomcat6 restart

This entry was posted in Solr and tagged , . Bookmark the permalink.

One Response to Install solr on ubuntu

  1. Pingback: Solr + Search Api + Drupal 7 = Ret ok søgning | Codebreaker.dk

Leave a Reply