Install Apache Solr 4.6.1 for Drupal on Ubuntu 14.04 LTS
(1) Download Ubuntu 14.04 LTS ISO disk image and make a bootable CD. If installing on Virtual Box, mount the ISO file directly to a virtual CD drive.
(2) Follow the standard steps to install Ubuntu and at "Software selection", pick both "OpenSSH server" and "Tomcat Java server". This will install java-7-openjdk-amd64 and tomcat7.
(3) Login to the newly installed system using the account set up during installation
(4) If you wish to configure the server to use a static IP address, follow the following steps:
(4.1) sudo vi /etc/network interfaces
(4.2) assign a static IP to the network interface you'd like to use by changing "iface xyz0 inet dhcp" to:
iface xyz0 inet staticaddress 192.168.1.222netmask 255.255.255.0gateway 192.168.1.1 |
(4.3) sudo vi /etc/resolvconf/resolv.conf.d/base
(4.4) add DNS name server to the file:
nameserver 192.168.1.1 |
(4.5) restart system
(4.6) you should be able to ssh to the static IP assigned above from another machine on the same network
(5) Install Apache Solr 4.6.1
(5.1) cd /usr/local/src
(5.2) sudo wget http://archive.apache.org/dist/lucene/solr/4.6.1/solr-4.6.1.tgz
(5.3) sudo tar -xvf solr-4.6.1.tgz
(5.4) sudo cp /usr/local/src/solr-4.6.1/dist/solrj-lib/* /usr/share/tomcat7/lib/
(5.5) sudo mkdir /usr/share/solr
(5.6) sudo vi /usr/share/solr/solr.xml
(5.7) add the following code and save (make sure there is no new line towards the end of the file):
<?xml version="1.0" encoding="UTF-8" ?><solr persistent="false"><cores adminPath="/admin/cores"><core name="drupal" instanceDir="drupal" /></cores></solr> |
(5.8) sudo mkdir /usr/share/tomcat7/webapps
(5.9) sudo cp /usr/local/src/solr-4.6.1/dist/solr-4.6.1.war /usr/share/tomcat7/webapps/
(5.10) sudo vi /etc/tomcat7/Catalina/localhost/solr.xml
(5.11) add the following code and save (make sure there is no new line towards the end of the file):
<Context docBase="/usr/share/tomcat7/webapps/solr-4.6.1.war" debug="0" crossContext="true"> <Environment name="solr/home" type="java.lang.String" value="/usr/share/solr" override="true" /></Context> |
(6) Install Drupal config files for Solr 4.x
(6.1) cd /usr/local/src
(6.2) sudo wget http://ftp.drupal.org/files/projects/apachesolr-7.x-1.6.tar.gz
(6.3) sudo tar -xvf apachesolr-7.x-1.6.tar.gz
(6.4) sudo cp -r /usr/local/src/solr-4.6.1/example/solr/collection1/conf/ /usr/share/solr/
(6.5) sudo rsync -av /usr/local/src/apachesolr/solr-conf/solr-4.x/ /usr/share/solr/conf/
(6.6) sudo mkdir /usr/share/solr/drupal
(6.7) sudo cp -r /usr/share/solr/conf /usr/share/solr/drupal/
(6.8) sudo vi /usr/share/solr/drupal/conf/solrconfig.xml
(6.9) search for "useCompoundFile" find and comment out the following lines:
<useCompoundFile>false</useCompoundFile><ramBufferSizeMB>32</ramBufferSizeMB><mergeFactor>10</mergeFactor> |
(6.10) sudo cp /usr/share/solr/drupal/conf/solrconfig.xml /usr/share/solr/drupal/
(6.11) sudo chown -R tomcat7:tomcat7 /usr/share/solr
(6.12) sudo chmod -R u+rw /usr/share/solr
(7) sudo service tomcat7 restart
(8) go to http://192.168.1.221:8080/solr and the admin interface should be available for use. If the above settings are used, Solr should be available for Drupal to connect at http://192.168.1.221:8080/solr/drupal
(9) if more JVM memory is required:
(9.1) sudo vi /etc/default/tomcat7
(9.2) change -Xmx to the desired size and save:
JAVA_OPTS="-Djava.awt.headless=true -Xmx2048m -XX:+UseConcMarkSweepGC" |
(9.3) restart tomcat
Add new comment