# Setting Shindig + POSH + APACHE

Before installaing Shindig, you need to activate some PHP extension in your web server.

The required extentions are:

- json
- mcrypt
- simplexml
- libxml
- curl
- openssl
- mysqli

You will also need the Apache "rewrite_module" extension

## Configure Shindig with POSH 2.3 (+collab suite)

Shindig:

Shindig is already included in POSH sources (/tools/shindig). To make it work you have to configure it.
Open the file /tools/shindig/config/local.php and edit the two line "extension_class_paths" and "plugin_base_paths" like that:

$shindigConfig = array(
'person_service' => 'PortaneoService',
'activity_service' => 'PortaneoService',
'app_data_service' => 'PortaneoService',
'messages_service' => 'PortaneoService',
'oauth_lookup_service' => 'PortaneoOAuthLookupService',
'extension_class_paths' => '[PATH_TO_POSH]\tools\opensocial\spi',
'plugin_base_paths' => '[PATH_TO_POSH]\tools\opensocial'
);
Replace [PATH_TO_POSH] by your own path to the posh application (ex: c:\wamp\www\poshTrunk)

Posh:

Edit the file /tools/opensocial/config.php and modify the value of the following parameter:
'portaneo_url' => 'http://localhost/poshTrunk',
'db_host' => 'localhost', //database host
'db_user' => 'root', //database login
'db_passwd' => '', //database password
'db_database' => 'poshTrunk', //database name
'db_port' => '3306', //database port to connect

Additionnal configuration:

To ensure securized exchanges between Shindig and Posh, you can define your own tokens
Edit the file /tools/shindig/config/container.php and define your string for parameters "token_cipher_key" and "token_hmac_key"
Make sure to do the same thing in the file /tools/opensocial/config.php (token_cipher_key,token_hmac_key)

## Configuring Apache for Shindig

First locate your apache configuration file (which is called httpd.conf).
We want to configure 'virtual hosts' on our instalation since we need a shindig server on one 'domain'.
This is required for the cross domain security model of your browser to work, which is the basis of the security model of open social gadgets.

Open the file, scroll to the end and locate the section that reads #Include conf/extra/httpd-vhosts.conf, and remove the # before the Include as such:

Then open the file extra/httpd-vhosts.conf

Edit this file, remove the 2 example vhost configurations (they don't work) and add the following 2 entries (for the localhost and shindig virtual hosts)

For the shindig virtual host document root, specify the path like [your_path_to_posh]/tools/shindig (cf screen capture)

Next we need to edit the host file
On windows you can find it here: c:\WINDOWS\system32\drivers\etc\hosts
On linux it's usually locate in /etc/hosts

Add 'shindig' (without quotes) to the following line:

After this is done, restart your web server.

## Testing it

Point your browser to http://shindig/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml

And you should see the todo gadget being rendered; This means shindig is now fully up and running on you computer