Shindig on Ubuntu

I was busy building a Google Gadget when I ran into a glitch. My gadget worked fine in the gagdget container on Google Sites and iGoogle but did not work too well on "Gadgets-For-Your-Webpage". (according to Firebug gadgets.io was undefined.) In any case, my grand plan to use Google's container for gadgets for my own site was clearly not going to fly - it was a poor idea to rely too much on a third party service for this type of thing. So I decided to install Shindig. This would allow my gadgets to be re-used all around the web, as long as I can keep the shindig service running.

Shindig gives the choice of a PHP or Java version. I chose PHP.

My server was Ubuntu 10.04.

I had Apache already installed.

First things first - check that PHP exists on my box. That would be a no.

sudo aptitude install php5

Then check that it runs with the classic phpinfo(); script of your choice.

testphp.php

<?php

echo phpinfo();

?>

Yes, PHP's up and running

Shindig has PHP dependencies - mcrypt, curl, simplexml and json.

But grepping through the output of phpinfo() there is no curl and mcrypt module.

Let's fix that.

sudo aptitidue install php5-mcrypt php5-curl

Now we have a working PHP environment.

Next up, configure Apache for Shindig.

Shindig requires that it's .htaccess file be honoured and also that mod_rewrite be enabled.

First, mod_rewrite. In my Apache out-of-the-box setup mod_rewrite was not enabled. That was an easy fix:

cd /etc/apache2/mods-enabled

ls -s ../rewrite.load

I'm not a big .htaccess fan. Which means I want to configure Apache to honour .htaccess in the Shindig installation directory. And to do that, I need to install Shindig.

So, get the Shindig application from here: http://www.apache.org/dist/shindig/2.0.0/shindig-2.0.0-php.tar.gz

I unpacked it to /var/www and then I renamed it form shindig-2.0.0 to just plain old shindig.

cd ~

cd /var/www

tar xfzv ~/shindig-2.0.0-php.tar.gz

mv shindig-2.0.0 shindig

So, in the appropriate part of my Apache config, in my case /etc/apache2/sites-available/default enabled the .htaccess file thus:

<Directory>

AllowOverride All

</Directory>

Next up is the configuration of the Shindig application itself.

In version 2.0.0 there is a README file at the top level of the unpacked distribution. It describes two options for installing Shindig. Option A, is to create a new virtual host container in Apache, Option B is to use an existing configuration. For me, option B was the more practical.

The instructions contained in the README have are two small errors in the B instructions:

  1. paths beginning php/ are incorrect.
  2. no reference is made to the need to edit the .htaccess file.

To correct error 1 above, just ignore the php part of the path because there is no php directory in the PHP Shindig distribution. [ It looks like what has happened is that the instructions where written for use from the Subversion source tree, where the PHP and JAVA versions live side by side in /php/ and /java/ directories respectively] I installed Shindig to /var/www/shindig and the correct path for web_prefix was /shindig .

To correct error 2, just know that you need to edit the .htaccess file. Once you know this, you will find the instructions in the file itself. But if you didn't already know that, you would be a bit stuck.

That's it. Enjoy using Shindig.