Search code examples
solrinstallationtomcat7search-engine

How to install solr-4.6.1 on ubuntu using tomcat7?


I want step by step instructions for installation of solr search engine using tomcat7 on ubuntu. I searched on google but I am not getting proper reference. Please help me to install it.


Solution

  • 1- Download Solr dist: here. Unzip it anywhere.

    2- find $EXTRACTEDDIR/solr/dist/solr-4.6.1.war and copy it to the location you want to configure solr.

    3- configure the solr.xml as explained here. You will need to change your hostport to 8080(or what ever port tomcat7 is configured) and put it where you put solr-4.6.1.war

    4- create /etc/tomcat7/Catalina/localhost/solr.xml and put

    <?xml version="1.0" encoding="UTF-8"?>
    <Context docBase="$SOLRBASE/solr-4.6.1.war" debug="0" privileged="true" allowLinking="true" crossContext="true">
            <Environment name="solr/home" type="java.lang.String" value="$SOLRBASE" override="true" />
    </Context>
    

    replace SOLRBASE with the loacation you put solr.war and solr.xml.

    5- copy $EXTRACTEDDIR/example/lib/ext/* . * to /usr/share/tomcat7/lib(for loging libs)

    6- give permissions of the folder where you put solr.war and solr.xml to "tomcat7" user.

    7- restart tomcat and you are done.