There's quite a few information available on how to install Apache Solr for your Drupal website. One of the best places to start is the Apache Solr Search Integration module documentation page. In this post I will gather all the bits and pieces for installing Solr in Tomcat on one specific platform: Snow Leopard. This is the platform I'm developing Drupal sites on and the great thing is it has all the needed Java stuff built in, so it's quite easy to install Solr and Tomcat. This method might work on some other systems too having Java 1.6 (with mostly some minor adjustments) but I've not tested this.
[YOUR-MODULES-FOLDER]/apachesolr/SolrPhpClient/Apache/Solr/Service.php.~/bin/apache-solr-1.4.0.
solrconfig.xml and schema.xml from the module folder to the Solr instance configuration folder. In my case this is in ~/bin/apache-solr-1.4.0/example/solr/conf. You might want to rename the schema and config file in that folder first to keep a backup.~/bin/apache-tomcat-6.0.24.~/bin/apache-solr-1.4.0/dist/apache-solr-1.4.0.war to your Tomcat webapps folder and rename it to solr.war. In my case this resulted in ~/bin/apache-tomcat-6.0.24/webapps/solr.war.~/bin/apache-tomcat-6.0.24/bin/startup.sh ~/bin/apache-tomcat-6.0.24/bin/shutdown.sh
Note that the exact Tomcat folder name might depend on the Tomcat version you downloaded..
This will unpack the war file resulting in a folder ~/bin/apache-tomcat-6.0.24/webapps/solr/.
WEB-INF/web.xml). Uncomment the section specifying the solr/home environment variable and set its value to the path of your Solr example application folder.~/bin/apache-tomcat-6.0.24/webapps/solr/WEB-INF/web.xml and after replacing the solr/home section I had.
<env-entry> <env-entry-name>solr/home</env-entry-name> <env-entry-value>~/bin/apache-solr-1.4.0/example/solr</env-entry-value> <env-entry-type>java.lang.String</env-entry-type> </env-entry>
~/bin/apache-tomcat-6.0.24/bin/startup.sh
Comments
Someone asked for a guide on windows.
I installed solr several times using this guide
http://wiki.apache.org/solr/SolrTomcat
untill I needed to do one via plesk :-0 Then I needed this guide to remind me to have a solr.xml
Thank you
drupalcoder
solr/lucene are about indexing and searching.
This covers search only.
How do you setup indexing in tomcat?
I installed Solr for windows but haved an error, Can you help me how to install windows on it?
Thanks a lot
SearchBlox is another tool that can be used for searching drupal sites. SearchBlox is also based on Lucene similar to Solr.
Thanks a lot. It is really helpful and thanks for saving so much of my time...
Thanks for this! These are the only instructions out there that were able to get me up and running on tomcat/centos with ease.
Thank you -- the WEB-INF/web.xml change was non-obvious IMHO and I spent several hours looking at the rather inadequate Solr docs and trying to figure out why my install didn't work. Your walkthrough really helped!
I write almost the same guide bug without tomcat: http://listentothis.net/drupal/installing-apache-solr-mac-osx-snow-leopa...
Hi,
I was having the same message as above about not being able to locate the solrconfig.xml until I realized that the
solr/home
was commented out (with a my tomcat WEB-INF/web.xml !
I
If you're greeted by a 500 error and the message "Can't find resource 'solrconfig.xml'" when directing your browser to localhost:8080/solr/admin, try using the following directives instead of the ones above for your solr/home secion in web.xml:
solr/home
/Users/yourusername/bin/apache-solr-1.4.0/example/solr
java.lang.String
Hmmm. It's stripped my triangular brackets out, but you get my drift :P
Excellent post! Thank you very much!
I found that the final bit of code didn't recognise ~/ as the home directory, I had to use the absolute path to get it to work.
solr/home
/Users/username/bin/apache-solr-1.4.0/example/solr
java.lang.String
Cheers, Ben
Post new comment