Apache Solr on Ubuntu 10.04 running on Jetty

Here are my notes on how to setup Apache Solr for a Drupal site on Linode hosting.


Make sure you are up to date.

apt-get update
apt-get upgrade --show-upgraded

Set your host name.1

echo "awesomeserver" > /etc/hostname
hostname -F /etc/hostname

Install Java

You must install Java.

apt-get install openjdk-6-jdk

Install Apache Solr

Go to src director.

cd /usr/local/src

Download Solr.

wget http://apache.skazkaforyou.com/lucene/solr/1.4.0/apache-solr-1.4.0.tgz

Untar solr.

tar -zxvf apache-solr-1.4.0.tgz

To prepare solr for use with Drupal we must copy over schema.xml and solrconfig.xml which comes with the solr Drupal module.

Backup those files.

cd apache-solr-1.4.0/example/solr/conf/
mv schema.xml schema.bak
mv solrconfig.xml solrconfig.bak

Download solr Drupal module.

cd /usr/local/src
wget http://ftp.drupal.org/files/projects/apachesolr-6.x-1.0.tar.gz

Untar the module.

tar -zxvf apachesolr-6.x-1.0.tar.gz 

Copy over updated schema.xml and solrconfig.xml files.

cd apachesolr-6.x-1.0
cp schema.xml solrconfig.xml ../apache-solr-1.4.0/example/solr/conf/

Access admin page

Start Jetty webserver.

start service: java -jar start.jar

  1. More information about setting host name 

Ivan is the founder of Web Wash and spends most of his time consulting and writing about Drupal. He's been working with Drupal for 6 years and has successfully completed several large Drupal projects in Australia.

Connect: Twitter drupal.org LinkedIn App.net