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

hermes

Thanks a lot for providing individuals with an exceptionally memorable chance to read in detail from here. It's always very brilliant and also full of amusement for me personally and my office friends to visit your website really 3 times weekly to find out the newest secrets you have. Not to mention, I'm actually impressed for the superb solutions served by you. Selected 4 points in this post are rather the most effective we have all had.

kenzo

I would like to show my thanks to the writer just for bailing me out of such a difficulty. Just after surfing through the internet and seeing recommendations that were not productive, I was thinking my life was well over. Being alive without the presence of solutions to the issues you have sorted out by means of this blog post is a crucial case, as well as ones which could have in a wrong way damaged my career if I hadn't come across the website. Your main capability and kindness in taking care of all things was precious. I am not sure what I would have done if I hadn't discovered such a stuff like this. I'm able to at this point relish my future. Thanks for your time so much for the impressive and amazing help. I won't hesitate to endorse the website to anybody who should get care about this area.

yeezys

I in addition to my guys were looking at the best ideas located on your site while suddenly I had a terrible suspicion I never thanked the web site owner for those secrets. The guys were definitely certainly stimulated to study them and have in truth been loving these things. Appreciation for really being indeed considerate as well as for figuring out such quality guides millions of individuals are really wanting to discover. My personal honest regret for not expressing gratitude to sooner.

kevin durant shoes

I simply needed to thank you so much once again. I do not know the things that I would've made to happen in the absence of the entire opinions documented by you directly on such industry. It had been an absolute frustrating matter for me, nevertheless understanding a new specialised avenue you solved that forced me to cry for gladness. I will be happy for your work and in addition trust you recognize what a powerful job you have been doing instructing many others by way of your webblog. I am certain you haven't got to know any of us.

pandora jewelry

I truly wanted to write down a brief note so as to appreciate you for some of the awesome pointers you are posting on this website. My extensive internet investigation has at the end of the day been honored with useful tips to talk about with my partners. I would admit that most of us website visitors are unquestionably lucky to be in a fine place with so many special individuals with great techniques. I feel quite fortunate to have seen the web page and look forward to many more fabulous times reading here. Thanks a lot once again for a lot of things.

lebron james shoes

I wish to point out my affection for your kind-heartedness in support of all those that absolutely need help with this important matter. Your personal commitment to getting the message all through has been surprisingly productive and have in every case made some individuals like me to realize their aims. The important guide indicates this much a person like me and even more to my office workers. Many thanks; from all of us.

pandora

My spouse and i ended up being really thankful Chris could round up his investigations via the ideas he acquired through the weblog. It's not at all simplistic to just happen to be offering tips and hints that men and women might have been making money from. Therefore we recognize we now have you to appreciate for this. Those explanations you have made, the easy blog navigation, the friendships you can assist to promote - it's everything astounding, and it is helping our son in addition to the family do think the theme is excellent, and that's pretty mandatory. Thank you for all!

supreme outlet

I definitely wanted to type a quick message so as to thank you for those marvelous techniques you are giving out at this site. My rather long internet lookup has finally been paid with good tips to share with my best friends. I would claim that many of us site visitors are unequivocally fortunate to live in a fine website with so many awesome individuals with very beneficial tricks. I feel quite privileged to have seen the site and look forward to many more cool times reading here. Thanks once again for all the details.

russell westbrook shoes

I must point out my love for your kindness in support of those who require guidance on this important field. Your very own commitment to getting the solution throughout turned out to be surprisingly insightful and have always permitted individuals like me to achieve their ambitions. Your personal warm and helpful tips and hints can mean this much a person like me and even more to my peers. Thank you; from everyone of us.

curry 5

I wanted to post you one very small observation to finally say thanks again for your pleasant suggestions you have discussed at this time. It's so surprisingly generous with people like you to deliver unhampered just what most people could possibly have sold for an ebook to end up making some dough for themselves, particularly since you might have tried it in the event you wanted. Those ideas also acted like the good way to realize that many people have similar dream just like my very own to know the truth a great deal more on the topic of this matter. I'm certain there are millions of more pleasant moments in the future for individuals that discover your website.

curry shoes

I simply needed to thank you very much once more. I do not know what I would have used in the absence of the smart ideas discussed by you over this area of interest. Certainly was a very alarming circumstance for me, however , encountering this specialised tactic you treated it forced me to cry with joy. Now i am happy for your work and even hope that you find out what a great job you were putting in teaching many others through your website. Most likely you have never got to know all of us.

yeezy boost 350 v2

I am writing to make you know what a useful experience my friend's princess experienced viewing your web page. She discovered too many pieces, not to mention what it's like to have a wonderful giving heart to have the others without difficulty know precisely various complex matters. You truly surpassed readers' desires. Thank you for giving these precious, safe, edifying and as well as cool thoughts on your topic to Gloria.

supreme

I want to show my passion for your kindness supporting men and women that have the need for help on in this idea. Your real commitment to passing the solution all around ended up being wonderfully functional and have surely helped somebody just like me to get to their dreams. The warm and helpful useful information implies so much to me and additionally to my office colleagues. With thanks; from all of us.

