Using Solr with Drupal: 2 Enterprise Level Tomcat
Cutting the Stack Down to Size
In our last post we mentioned the complexity of the Solr stack, so in this post we'll outline our strategy for cutting it down to size. Many a blog post has described how to integrate Drupal with Apache Solr and we have learned a lot from these posts.
However, when it comes to setting up the Solr service itself, many Drupalers seem to fight the Java servlet into submission rather than work with it in a smooth and seamless fashion. In the following we will describe how to optimally set up the Tomcat Java servlet container as a first step in building our Solr search solution.
Java Containers
Solr search is a Java servlet, and Tomcat and Jetty are two of the available options for Java servlet containers on which it can be deployed. A full comparison between them is beyond the scope of this article, but a simple description is that Tomcat is solid, well-documented and has an good web UI, while Jetty provides cutting-edge speed but leaves you a bit on your own as far as UI and documentation.
Notes
You will need to be familiar with Solr terminology. If you need a refresher, review our first post in this series.
Since we will be working at the command line level, installation locations and methods vary between Linux versions and distributions. This recipe is for CentOS 6.3, so we will be using rpm/yum as our package handlers.
Tomcat Server Install
First we will install and configure the Tomcat server. Most Linux distributions include Tomcat in their repositories, and it is often pre-installed, so you may not need to do any further installation at this point.
You can confirm installation by checking the default file location: /usr/share/tomcat6/
You can also check the service status, and start/stop with the following commands:service tomcat6 statusservice tomcat6 startservice tomcat6 stop
If Tomcat is not installed:yum install tomcat6
Tomcat Manager Web-app Install
The next step is to install the Tomcat manager web-app. Usually this command will install the required packages:
yum install tomcat6-admin-webapps tomcat6-webapps tomcat6-docs-webapp
To use the web app manager, click on the "Tomcat Manager" link or navigate to address:8080/manager/html in your browser. You should see the Tomcat web app manager GUI, as shown to the left. This will be your main admin interface to set up Solr instances.
If you installed the docs package, you can click on the /docs link and see a great resource to help you in your Tomcat use.
Problem Solving
Tomcat user account not availablehttps://bugzilla.redhat.com/show_bug.cgi?id=641102
SeLinux access problems:http://drupalwatchdog.com/2/2/apache-selinux
What's Next?
Now that we've got Tomcat and it's web manager app running, it's on to Solr. Our next goal will be to use these tools to quickly and easily install and configure our Solr cores.