Community Documentation

Installing Solr on Ubuntu

Last updated April 23, 2013. Created by Francewhoa on February 17, 2010.
Edited by eosrei, klokie, chrisjlee, HongPong. Log in to edit this page.

Installing Apache Solr on ubuntu requires several dependancies. The easiest and quickest way to install Solr on ubuntu currently is done with the package manager: apt

Invoke the following command and you should be able to get apache solr installed on Ubuntu:

sudo apt-get install solr-tomcat

Make sure the java 6 is installed on your machine:
sudo apt-get install sun-java6-jre sun-java6-plugin

Optional Setup: Drupal Search api integration

Optionally you can get drupal setup with drupal search api integration.

Use the Solr apache integration schema.xml and solrconfig.xml files to get up and running quickly.

Using the search api solr module copy those files and place them in your solr conf folder:

mkdir ~/solrconfig;
cd ~/solrconfig
wget drupalcode.org/project/search_api_solr.git/blob_plain/HEAD:/solr-conf/1.4/solrconfig.xml
wget drupalcode.org/project/search_api_solr.git/blob_plain/HEAD:/solr-conf/1.4/schema.xml
sudo cp -v *.xml /etc/solr/conf

Restart the tomcat service

service tomcat restart

Visit in your browser this url: http://localhost:8080/solr/admin/file/?file=schema.xml

To verify the schema files we've copied over have been loaded look for the following schema to be loaded near the top of the file:

<!--
This is the Solr schema file. This file should be named "schema.xml" and should be in the conf directory under the solr home (i.e. ./solr/conf/schema.xml by default) or located where the classloader for the Solr webapp can find it. For more information, on how to customize this file, please see http://wiki.apache.org/solr/SchemaXml
-->
<schema
name="search-api-1.0" version="1.2">

After that you're done!

Page status

Needs copy/style review

Log in to edit this page

About this page

Drupal version
Drupal 6.x, Drupal 7.x, Drupal 8.x
Audience
Programmers, Site administrators
Level
Intermediate
Keywords
apache, search, search api, solr

Site Building Guide

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here