curry 8

Needed to post you a very little word to help thank you very much over again over the spectacular thoughts you have shown at this time. This has been really strangely generous with you to allow without restraint what exactly some people would've sold as an ebook to end up making some cash for themselves, precisely since you might have done it in the event you desired. Those things in addition served as a fantastic way to realize that other people have the identical dream just like my own to understand lots more on the subject of this issue. I think there are numerous more pleasurable situations ahead for individuals that scan your site.

yeezy

I enjoy you because of your own hard work on this web page. Debby takes pleasure in managing investigations and it is easy to understand why. Most people notice all regarding the compelling ways you create vital information on this blog and therefore attract participation from website visitors on the situation while our favorite simple princess is always becoming educated a great deal. Have fun with the remaining portion of the year. You're doing a brilliant job.

jordans

I wanted to draft you a tiny remark to help thank you so much once again on your magnificent techniques you have provided on this website. It's certainly remarkably generous of you in giving freely all a few people would have made available for an e book to make some money on their own, certainly considering that you could have done it in case you considered necessary. The creative ideas in addition served to be a fantastic way to know that many people have the identical eagerness really like my very own to realize more in respect of this issue. I believe there are several more enjoyable opportunities in the future for those who examine your site.

chrome hearts store

Thanks for every one of your efforts on this website. My daughter really loves participating in investigation and it is obvious why. Most people know all about the dynamic way you give efficient thoughts through this website and therefore increase response from other individuals on the theme and our favorite daughter is actually discovering a whole lot. Take pleasure in the rest of the year. You're the one conducting a dazzling job.

nike epic react flyknit

I wanted to jot down a simple note in order to appreciate you for these precious strategies you are posting at this website. My particularly long internet research has at the end of the day been paid with reputable facts and techniques to share with my pals. I 'd tell you that many of us site visitors actually are rather blessed to exist in a very good network with many special professionals with beneficial opinions. I feel pretty privileged to have come across your website and look forward to tons of more fabulous minutes reading here. Thank you once more for a lot of things.

supreme

I must express some thanks to this writer for rescuing me from this particular condition. Right after looking out through the online world and getting views that were not powerful, I assumed my life was gone. Living without the answers to the difficulties you have fixed by way of your main guide is a crucial case, and those that would have negatively damaged my entire career if I had not noticed your blog post. Your good natural talent and kindness in touching the whole thing was priceless. I don't know what I would've done if I had not encountered such a thing like this. I'm able to at this time look ahead to my future. Thanks a lot very much for this professional and sensible guide. I won't think twice to propose your web site to anyone who needs and wants guide about this situation.

off white jordan 1

I intended to create you one little bit of note in order to thank you again just for the magnificent principles you've documented here. It is so wonderfully open-handed of you to give extensively what exactly most of us could possibly have made available for an electronic book to generate some dough for themselves, especially considering the fact that you could have done it if you desired. These pointers as well worked as the good way to be sure that other individuals have the same passion much like mine to know the truth a little more in terms of this condition. I am sure there are lots of more enjoyable times in the future for those who find out your site.

pandora outlet

I'm just commenting to let you understand what a outstanding experience my daughter experienced reading through yuor web blog. She came to find plenty of issues, not to mention what it's like to have an ideal teaching heart to let other individuals easily comprehend a variety of problematic subject areas. You really surpassed readers' desires. Many thanks for giving the good, trusted, revealing and in addition unique guidance on that topic to Sandra.

yeezy boost 350

I am commenting to make you know of the beneficial encounter my child enjoyed studying your web site. She noticed some details, which include how it is like to possess an amazing teaching character to make many others with ease master specified very confusing matters. You truly did more than my expectations. Thanks for distributing these valuable, trusted, edifying as well as fun tips about that topic to Tanya.

birkin bag

I simply wanted to thank you so much yet again. I'm not certain the things that I would've used in the absence of the entire advice contributed by you directly on that subject matter. It became a intimidating crisis in my view, nevertheless noticing your skilled fashion you managed that took me to weep over gladness. I'm thankful for the service and even pray you know what a powerful job you were putting in instructing some other people through the use of a web site. Probably you have never got to know all of us.

kyrie shoes

Thanks so much for giving everyone such a breathtaking opportunity to discover important secrets from this blog. It's usually very terrific plus full of a great time for me and my office co-workers to visit your web site at the very least thrice a week to find out the fresh secrets you have got. And lastly, I am certainly fulfilled with the exceptional advice you give. Some 1 facts on this page are absolutely the best we have all had.

off white nike

I as well as my pals were found to be going through the good pointers from your site and then before long got a horrible feeling I never expressed respect to the web site owner for those techniques. All of the ladies became happy to read through them and already have simply been loving these things. Thanks for turning out to be indeed kind and then for settling on these kinds of high-quality tips most people are really eager to know about. My sincere apologies for not saying thanks to earlier.

moncler

