Skip to content

Instantly share code, notes, and snippets.

@ignacy
Forked from chrisjlee/solrsetup.sh
Created May 7, 2013 08:02
Show Gist options
  • Save ignacy/5530985 to your computer and use it in GitHub Desktop.
Save ignacy/5530985 to your computer and use it in GitHub Desktop.
#/bin/bash
# stolen from http://kingstonlabs.co.uk/blog/how-to-install-solr-36-on-ubuntu-1204/
sudo apt-get update; sudo apt-get upgrade -y;
# Install solr and jetty packages
sudo apt-get install jetty openjdk-7-jdk libjetty-extra unzip -y
cd ~;
wget http://www.eng.lsu.edu/mirrors/apache/lucene/solr/3.6.2/apache-solr-3.6.2.tgz
tar -xvzf *.tgz;
rm *.tgz;
sudo mkdir /usr/share/solr;
cd /usr/share/solr;
sudo unzip ~/apache-solr-3.6.2/dist/apache-solr-3.6.2.war
cd ~/apache-solr-3.6.2/examples
sudo cp -vr solr/conf /usr/share/solr
# create a symlink to jetty's document root
# This ensures yoursite.com:8080/solr will serve from your solr directory.
sudo ln -s /usr/share/solr /usr/share/jetty/webapps/solr
echo "NO_START=0
JETTY_HOST=0.0.0.0
JAVA_OPTIONS="-Dsolr.solr.home=/usr/share/solr $JAVA_OPTIONS"
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64" | sudo tee -a /etc/default/jetty
echo "Finish up by copying the ~apache/examples/core to /usr/share/solr"
# Once ready
echo "curl http://ec2-###-##-###-###.compute-1.amazonaws.com:8983/solr/select/?q=test"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment