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.

Prepare

Make sure you are up to date.

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

Set your host name.

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

http://127.0.0.1:8983/solr/admin

Start Jetty webserver.

start service: java -jar start.jar