I would like to express some appreciation to you just for rescuing me from this particular circumstance. After searching through the world-wide-web and obtaining ideas which are not helpful, I was thinking my life was gone. Existing minus the strategies to the difficulties you have solved all through your entire short article is a crucial case, as well as those which might have adversely affected my career if I hadn't discovered the website. Your main capability and kindness in controlling every aspect was precious. I am not sure what I would have done if I hadn't come upon such a step like this. I can at this moment look forward to my future. Thank you very much for your reliable and results-oriented guide. I won't hesitate to refer your web blog to any person who ought to have recommendations about this matter.

yeezy shoes

I really wanted to jot down a brief remark so as to thank you for the magnificent suggestions you are sharing on this website. My time intensive internet search has at the end been recognized with sensible suggestions to talk about with my contacts. I would tell you that most of us website visitors are very fortunate to live in a great site with so many awesome individuals with helpful solutions. I feel somewhat lucky to have discovered the webpage and look forward to many more cool times reading here. Thank you again for a lot of things.

nike off whtie

I precisely needed to say thanks yet again. I am not sure the things that I might have taken care of without the actual concepts discussed by you over such a topic. Certainly was a very alarming matter for me personally, nevertheless observing the very professional fashion you solved that took me to leap for happiness. Extremely thankful for this help and believe you are aware of a great job you are always undertaking instructing many people using your blog. I am certain you've never met all of us.

air jordan

I definitely wanted to write a word in order to express gratitude to you for some of the awesome suggestions you are sharing on this site. My time intensive internet investigation has finally been paid with really good suggestions to write about with my good friends. I would suppose that many of us website visitors are quite blessed to live in a decent site with so many outstanding people with good concepts. I feel very much blessed to have discovered your web pages and look forward to tons of more exciting moments reading here. Thanks a lot once again for a lot of things.

supreme hoodie

I would like to express my thanks to the writer just for bailing me out of this type of dilemma. Just after searching throughout the world-wide-web and seeing suggestions that were not powerful, I was thinking my life was done. Living minus the strategies to the problems you've fixed through your entire review is a critical case, and the ones which may have in a negative way affected my career if I had not come across your web blog. Your skills and kindness in dealing with every aspect was tremendous. I'm not sure what I would have done if I hadn't discovered such a stuff like this. I can at this moment look ahead to my future. Thanks for your time so much for this specialized and results-oriented help. I will not hesitate to refer the blog to any person who desires guide about this subject.

jordan 4

Thanks so much for giving everyone a very pleasant possiblity to check tips from this site. It is often very amazing and as well , jam-packed with a good time for me and my office friends to search your web site particularly thrice per week to read through the newest guides you have. Of course, I'm so actually motivated with the fabulous tips and hints you give. Selected two ideas in this article are unquestionably the very best we've ever had.

curry 8

I am glad for writing to let you be aware of what a fantastic experience my friend's girl obtained reading through your web page. She picked up lots of issues, which include what it's like to possess an amazing teaching style to have many people easily learn selected hard to do topics. You actually surpassed our own desires. Thank you for showing the effective, trustworthy, informative and also cool tips on this topic to Julie.

curry 8

I wanted to jot down a simple note to be able to say thanks to you for those magnificent tactics you are writing on this site. My time-consuming internet search has now been rewarded with good quality ideas to share with my good friends. I would declare that most of us website visitors actually are rather fortunate to dwell in a fantastic site with very many special people with interesting advice. I feel very fortunate to have seen your site and look forward to tons of more pleasurable minutes reading here. Thank you once again for a lot of things.

off white shoes

I am writing to make you be aware of what a fantastic encounter our child encountered viewing your webblog. She mastered a lot of pieces, most notably how it is like to have an incredible teaching nature to make folks just know precisely chosen tortuous topics. You undoubtedly exceeded people's expectations. Thanks for giving the precious, safe, edifying and as well as unique tips about that topic to Lizeth.

stone island

I would like to show some appreciation to this writer for rescuing me from such a predicament. Because of looking through the internet and meeting basics that were not powerful, I was thinking my entire life was gone. Being alive devoid of the strategies to the issues you've resolved by means of this guideline is a serious case, and those that could have in a wrong way affected my career if I had not come across your web page. Your good understanding and kindness in taking care of a lot of stuff was tremendous. I'm not sure what I would have done if I hadn't encountered such a solution like this. I can now relish my future. Thanks a lot so much for your specialized and results-oriented help. I will not think twice to recommend your site to any person who will need tips about this problem.

knezo clothing

I precisely wanted to say thanks once again. I am not sure the things that I would have tried in the absence of these information documented by you about such a question. Certainly was a distressing circumstance in my view, nevertheless being able to see your well-written tactic you dealt with the issue forced me to cry with joy. Now i'm grateful for your information as well as wish you are aware of a powerful job you have been doing teaching some other people through the use of your blog post. Most likely you've never come across any of us.

supreme

My wife and i felt absolutely lucky Chris could round up his homework while using the precious recommendations he was given through the web page. It's not at all simplistic to just continually be handing out things people have been trying to sell. We figure out we have got you to give thanks to for this. The illustrations you have made, the easy blog navigation, the relationships you will assist to promote - it's got many impressive, and it is helping our son in addition to us consider that this theme is brilliant, and that is especially serious. Many thanks for the whole thing!

Pages

Add new comment