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
Raviish,
I'm guessing that you downloaded the same distribution of solr that I did. Check that the path you are trying to use exists. My uncompressed solr 3.5 has the example here:
apache-solr-3.5.0/solr/example/solr
Unless of course you pulled the example out of the distribution folder and created another apache-solr-3.5.0 folder in bin.
Hope this helps,
Jack
Thank you for sharing this install/setup. It worked perfectly for me on OS X 10.6.8. I appreciate that you took the time to put this together and post it.
Nice post !
but it my case it still didn't work
error was the
HTTP ERROR: 404 missing core name in path
I couldn't get why it started to work when I changed path:
from
~/bin/apache-solr-3.5.0/example/solr
to
/bin/apache-solr-3.5.0/example/solr/
and then I again changed path to
~/bin/apache-solr-3.5.0/example/solr/
and it kept on working.
well I will try and figure out this later but I will come back to it.
If ny1 knows why please do let me..
CHeer!
Raviish
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