Apache Shindig PHP Setup Problem Solved

First things first. Shindig is an Apache incubator project that serves as an OpenSocial Container and…I’m already falling asleep. Too boring. I’m way behind the curve on all things “social networking” but I have an idea for an app that may scratch an itch I have, and it just happens that some of this social networking stuff might be a good way to jump start the idea. So that means catching up on a couple of years (or more) of stuff that’s been going in the world of web 2.0, which includes OpenSocial. I wanted a local OpenSocial test sandbox and found Shindig to fit that bill.

Now, onto the problem I was running into and the solution. Unless you want the long boring details, I can save you the trouble and tell you to make sure you have mod_rewrite enabled in Apache.

If you haven’t dozed off by now then it probably means you’re running into issues with the Shindig PHP setup and would like some more details. I followed the directions on setting up the PHP Shindig server on my laptop running Kubuntu 08.04 here at home and kept getting a 404 error. I thought that was strange since I could hit other files with my browser that I put in that directory manually for testing but not the Shindig index.php page. Turns out the Shindig index.php page tries to be more “controller/servlet” like by sniffing the URI and passing it along to the appropriate handler. If it can’t find a match, then it gives a custom 404 error. I noticed the test URI (http://shindig/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml) didn’t have any reference to index.php. Ah yes, the wonders of Apache mod_rewrite! And guess what I didn’t have enabled? Yep, Apache mod_rewrite. So, below is what I did to get things running on an Ubuntu setup from scratch (meaning no Apache 2, PHP 5 was installed or configured):

Stop laughing, I use the Pico text editor. I’m, as my son would say, “weak sauce”. I know. Anyway, here’s what I have in that virtual host file:

Once we have that in place, we need to edit our host file:

Append the following to the hosts file and save:

Time to restart Apache:

Now you should be able to go to your web browser of choice and run the demo/test app:

If all went well you should see something a little like this:

  • Japi

    YOu really should consider moving this to de Ubuntu wiki. Really helpful stuff

  • Jeroen

    Thanks, this helped me

    In addition, I needed the help of

    I had Apache mod_rewrite enabled, but it wasn’t kicking in because somewhere an ‘AllowOverride None’ blocked the inclusion of my .htaccess (and initially the .htaccess didn’t unzip along).

    So the recipe for success:
    1) make sure you have mod_rewrite enabled if you get a blank ‘404 not found’ page (which is generated by Shindig itself – they could have added a comment stating this…)

    2) make sure mod_rewrite is invoked, you can check this by enabling its debug log in httpd.conf

    3) If needed, edit config/container.php to set the correct prefix

  • K Suresh

    Really nice blog. It really help to come up with my problem which i am facing from last two days.

    Thanks dude!!!

  • Sean

    Thanks, that really helped.
    Also, your photograph awkwardly reminds me of Dieter Bohlen.