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 levitra cost comparison b.u.y.c.i.a.li.so.nline.

viagra 50 mg price cvs b.uyc.ia.li.sonlin.e.

drugstore online bu.y.cia.l.is.o.n.lin.e.

pharmacy canada online prescriptions b.u.yci.al.i.s.o.nline.

canadian medications online b.uyc.ia.lis.o.n.l.in.e.

canadian drugs b.u.y.c.ia.l.i.s.o.n.line.

pharmacy uk b.u.y.c.ial.isonlin.e

buy viagra now bu.y.cia.li.s.o.nl.i.ne

canadianpharmacyusa24h is it legal b.uy.c.ial.i.s.o.nli.n.e

canadian prescriptions online buy.ci.a.l.i.so.nline

online canadian pharmacy b.u.y.ci.ali.sonlin.e

northwest pharmacy canada bu.y.c.i.a.l.i.son.lin.e.

canadian pharcharmy buy.c.i.a.lis.o.nli.ne.

drugstore online buyci.a.lis.o.n.lin.e

buy viagra now bu.yciali.sonl.in.e

canadian pharmacy buyci.a.l.i.s.on.l.ine.

canadian pharmacy no prescription buyc.i.al.isonlin.e

pharmacy onesource b.uy.ci.a.l.isonl.ine.

canadian pharmacy viagra b.u.y.c.ialis.o.nl.ine

canadian pharmacy king bu.y.c.i.ali.s.o.n.l.i.ne

northwest pharmacies online bu.y.ci.a.liso.n.l.i.ne.

canada medications cheap buy.c.i.a.l.iso.nl.i.n.e.

canada drugs b.uy.ciali.so.nl.in.e

canada medications cheap b.uycia.l.iso.nl.in.e

canadian drugstore buy.c.ia.l.ison.line

canada drug pharmacy bu.yc.i.a.li.s.o.nl.ine.

canadian viagra b.u.yc.i.al.i.so.n.l.i.ne

canadian prescriptions online bu.yci.a.l.ison.line

cialis canadian pharmacy buy.c.i.a.l.is.onl.in.e

canadian rx bu.yc.ia.l.iso.nl.ine.

canadian pharmaceuticals b.uyc.ia.l.is.onl.in.e.

pharmacies buyc.ia.l.iso.nli.ne.

rx from canada b.uyci.a.l.i.s.o.nli.n.e.

pharmacy online buyci.alisonl.i.ne.

canadian pharmacy meds b.uyci.a.l.iso.nl.i.n.e.

canadian pharmacy no prescription bu.yci.a.li.s.o.nli.ne

canada viagra b.u.y.cia.l.i.sonli.n.e

pharmacy uk b.uyci.a.l.is.o.nl.i.n.e

canadian pharmacy world b.uyci.a.lis.o.nl.i.n.e.

online drug store b.u.yc.i.alison.l.in.e.

online pharmacies india bu.y.ci.ali.sonl.ine.

drugs for sale buy.ci.a.l.i.so.n.lin.e

558 гк

Нужна помощь юриста?
ВОСПОЛЬЗУЙТЕСЬ БЕСПЛАТНОЙ КОНСУЛЬТАЦИЕЙ БЕЗ оплаты И ОЧЕРЕДЕЙ.
<a href=http://bit.ly/34ogyYf>гк статья 193</a>

Напишите интересующий вопрос в данной форме и получите незамедлительную помощь!
Ответим без выходных 24/7
Наши филиалы находятся во всех городах России
Оплата услуг производится только после подписания договора
Специализируемся во всех областях права
<a href=http://bit.ly/2JBFtzq>как выписать из квартиры человека</a>

</a>

Деньги в долг – это удобно

Ваши средства описания всего в этом посте действительно разборчивы, все могут без труда знать
это, спасибо большое.
http://bit.ly/2QbO2VS - Моментальные займы онлайн за 15 минут

crd@

Pages

Add new comment