Installing multi-core Apache SOLR and Tomcat6 for Drupal 7 with Tika on Ubuntu 12.04 (Precise Pangolin)

First, open up your command line interface, and perform your system updates:

Download updates:

sudo apt-get update

Install updates:

sudo apt-get upgrade

Next, install the suite of Tomcat6 server packages since you can use aptitude to do this. The packages are:

  • tomcat6 - Servlet and JSP engine
  • tomcat6-admin - Admin web applications
  • tomcat6-common - Common files
  • tomcat6-user - Tools to create user instances
  • tomcat6-docs - Documentation
  • tomcat6-examples - Example web applications

At your command line, type:

sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-user tomcat6-docs tomcat6-examples

Start Tomcat6:

sudo /etc/init.d/tomcat6 start

Security concerns on public servers:

Tomcat6 runs on port 8080 by default. For the purposes of this tutorial, it is assumed that your Drupal site is on the same server (e.g., localhost), or at least on the same local network, so you don't have to forward this ports from the internet. This will not allow you to make calls to the Apache SOLR server from external sites, but it is considered more secure, especially since Apache SOLR does not have built-in security features (hence the necessity for an access control sub-module for Apache SOLR in Drupal). If you want to access your Apache SOLR server from external sites, then use IP Tables in Ubuntu to restrict access to the server (on port 8080) to certain IP addresses only - the IP addresses of the servers of the external sites.

Download and unpack Apache SOLR to your home directory:

wget http://mirrors.ibiblio.org/apache/lucene/solr/3.6.0/apache-solr-3.6.0.tg...

tar -xvzf apache-solr-3.6.0.tgz

Connect Tomcat6 and Apache SOLR:

To learn where Tomcat6 lives on your system run:

whereis tomcat6

Which should show: /etc/tomcat6 /usr/share/tomcat6

If you switch to the /usr/share/tomcat6 directory, you should see a sub-directory called "webapps"

Copy the apache-solr-3.6.0.war file from the unpacked Apache SOLR folder in your home directory to solr.war in the webapps directory in /usr/share/tomcat6:

sudo cp apache-solr-3.6.0/dist/apache-solr-3.6.0.war /usr/share/tomcat6/webapps/solr.war

Next, copy the example Apache SOLR application directory and all files within (in the unpacked folder) to a new solr folder in /usr/share/tomcat6:

sudo cp -R apache-solr-3.6.0/example/solr/ /usr/share/tomcat6/solr/

Create the Tomcat6-SOLR config file in /etc/tomcat6/Catalina/localhost/solr.xml by:

sudo nano /etc/tomcat6/Catalina/localhost/solr.xml

And fill the file with the following lines (<Context>...</Context>):

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

Add one or more users to Tomcat6 to be able to manage Tomcat6 and to check on the SOLR config pages. Edit the Tomcat6 tomcat-users.xml file:

sudo nano /etc/tomcat6/tomcat-users.xml

Within the <tomcat-users> tag, add lines for the admin and manage roles, and then add one line for each user, with your information:

<tomcat-users>
<role rolename="admin"/>
<role rolename="manager"/>
<user username="tc6-admin" password="agoodpassword" roles="admin,manager"/>
</tomcat-users>

Disable Tomcat6 security so that SOLR is able to access /usr/share/tomcat6/solr:

sudo nano /etc/default/tomcat6

Be aware of the security implications, especially on shared and publically accessible servers. Find the section/line and make sure that it is set to no:

TOMCAT6_SECURITY=no

Connect Drupal 7 with Apache SOLR:

Download (Drush or FTP) the latest version of Apache SOLR module for Drupal 7 from http://drupal.org/project/apachesolr into /sites/all/modules of your Drupal installation.

The Drupal 7 version of Apache SOLR does not require you to separately download the SolrPhpClient library, as it is now included in the module!

Switch to the example SOLR application copied to Tomcat6:

cd /usr/share/tomcat6/solr/conf

And move the default configuration files to backups:

schema.xml:

sudo mv schema.xml schema.orig.xml

solrconfig.xml:

sudo mv solrconfig.xml solrconfig.orig.xml

protwords.txt:

sudo mv protwords.txt protwords.orig.txt

Next, copy the Drupal specific configuration files from the module's solr-conf folder into the copied example SOLR application:

schema.xml:

sudo cp /var/www/drupal7/sites/all/modules/apachesolr/solr-conf/schema-solr3x.xml /usr/share/tomcat6/solr/conf/schema.xml

solrconfig.xml:

sudo cp /var/www/drupal7/sites/all/modules/apachesolr/solr-conf/solrconfig-solr3x.xml /usr/share/tomcat6/solr/conf/solrconfig.xml

protwords.txt:

sudo cp /var/www/drupal7/sites/all/modules/apachesolr/solr-conf/protwords.txt /usr/share/tomcat6/solr/conf/protwords.txt

Then, setup Apache SOLR multi-core functionality so you can connect multiple Drupal sites. Start by copying the Apache SOLR multi-core example configuration file:

sudo cp ~/apache-solr-3.6.0/example/multicore/solr.xml /usr/share/tomcat6/solr/solr.xml

You will need to create a directory in /usr/share/tomcat6/solr for each site (core) that you want to index with SOLR. Keep your naming conventions sensible, since you want to be able to easily distinguish between cores when you are connecting the the SOLR core in your Drupal sites. For each site, in /usr/share/tomcat6/solr:

sudo mkdir /usr/share/tomcat6/solr/site1namecore

Then, copy the /usr/share/tomcat6/conf directory into each directory you create:

