sudo apt-get -y install openjdk-7-jdk
sudo mkdir /usr/java
sudo ln -s /usr/lib/jvm/java-7-openjdk-amd64 /usr/java/default
sudo apt-get install tomcat7
sudo apt-get install tomcat7-admin
sudo wget http://archive.apache.org/dist/lucene/solr/4.8.1/solr-4.8.1.tgz
sudo tar -xvf solr-4.8.1.tgz
sudo cp -R solr-4.8.1/example/ /opt/solr
sudo cp -R /opt/solr/lib/ext/* /usr/share/tomcat7/lib/
sudo cp /opt/solr/webapps/solr.war /var/lib/tomcat7/webapps/solr.war
sudo cp -R /opt/solr /var/lib/tomcat7
sudo chown -R tomcat7:tomcat7 /var/lib/tomcat7/solr
service tomcat7 restart
cd /var/lib/tomcat7/solr
sudo mkdir <my_collection>
cd <my_collection>
sudo mkdir data
sudo chown -R tomcat7:tomcat7 /var/lib/tomcat7/solr
cp <RAILS_ROOT>/solr/conf/schema.xml /var/lib/tomcat7/solr/<my_collection>
cp <RAILS_ROOT>/solr/conf/solrconfig.xml /var/lib/tomcat7/solr/<my_collection>
sudo chown -R tomcat7:tomcat7 /var/lib/tomcat7/solr
sudo service tomcat7 restart
and I also needed to add my core
curl "http://localhost:8080/solr/admin/cores?action=CREATE&name=production&instanceDir=production&config=solrconfig.xml&schema=schema.xml&dataDir=data&persist=true"
persist=true
makes the magic, otherwise every time you restar server you lost your core conf