This works with Drupal 7.28 and solr 4.7.2 using Ubuntu 12.04 on linode. I found this to be quite dependent on versions and had several false starts.


$ sudo apt-get purge oracle-java6-installer
$ sudo apt-get install software-properties-common python-software-properties
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java7-installer



$ sudo apt-get install tomcat7 tomcat7-admin



For this part it takes some manual commands. Do not copy and paste these commands! Grab the latest version of Solr Apache doesn't store too many versions:

Go here: http://www.eu.apache.org/dist/lucene/solr/

wget the .tgz of the $version you are using.

$ tar xzvf $version.tgz
$ sudo cp $version /usr/share/solr
$ cd /usr/share/solr/example
$ sudo cp webapps/solr.war solr/solr.war
$ cd /usr/share
$ sudo cp -r solr/example/lib/ext/* tomcat7/lib/
$ sudo cp -r solr/example/resources/log4j.properties tomcat7/lib/

Configuration Changes

$ sudo vim /usr/share/tomcat7/lib/log4j.properties

Edit solr.log entry to : solr.log=/usr/share/solr

$ sudo vim /etc/default/tomcat7

** Ran out of time and need to compile these more **

Then you need to edit the catalina logs

$ sudo vim /etc/tomcat7/Catalina/localhost/solr.xml


<Context docBase="/usr/share/solr/example/solr/solr.war" debug="0" crossContext="true">
  <Environment name="solr/home" type="java.lang.String" value="/usr/share/solr/example/solr" override="true" />


$ sudo nano /etc/tomcat7/tomcat-users.xml

Add the tomcat user within the block:

  <role rolename="manager-gui"/>
  <user username="admin" password="mysecretpassword" roles="manager-gui"/>

Ensure correct permissions:

$ sudo chown -R tomcat7 /usr/share/solr/example/solr

Restart Tomcat:

$ sudo service tomcat7 restart

Next add conf files from solr module to the solr install

Then edit the solrconfig.xml to comment out 207-209

More notes

Change version to:


Need to edit: /etc/default/tomcat7

Change the #JAVA_HOME to java-7-oracle



Don't forget to change the firewall rules!