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

yeezy boost 350

I needed to send you one little bit of note just to thank you yet again for these spectacular tricks you have contributed at this time. This is simply generous with people like you to deliver unhampered what most people could possibly have advertised for an e book to get some bucks for their own end, specifically given that you might have done it if you ever wanted. These pointers as well served to be a easy way to be aware that other individuals have similar fervor just as my own to grasp more on the subject of this condition. I am certain there are lots of more pleasurable periods in the future for individuals that take a look at your website.

supreme clothing

I truly wanted to compose a brief remark to be able to appreciate you for all the fantastic facts you are posting at this site. My prolonged internet search has at the end of the day been recognized with reputable points to share with my company. I 'd express that we readers actually are very much endowed to live in a useful place with so many perfect professionals with very beneficial advice. I feel really grateful to have discovered your website page and look forward to many more thrilling times reading here. Thank you again for a lot of things.

kyrie 5 spongebob

I actually wanted to send a remark so as to express gratitude to you for all of the awesome concepts you are placing on this website. My extended internet research has at the end of the day been recognized with professional details to exchange with my companions. I would believe that we site visitors actually are unequivocally lucky to exist in a useful network with so many special professionals with good guidelines. I feel very much fortunate to have seen your entire website and look forward to tons of more awesome minutes reading here. Thanks once again for all the details.

moncler

I precisely wished to thank you very much once again. I am not sure the things I could possibly have taken care of without the type of creative concepts discussed by you directly on such area of interest. It was actually the challenging crisis in my opinion, however , observing this specialized approach you handled the issue forced me to leap with happiness. Now i'm happy for your guidance as well as sincerely hope you really know what an amazing job you have been getting into educating the rest all through a blog. Most likely you haven't come across any of us.

supreme clothing

I in addition to my pals have already been going through the good tips and tricks located on your web blog while then I got a terrible feeling I had not expressed respect to the website owner for those techniques. All the guys were passionate to learn all of them and have very much been loving them. Appreciation for indeed being indeed thoughtful as well as for picking variety of smart subjects most people are really eager to be informed on. My personal honest apologies for not saying thanks to sooner.

golden goose

I am glad for writing to make you know of the magnificent experience my friend's girl obtained reading through your site. She picked up so many pieces, not to mention what it's like to have an ideal coaching spirit to let a number of people smoothly learn certain problematic things. You really did more than people's desires. Thanks for rendering such warm and friendly, healthy, revealing and in addition fun thoughts on that topic to Gloria.

kd shoes

My wife and i were really joyous that Michael managed to complete his survey by way of the ideas he gained through your web site. It is now and again perplexing to just choose to be freely giving things that many some other people might have been trying to sell. Therefore we understand we now have the website owner to thank for this. The most important illustrations you've made, the simple site navigation, the friendships your site help foster - it's got many sensational, and it's making our son in addition to our family reason why the situation is awesome, which is particularly pressing. Many thanks for all the pieces!

moncler

A lot of thanks for each of your work on this web page. Betty enjoys making time for investigations and it's really easy to understand why. My spouse and i know all of the compelling ways you produce practical suggestions via this website and inspire contribution from visitors about this theme then my simple princess is certainly starting to learn a lot. Have fun with the remaining portion of the new year. Your doing a wonderful job.

saveorpave

lebron 17 shoes

I just wanted to write down a brief remark to be able to thank you for the precious advice you are posting at this site. My incredibly long internet search has finally been honored with professional facts and techniques to exchange with my best friends. I 'd express that many of us website visitors actually are extremely blessed to be in a perfect place with so many awesome people with valuable secrets. I feel truly fortunate to have seen the website and look forward to plenty of more excellent moments reading here. Thanks again for everything.

sunpacfl

supreme

I have to get across my passion for your generosity for people who actually need assistance with in this idea. Your special commitment to passing the message throughout became incredibly useful and has made professionals much like me to reach their goals. This informative guidelines indicates a lot a person like me and extremely more to my colleagues. Thanks a ton; from all of us.

yeezy

I enjoy you because of your own labor on this site. My mum really likes doing investigation and it's really easy to see why. My partner and i know all regarding the lively ways you provide reliable guides by means of the blog and recommend response from people on that matter so our own daughter is now starting to learn a lot of things. Take advantage of the rest of the new year. You're the one performing a remarkable job.

curry 7

I am also commenting to make you understand what a helpful experience my cousin's girl developed checking your web site. She learned some issues, not to mention how it is like to possess a wonderful giving mindset to make other folks smoothly thoroughly grasp a variety of complex matters. You undoubtedly surpassed her expectations. Thanks for showing those beneficial, healthy, educational and cool tips on this topic to Sandra.

curry shoes

My husband and i got ecstatic that Raymond managed to finish off his basic research through your precious recommendations he had when using the site. It's not at all simplistic to simply always be giving out concepts which others may have been selling. And we all remember we have the writer to give thanks to because of that. The specific explanations you made, the straightforward website navigation, the friendships you help to foster - it's most incredible, and it's facilitating our son in addition to the family reckon that that matter is cool, which is highly pressing. Thanks for the whole thing!

