Friday, September 6, 2013

Tunneling SSH over SSH

Here's the problem.  Let's say your network is locked down so that a server called loqued only accept connections from a single host called trapdoor.  You could constantly ssh to trapdoor and then to loqued, but it's sometimes nice to abstract this away.  Here's how:

ssh zera@trapdoor -L 9000:loqued:22 -fN
ssh -p 9000 zera@localhost

Saturday, March 2, 2013

Installing Solr on Ubuntu 12.04

These instructions were created on a fresh Ubuntu 12.04 install.  The only problems I ran into were permission-related.  Here goes the obvious part, update and install Tomcat and Java:

$sudo apt-get update
$sudo apt-get install tomcat6
$sudo apt-get install openjdk-6-jdk

Grab the Solr from a mirror:

$curl -O

Now setup Solr, assuming Solr will be installed under /home/solr and the directory exists (make an account called solr if you want).

$sudo cp solr-4.1.0/dist/solr-4.1.0.war /home/solr
$sudo cp -R solr-4.1.0/example/solr/*/home/solr
$sudo mkdir /home/solr/collection1/data /home/solr/collection1/lib
$sudo chmod 770 /home/solr/collection1/data
$sudo chgrp tomcat6 /home/solr/collection1/data

The data /home/solr/collection1/data directory contains all the data for the Solr index.

Last, setup Tomcat by adding a single file:

$sudo vi /etc/tomcat6/Catalina/localhost/solr.xml
<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/home/solr/solr-4.1.0.war" debug="0" crossContext="true">
  <Environment name="solr/home" type="java.lang.String" value="/home/solr" override="true"/>

$sudo /etc/init.d/tomcat6 restart

Navigate to localhost:8080/solr to see a slick UI.

If you run into problems, ensure the tomcat6 account can read all Solr files and has full permission to the data directory.