Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Saturday, March 28, 2009

shindig on local ubuntu server

I installed shindig on a server running locally. It would have went as smoothly as my install on our virtual server (shindig on godaddy virtual dedicated server) but for a few small oops.

I want to have a way to play with OpenSocial and gadgets on a local machine. I have a small Ubuntu 8.04 server that is not visible to the world that I use for that sort of thing. I thought it would be easy to install and I was mostly correct.

Shindig is an open source implementation of the OpenSocial specification and gadgets specification. http://incubator.apache.org/shindig/ It comes in Java and PHP flavors. I went for the PHP version for now http://incubator.apache.org/shindig/#php.

My server is a pretty much out of the box Ubuntu Server Edition (8.04). I checked if PHP was PHP 5.2.x and added the extensions I was missing.

Check if the web server has a current PHP with phpinfo (PHP: phpinfo - Manual )
  http://test.jsoft.com/phpinfo.php
  returned that I had PHP 5.2.4 - good

I did not have the command line for PHP installed, so I installed that and checked the version again.
  $ sudo apt-get install php5-cli
  $ php -version
and no surprise it gave me the same answer. I then added curl and mcrypt.

  $ sudo apt-get install php5-curl
  $ sudo apt-get install php5-mcrypt
  $ sudo /etc/init.d/apache2 restart

I downloaded shindig, set up a new virtual host and was up and running (almost).

in /etc/apache2/sites-available
  $ sudo cp default shindig
to get a new virtual site and
  $ sudo vi shindig

Here are the important parts:

<virtualhost *>
ServerName shindig.jsoft.com
DocumentRoot /home/gary/public_html/shindig/php/
<directory>
Order Deny,Allow
Deny from All
</directory>
<directory>
Allow from All
AllowOverride All
</directory>
... other settings for vhosts
</virtualhost>

I installed into a public_html directory. You may want to install into the directory suggested in the shindig installation instructions.

I then enabled the site and reloaded apache

  $ sudo a2ensite shindig
  $ sudo /etc/init.d/apache2 reload

and found I did not have mod_rewrite enabled
  $ sudo a2enmod rewrite
  $ sudo /etc/init.d/apache2 force-reload

and then updated the file /home/gary/public_html/shindig/php/config/container.php

----- my copy -----
// The URL Prefix under which shindig lives ie if you have http://myhost.com/shindig/php set web_prefix to /shindig/php
'web_prefix' => '/shindig/php',
// If you changed the web prefix, add the prefix to these too
'default_js_prefix' => '/shindig/php/gadgets/js/',
'default_iframe_prefix' => '/shindig/php/gadgets/ifr?',
-----

tested and it was all good!

-----
It took me a while to decide to update container.php. I was lost till I read Chris Chabot's article PHP Shindig and mod_rewrite at chabotc.com. It has some great info on how things are set up and was what I needed to get shindig running.

I was looking at Google Friend Connect and the GFC demo The Chow Down when I decided to install shindig locally. We have tested a simple gadget or two with GFC on one of our sites and I look forward to getting more social.

Gary

Saturday, February 14, 2009

shindig on godaddy virtual dedicated server

I installed Apache's shindig on one of our sites running on godaddy's virtual dedicated servers. Shindig - an Apache incubator project for OpenSocial and gadgets lets me test social networking software on my own container server. I am just starting to dig into all the cool OpenSocial/ OpenId/ OAuth stuff. I tried Google Friend Connect and did some simple hello world gadgets that worked on GFC and iGoogle. I am looking at adding social networking to some of our sites and shindig should let me explore what I need to do to get even more social.

I have a pretty basic setup, CentOS 5.2 with not much more than what comes out of the box. Installing shindig was not hard, here are my notes:

I used the instructions for installing the php version of shindig from the Apache Foundation
http://incubator.apache.org/shindig/#php
It works as advertised! The only thing I had to do was to update to PHP 5.2.x. I followed the instructions in this blog Install PHP 5.2 on CentOS 5.2 Using Yum | Fresh Blurbs

I used the Centos testing repo using Irakli's comment at the bottom.

So, all I had to do was: (YMMV)
  1. set up the Centos testing repo
  2. yum update php
  3. svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk/ .
and I was good to go.

Now to play with it a bit!!!

My site did not have subversion installed (it's really basic ;-). I downloaded a Subversion client from CollabNet, installed and used the subversion client to get shindig. I then removed svn. It would have been easier for me to get shindig on something that has subversion and copy the files to the server. Next time...

Gary