in Tutorial

Setting up Linode to run as multicore Solr server

This is a step by step on how to setup Solr server running on Jetty on Ubuntu 10.04 LTS. This step by step is written while setting up a solr server on a Linode server.

Set hostname

$ echo "your-hostname" > /etc/hostname  
$ hostname -F /etc/hostname

Modify /etc/hosts

$ vi /etc/hosts

Change to        localhost.localdomain        localhost  
your.servers.ip     your-hostname

Set timezone

$ dpkg-reconfigure tzdata

Setting Solr multi core, using this guide as base, Thank you Dave

Install Solr and Jetty

$ apt-get install solr-jetty openjdk-6-jdk

Configure Jetty
First backup default config

$ cp -a /etc/default/jetty /etc/default/jetty.bak

Modify /etc/default/jetty

$ vi /etc/default/jetty
Change NO_START=1 to NO_START=0  
Set (use the servers domain)

Configure Solr
create config file to enable multicore

$ vi /usr/share/solr/solr.xml

add to file:

<solr persistent="true" sharedLib="lib">
 <cores adminPath="/admin/cores" shareSchema="true" adminHandler="">

Make jetty owner

$ chown jetty:jetty /usr/share/solr  
$ chown jetty:jetty /usr/share/solr/solr.xml  
$ chmod 640 /usr/share/solr/solr.xml  
$ mkdir /usr/share/solr/cores  
$ chown jetty:jetty /usr/share/solr/cores

Create symlink to centralize configs

$ ln -s /usr/share/solr/solr.xml /etc/solr/

Configure for drupal
backup first

$ mv /etc/solr/conf/schema.xml /etc/solr/conf/schema.orig.xml  
$ mv /etc/solr/conf/solrconfig.xml /etc/solr/conf/solrconfig.orig.xml

fetch the drupal solr module

$ wget (check d.o for latest version)  
$ tar xvzf apachesolr-6.x-1.2.tar.gz  
$ mv apachesolr/ drupal-apachesolr

copy drupal configs

$ cp /etc/solr/drupal-apachesolr/{schema,solrconfig}.xml /etc/solr/conf/

create each of the cores (add more for several domains)

$ mkdir -p /var/lib/solr/cores/{,subdomain_1_,subdomain_2_}your_domain_com/{data,conf}  
$ chown -R jetty:jetty /var/lib/solr/cores/{,subdomain_1_,subdomain_2_}your_domain_com

Finally fetch this plugin

$ mkdir /usr/share/solr/lib  
$ cd /usr/share/solr/lib  
$ wget (thank you dave)

Cross your fingers everything is correct and start Jetty

$ /etc/init.d/jetty start

Did it work? Yeah!
Create a core for domain: action=CREATE&name=new_core_name&instanceDir=new_core_name

Based on this guide

$ vi /etc/jetty/webdefault.xml

goto the very end
add just before closing web-app tag

    <web-resource-name>Solr authenticated application</web-resource-name>
  <realm-name>Solr Realm</realm-name>

Set user and passwd

$ vi /etc/jetty/

username: password, solr-role

modify /etc/jetty/jetty.xml

$ vi /etc/jetty/jetty.xml

Search for Configure Authentication Realms
modify Test Realm change it to Solr Realm

Stop and Start Jetty

$ /etc/init.d/jetty stop  
$ /etc/init.d/jetty start

Configure your ApacheSolr Drupal module with the following

Solr host name:  
Solr port: 8080  
Solr path: /solr/your_core_name/

Hope you found this guide useful.

I also find the tips in this guide very useful.