curry shoes

I have to show thanks to this writer for bailing me out of such a circumstance. After surfing through the online world and coming across views which are not helpful, I believed my entire life was gone. Living without the presence of solutions to the problems you have solved as a result of this blog post is a serious case, and the ones which might have in a wrong way damaged my career if I had not noticed your blog post. Your personal natural talent and kindness in dealing with all the details was excellent. I am not sure what I would have done if I had not come upon such a point like this. I can now relish my future. Thanks so much for the impressive and amazing help. I won't hesitate to refer your site to any individual who should get recommendations about this situation.

chrome hearts outlet

I would like to express thanks to the writer just for bailing me out of this particular instance. Because of browsing throughout the search engines and coming across ways which are not powerful, I was thinking my life was gone. Existing minus the answers to the problems you've solved by way of this post is a critical case, and the ones that would have in a wrong way damaged my entire career if I hadn't discovered your web site. The natural talent and kindness in handling every aspect was crucial. I am not sure what I would've done if I had not discovered such a point like this. It's possible to at this moment relish my future. Thank you very much for this reliable and results-oriented help. I will not be reluctant to suggest your web blog to any individual who should get direction about this subject matter.

yeezy

I wanted to put you one tiny observation to help give thanks yet again on your great opinions you have documented at this time. It is certainly pretty generous of people like you to deliver unhampered exactly what many people would have supplied as an ebook to help with making some money on their own, most importantly since you might well have tried it if you ever considered necessary. These tricks likewise served like a easy way to be sure that the rest have the identical fervor similar to my very own to see significantly more concerning this problem. I think there are numerous more enjoyable instances ahead for individuals that check out your site.

paul george shoes

I want to express my appreciation to the writer just for bailing me out of this particular situation. Because of researching through the the net and coming across things that were not pleasant, I was thinking my life was over. Being alive without the presence of approaches to the difficulties you've sorted out through your entire review is a critical case, and the ones which might have adversely affected my career if I hadn't noticed your site. Your primary talents and kindness in taking care of almost everything was vital. I'm not sure what I would've done if I hadn't discovered such a stuff like this. It's possible to at this time look ahead to my future. Thanks for your time very much for the expert and effective guide. I won't think twice to suggest your site to any individual who desires recommendations about this issue.

golden goose

I happen to be commenting to let you understand of the impressive experience our child encountered using your site. She came to find such a lot of details, most notably how it is like to have a great coaching style to let the rest just fully grasp specific tortuous things. You actually surpassed readers' expected results. Many thanks for imparting those effective, trusted, revealing and also easy tips about that topic to Ethel.

yeezy boost

I want to convey my appreciation for your kindness in support of folks who have the need for guidance on the subject matter. Your special commitment to getting the message throughout came to be incredibly functional and have continually helped girls just like me to get to their ambitions. Your entire warm and friendly guideline implies a whole lot to me and even more to my office colleagues. Warm regards; from each one of us.

kd 10

I would like to show some appreciation to you just for rescuing me from such a scenario. As a result of scouting throughout the the net and meeting proposals that were not productive, I thought my life was over. Living without the presence of solutions to the problems you've fixed all through this short article is a crucial case, and those that might have negatively damaged my career if I had not encountered the blog. The talents and kindness in taking care of every item was precious. I am not sure what I would've done if I hadn't come upon such a stuff like this. It's possible to at this point relish my future. Thank you so much for the specialized and amazing guide. I will not be reluctant to refer the website to anyone who desires direction on this subject.

supreme

I am glad for commenting to let you know what a outstanding discovery my princess undergone visiting your site. She mastered so many things, not to mention what it is like to possess a very effective helping style to make other folks effortlessly comprehend chosen complicated matters. You truly exceeded readers' expectations. Thank you for giving the interesting, trustworthy, explanatory as well as unique thoughts on that topic to Tanya.

supreme clothing

Thank you a lot for giving everyone an exceptionally special possiblity to read articles and blog posts from this website. It is usually so good and as well , jam-packed with a good time for me personally and my office acquaintances to search your website at the least three times in 7 days to learn the latest tips you have got. And of course, I am certainly happy with the attractive points you give. Selected two ideas in this article are ultimately the simplest we have ever had.

golden goose sneakers

A lot of thanks for every one of your efforts on this site. My daughter take interest in managing investigation and it is easy to see why. Most people know all about the lively mode you give both useful and interesting strategies via this web site and as well strongly encourage contribution from some other people on the area and our princess is actually becoming educated a whole lot. Take advantage of the rest of the year. You're the one conducting a useful job.

etuevt

mohawarean

golden goose outlet

I and also my guys came looking through the nice things from the website and so all of a sudden got a terrible feeling I had not expressed respect to the web site owner for them. All the young men appeared to be so glad to learn all of them and now have seriously been tapping into them. Appreciate your genuinely well helpful and then for going for this form of important areas most people are really needing to know about. My personal honest apologies for not saying thanks to earlier.