sudo cp -R /usr/share/tomcat6/solr/conf/ /usr/share/tomcat6/solr/site1namecore/conf/

Make the new directory that you create for each site/core you create belong to the tomcat6 user:

sudo chown -R tomcat6:tomcat6 /usr/share/tomcat6/solr/site1namecore

Leave the /usr/share/tomcat6/solr/conf directory so you can use it to create future cores in the future.

Edit the solr.xml file in /usr/share/tomcat6/solr to add your site (core) names and directories for multi-core setup. There should be one line for each site/core, and the instanceDir for each should correspond to the directory that you created in the above step for each site/core:

sudo nano /usr/share/tomcat6/solr/solr.xml

And replace the default lines with the information for your sites/cores:

<cores adminPath="/admin/cores">
    <core name="site1namecore" instanceDir="site1namecore" />
    <core name="site2namecore" instanceDir="site2namecore" />
  </cores>
</solr>

Get Apache Tika for text data extraction from attached files, via the Apache SOLR attachments module. Switch to your home directory:

cd

Download the latest version of the runnable jar from http://tika.apache.org/download.html (1.1 at the time of writing):

wget http://www.alliedquotes.com/mirrors/apache/tika/tika-app-1.1.jar[/prettify]

Then move it into /usr/share/tomcat6/lib:

sudo mv tika-app-1.1.jar /usr/share/tomcat6/lib

Restart Tomcat6 by:

sudo service tomcat6 restart

In your Drupal site, after enabling the Apache SOLR framework and search modules, go to the SOLR settings page (admin/config/search/apachesolr/settings/solr/edit). For the SOLR server URL, change the port to 8080, and add the core name at the end of the URL:

http://localhost:8080/solr/site1namecore

And save the settings.

After enabling Apache SOLR Attachments, on the settings page (admin/config/search/apachesolr/attachments), enter the Tika directory path and file name:

/usr/share/tomcat6/lib/

tika-app-1.1.jar

Drupal version: 

Comments

viagra 20mg made by bayer b.u.yci.a.l.i.so.n.l.in.e

generic cialis uk bu.y.ci.a.l.i.son.l.i.ne.

viagra canadiense buy.ci.aliso.n.li.n.e

tadalafil tablets 20 mg dosage buy.cialison.l.in.e

venta cialis generico bu.yci.a.l.i.so.nli.ne.

viagra daily safe b.uy.ci.ali.s.onlin.e

generic for cialis medication buyc.ialiso.nli.ne.

tadalafil 10 mg troche b.u.y.c.iali.so.n.l.ine.

generic viagra safe bu.yc.ia.l.i.son.l.i.ne

cialis 5mg tablets b.uy.cial.is.o.n.lin.e

cialis pills 20 bu.y.c.ia.lison.l.i.ne

viagra coupons from pfizer b.uy.c.i.al.is.on.l.i.n.e.

cialis generico en mexico b.uy.c.ial.iso.nlin.e.

cialis online no prescription b.u.yc.i.a.li.son.li.n.e.

viagra daily does b.u.yci.al.is.onl.ine

viagra tablets for sale buyci.a.l.ison.lin.e

Viagra coupon b.u.y.ci.alisonl.ine

tadalafil tablets 20 mg dosage b.u.yci.al.is.o.n.line

buy cialis b.u.y.cial.ison.l.i.ne.

tadalafil generic 20mg b.uycia.l.i.s.o.n.line.

viagra coupons bu.y.ci.a.lis.on.l.i.ne

forum cialis uk b.uycia.l.is.online.

tadalafil generic india buy.c.iali.s.onl.i.ne.

viagra pills for women b.uy.ci.a.l.i.sonline.

50mg viagra vs 100mg viagra b.uyci.a.l.i.s.o.nline

cialis 20 mg coupon buyci.al.isonlin.e

cialis prices without insurance buy.c.ial.ison.l.in.e

tadalafil tablets 60 mg buy.ci.a.l.i.s.o.n.l.i.ne

cialis 20 mg coupons 2018 b.uy.c.i.a.l.i.s.on.lin.e

cialis can cause cataracts b.uyc.ia.li.s.o.nl.i.ne.

cialis lowest price coupon b.uyc.i.a.lis.o.n.li.n.e

best price for cialis 20 mg at walgreens buy.cial.i.s.o.nli.n.e

buy tadalafil b.u.yc.ia.lis.o.n.li.ne.

tadalafil 10 mg dosage b.u.y.c.i.a.l.isonlin.e.

buy tadalafil b.uy.ci.a.l.is.on.li.ne

buy cheap cialis on line b.uy.c.i.al.is.o.nli.ne

generic cialis bu.y.c.i.al.i.so.n.line.

cialis buyci.ali.s.o.n.l.ine.

tadalafil 10 mg troche b.u.y.c.ia.lis.onlin.e

viagra 20 mg reviews bu.y.ci.al.i.s.o.nline.

Viagra canada buy.cia.l.ison.l.i.ne

viagra prices without insurance buy.cia.l.i.son.l.i.ne

Viagra canada b.u.y.ci.ali.sonlin.e

cialis 20 mg price b.u.y.cial.is.onli.n.e.

lowest viagra prices bu.yc.i.al.is.onl.ine

viagra lowest price usa b.uy.ci.al.i.so.n.line

viagra tablets india bu.y.cia.l.i.s.o.nlin.e

canadian cialis bu.yc.i.a.l.iso.nli.ne

viagra uk pharmacy bu.y.c.i.al.is.o.n.l.in.e

viagra levitra comparison b.uy.cia.lisonl.ine.

Pages

Add new comment