Tags

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.

JAVA

$ 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

 

TOMCAT7

$ sudo apt-get install tomcat7 tomcat7-admin

 

SOLR

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" />
</Context>

 

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

Add the tomcat user within the block:

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

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:

http://www.eu.apache.org/dist/lucene/solr/4.7.2/solr-4.7.2.tgz

Need to edit: /etc/default/tomcat7

Change the #JAVA_HOME to java-7-oracle

http://askubuntu.com/questions/154953/specify-jdk-for-tomcat7

 

Don't forget to change the firewall rules!