We installed the tomcat6-admin and tomcat6-user package to be able to make use of the Tomcat6 manager web application.
In order to have access to this application we need to edit its permissions:
sudo nano /etc/tomcat6/tomcat-users.xml
Change it so it more less looks like this:
<tomcat-users> <role rolename="admin"/> <role rolename="manager"/> <user username="{mycompanyuser}" password="{mycompanypassword}" roles="admin,manager"/> </tomcat-users>
We'll restart the Tomcat service soon, but first we’re going to configure Solr’s multi-core capability.
Drupal-specific Solr & multi-core configuration
At the time of writing you need the latest version of the apachesolr Drupal module to be able to communicate with Solr 4. You can e.g. download the latest development release athttp://ftp.drupal.org/files/projects/apachesolr-7.x-1.x-dev.tar.gz.
cd ~/ wget ftp.drupal.org/files/projects/apachesolr-7.x-1.x-dev.tar.gz tar –zxvf apachesolr-7.x-1.x-dev.tar.gz
The apachesolr module comes packed with custom Drupal Solr config files. In the apachesolr module subdirectory ‘solr-conf’ you can find the needed files for each different Solr version.
In order for Solr to understand Drupal requests you need to copy these config files to your Solr core ‘conf’ directory. So let's copy them to Solr's exemplary 'core0' sub-directory:
sudo cp ~/apachesolr/solr-conf/solr-4.x/schema.xml /usr/share/solr4/{mycompanyname}/multicore/core0/conf/schema.xml sudo cp ~/apachesolr/solr-conf/solr-4.x/solrconfig.xml /usr/share/solr4/{mycompanyname}/multicore/core0/conf/solrconfig.xml sudo cp ~/apachesolr/solr-conf/solr-4.x/protwords.txt /usr/share/solr4/{mycompanyname}/multicore/core0/conf/protwords.txt sudo cp ~/apachesolr/solr-conf/solr-4.x/solrcore.properties /usr/share/solr4/{mycompanyname}/multicore/core0/conf/solrcore.properties
Personally I like to use the latest Solr configuration files as a base and make adjustments to those files. This way it’s easier to spot Solr configuration differences after an upgrade.
E.g. the attached configuration package conf-en-nl.zip is optimized for a Dutch / English bilingual website. Feel free to use that for reference purposes if you’d like to setup a multilingual Drupal site. You can download the file and overwrite the entire /usr/share/solr4/{mycompanyname}/multicore/core0/conf/directory with its content.
After copying those files, restart the Tomcat service and you'll be able to connect your Drupal 7 site to the Solr service.
Use the following command to restart the Tomcat service:
sudo /etc/init.d/tomcat6 restart