Magento - Solr Installation & Configuration
Make sure the Java JDK is installed:
- sudo add-apt-repository ppa:sun-java-community-team/sun-java6
- sudo apt-get update
- sudo apt-get install sun-java6-jre sun-java6-jdk
Install & Configure Tomcat:
Installation:
sudo apt-get install tomcat6 tomcat6-admin tomcat6-common tomcat6-userConfiguration:
vi /etc/tomcat6/tomcat-users.xmlAdd the following roles and user to the configuration.
<role rolename="admin"/>
Restart the server: /etc/init.d/tomcat6 restart
If all goes well, goto http://hostname:8080
Install Solr:
- Check for the latest distro here.. http://apache.rediris.es/lucene/solr/
- Download release http://apache.rediris.es/lucene/solr/3.3.0/apache-solr-3.3.0.zip
Install & Configure
unzip apache-solr-3.3.0.zip
- mkdir /usr/share/tomcat6/webapps
- cp apache-solr-3.3.0/dist/apache-solr-3.3.0.war /usr/share/tomcat6/webapps/solr.war
- cp -r apache-solr-3.3.0/example/solr /usr/share/tomcat6/solr
vi /etc/tomcat6/Catalina/localhost/solr.xml
<Context docbase="/usr/share/tomcat6/webapps/solr.war" debug="0" privileged="true" allowlinking="true" crossContext="true"><Environment name="solr/home" type="java.lang.String" value="/usr/share/tomcat6/solr" override="true" /></Context>
chown -r tomcat6.tomcat6 /var/lib/tomcat6
- /etc/init.d/tomcat6 restart
- You should see Solr access on your Tomcat admin/manager page (http://hostname:8080/manager/html)
Configure Magento to use Solr:
Replace the original Solr conf directory with the Magento conf files. The trick is just to copy the directory from Magento, and replace the one in Solr. That’s it!
In Magento, the folder is located in: [magento-instance-root]/lib/Apache/Solr/conf.
In Solr, the folder is located in [Solr-instance-root]/example/solr/conf.
Configure Solr in Magento: In admin, goto System -> Configuration -> Catalog -> Catalog Search
Troubleshooting:
Make sure all configuration files belong to tomcat6:tomcat6
chown -r tomcat6.tomcat6 …
- /var/lib/tomcat6/conf/Catalina/localhost
- /usr/share/tomcat6/solr/conf



