Skip to content

Instantly share code, notes, and snippets.

@tsabat
Last active December 15, 2015 19:38
Show Gist options
  • Save tsabat/5312289 to your computer and use it in GitHub Desktop.
Save tsabat/5312289 to your computer and use it in GitHub Desktop.
installing solr

following these instructions:

SOLR_VER=4.2.1

sudo apt-get install openjdk-7-jdk
sudo apt-get install tomcat6 tomcat6-manager

cd /opt

# Get Solr
sudo wget "http://apache.claz.org/lucene/solr/$SOLR_VER/$SOLR_VER.tgz"
sudo tar xvzf $SOLR_VER
sudo rm "$SOLR_VER.tgz"

mkdir solr
cp -R "$SOLR_VER/example/solr/*" /opt/solr
cp "$SOLR_VER/example/webapps/solr.war" /opt/solr

mkdir /opt/solr/data
chown tomcat6 /opt/solr/data
curl https://gist.github.com/tsabat/5312289/raw/2be72fa151773af46c3fb5bdb254ab20f5be957e/solr.xml+ > /etc/tomcat6/Catalina/localhost/solr.xml 
sudo chown tomcat6:tomcat6 /etc/tomcat6/Catalina/localhost/solr.xml

Up the memory for tomcat

sed -i '1s/^/export CATALINA_OPTS="-Xms1024m -Xmx1024m"\n/' /usr/share/tomcat6/bin/catalina.sh

Set up connector

following these instructions.

<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/opt/solr/solr.war" debug="0" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/opt/solr" override="true"/>
</Context>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment