Drupal 7 Apache Solr Configuration

http://www.lullabot.com/blog/article/installing-solr-use-drupal

Thanks to lullabot for this nice post which produces exact output that it says. In my case i had to make few other changes in my CENTOS cloud server.

 

1.  Instead of recommended version of drupal apachesolr module; I took the dev version for solr configuration. 

2. You wont be able to access http://localhost:8983  

The reason behind this is firewall if you have iptables enabled . Open /etc/sysconfig/iptables and add following line:

# Tomcat Port
-A INPUT -p tcp --dport 8983 -j ACCEPT

Then restart iptables #/etc/init.d/iptables restart .  Now you can access tomcat server.

3. That article didnt speak much about security.  VISIT I found this post to secure SOLR admin panel. There is truncated tags in that XML . See the github gist  comment to fix this. 

4.  In drupal admin level use http://username:password@localhost:8983/solr/drupal 

5. Setup Tomcat to run on startup . This post of rackspace is useful. I did have to tweak few lines in that shell. I removed java path variables and put correct path to tomcat startup and shutdown shell.

 

Finally  configure the basic settings for solr inside drupal admin. I used drush solr-index  to index my contents. Thats it , Enjoy SOLR !

 

Resource: 

https://drupal.org/node/1333076   This post discusses above security and configuration related to admin.