kobe shoes

I truly wanted to write a small remark to thank you for the pleasant tips and tricks you are giving here. My time-consuming internet search has finally been honored with really good strategies to go over with my visitors. I 'd say that we website visitors actually are very lucky to dwell in a fabulous place with so many special professionals with useful hints. I feel very much blessed to have seen the webpage and look forward to tons of more fun moments reading here. Thank you once again for everything.

nike kyrie 5

I'm writing to make you be aware of of the excellent experience my cousin's girl encountered reading your webblog. She realized a lot of issues, including how it is like to have a great coaching mood to get the mediocre ones completely understand a number of hard to do topics. You really did more than our desires. Many thanks for offering such insightful, trusted, edifying and even fun thoughts on your topic to Evelyn.

yeezy

I simply wished to say thanks once more. I'm not certain the things I might have made to happen in the absence of the actual methods shown by you about this area. This was a very hard difficulty in my view, however , taking a look at a well-written technique you processed that made me to leap over joy. Extremely happy for this help and then pray you know what a great job you happen to be doing educating the others through the use of your blog post. I'm certain you haven't come across all of us.

jordan retro

Needed to draft you the very small remark to be able to thank you over again for your personal lovely knowledge you've shown in this case. It was really pretty open-handed with you to allow publicly all that a number of us could have supplied as an electronic book to help make some profit on their own, most notably since you could have tried it if you ever wanted. The strategies additionally served to provide a good way to know that other people have similar interest much like my very own to figure out lots more with regards to this matter. I believe there are a lot more pleasant moments up front for people who start reading your site.

curry 8

I intended to put you one tiny note in order to thank you yet again for these fantastic advice you've contributed at this time. This has been simply extremely generous of people like you to deliver freely all many people could have supplied for an ebook to make some dough for their own end, and in particular seeing that you could have done it if you decided. These pointers likewise acted like a good way to comprehend most people have the identical fervor much like mine to find out good deal more pertaining to this problem. I am sure there are many more enjoyable sessions ahead for individuals that view your site.

supreme clothing

My spouse and i got now fortunate when Michael managed to carry out his reports because of the precious recommendations he gained out of your blog. It's not at all simplistic to just possibly be giving out helpful tips which often some others might have been making money from. Therefore we acknowledge we now have the blog owner to give thanks to for that. The specific illustrations you have made, the simple web site menu, the friendships you will give support to create - it's everything excellent, and it's making our son in addition to us understand this subject matter is interesting, and that is seriously vital. Thanks for the whole thing!

cheap jordans

My husband and i ended up being so joyful Jordan could deal with his analysis through the entire precious recommendations he received in your web pages. It is now and again perplexing just to find yourself handing out concepts many people could have been making money from. We really keep in mind we need the writer to appreciate because of that. Most of the illustrations you've made, the simple web site menu, the relationships you can give support to instill - it is all amazing, and it is helping our son and the family imagine that that situation is brilliant, which is especially essential. Thank you for the whole lot!

golden goose outlet

Needed to post you a little word to finally give many thanks yet again on your awesome views you have discussed at this time. It was certainly particularly generous of people like you to grant unreservedly just what some people could possibly have offered for sale for an electronic book to generate some bucks for their own end, mostly considering that you might have done it in the event you desired. The concepts likewise acted as a fantastic way to be sure that most people have similar zeal much like my own to understand very much more pertaining to this problem. I'm sure there are millions of more pleasurable times up front for folks who looked over your website.

golden goose

I intended to put you the bit of remark so as to say thanks again for your personal magnificent secrets you have provided on this site. It has been really incredibly open-handed with you to deliver easily exactly what a number of us could possibly have made available for an ebook to get some money for their own end, even more so now that you could have done it in case you considered necessary. These ideas also acted to provide a great way to be sure that many people have a similar dreams really like my very own to find out more with respect to this problem. I believe there are several more enjoyable situations ahead for many who examine your blog.

yeezys

My husband and i have been quite relieved when Chris could deal with his studies by way of the ideas he obtained through the web page. It is now and again perplexing to simply find yourself giving away instructions which men and women could have been making money from. And we remember we now have the writer to thank because of that. The main explanations you made, the easy site navigation, the relationships you give support to engender - it's mostly terrific, and it's helping our son and us do think that matter is exciting, and that's extraordinarily indispensable. Thank you for all the pieces!

kyrie 5

I simply had to say thanks once more. I do not know the things I could possibly have taken care of in the absence of the entire pointers provided by you about such problem. It has been an absolute alarming concern in my circumstances, however , taking a look at the very well-written avenue you managed the issue forced me to leap with gladness. I am just happier for the assistance and sincerely hope you really know what a powerful job you happen to be providing training men and women with the aid of your site. More than likely you have never got to know any of us.

Pages

Add new comment