This section will guide you through installing Partuza on a local Apache server on Mac OS X (Leopard), which allows you to host the sample OpenSocial social networking container at http://partuza/.
The first step is to obtain and configure the Partuza container code base. To obtain the source code for Partuza, open Terminal and enter the following commands:
mkdir /Library/WebServer/Documents/partuza cd /Library/WebServer/Documents/partuza svn checkout http://partuza.googlecode.com/svn/trunk/ .
Once the checkout has completed, we need to change the permissions of the people images directory. The web server runs under a different username and set of permissions, so taking this step will allow it to write thumbnails to that directory:
chmod 777 partuza/html/images/people
Now we need to add the host entry so that the system can relate a virtual host entry with localhost. Edit your hosts file to add this entry:
sudo vi /etc/hosts
There should be an existing entry for localhost and shindig, such as:
127.0.0.1 localhost shindig
We need to add the Partuza reference to this entry so we can reference our new shindig directory. Your new entry should look like this:
127.0.0.1 localhost shindig partuza
Save and close this file. Now that the host entry is in place, we need to change the configuration settings for http://partuza/ to our virtual hosts configuration file. Load the virtual hosts file.
sudo vi /etc/apache2/extra/httpd-vhosts.conf
The entries for localhost and shindig should already exist in this file. After those two entries, at the end of the file, add the following entry for Partuza:
<VirtualHost *:80> ServerName partuza DocumentRoot /Library/WebServer/Documents/partuza/html <Directory /Library/WebServer/Documents/partuza/html> AllowOverride All </Directory> </VirtualHost>
Save and close that file. Now we’ll edit our PHP configuration to add in the extensions and settings needed for Partuza. Load your php.ini file to begin adding them:
sudo vi /etc/php.ini
Search for “short_open_tag” and ensure that the value is set to On. Once you’ve verified this, save and close the php.ini file.
Our next setup task is to download and configure MySQL on the system. If you already have MySQL installed, you can skip this step. Go to http://www.mysql.com/downloads/mysql/ and download the MySQL .dmg image for your system. Once it’s downloaded, double-click the .dmg file to mount the image and view its contents.
Run the installer by double-clicking the mysql-5.1.50.osx10.5-x86_64.pkg file (or whatever package name you downloaded). Go through the installation with the default settings.
Once the installation has completed, double-click the MySQL.prefPane item in the mounted image to add the MySQL preference pane to the system preferences panel. Select the “Automatically Start MySQL on Startup” option and then click Start MySQL Server.
To be able to execute MySQL commands from the Terminal, we need to add the MySQL directory to our global system profile. From the Terminal, load the system profile:
sudo vi /etc/profile
At the bottom of the file, add:
PATH=$PATH:/usr/local/mysql/bin export PATH
Save and close the file, and then close and reopen the Terminal
for the changes to take effect. Our MySQL installation should now be
complete. To test it out, type mysql
on the command line.
You will be presented with the MySQL Terminal interface, which
allows you to edit and configure your databases. To see the current
databases on the system, type show
databases;
after the mysql>
prompt.
Once you press Enter, you will be presented with the current databases on your system, which should look similar to this:
mysql> show databases; +--------------------+ | Database | +--------------------+ | information_schema | | mysql | +--------------------+ 2 rows in set (0.00 sec)
If everything was successful, type exit
to leave the MySQL Terminal interface.
We can now create a database for Partuza to store user profile and
social information. Within the partuza folder is a file called partuza.sql, which we will use to import
default settings for the database. To accomplish this, we just need to
run a few commands:
cd /Library/WebServer/Documents/partuza/ sudo mysqladmin create partuza sudo mysql partuza < partuza.sql
The partuza database has now been created on your system. To access this database in the future, run the following command:
sudo mysql partuza
We now need to configure Shindig to use the Partuza data handler. To do this, add a new configuration file to the shindig directory as follows:
cd /Library/WebServer/Documents/shindig/php/config vi local.php
Within the new local.php file, add the following PHP code:
<?php $shindigConfig = array( 'person_service' => 'PartuzaService', 'activity_service' => 'PartuzaService', 'app_data_service' => 'PartuzaService', 'messages_service' => 'PartuzaService', 'oauth_lookup_service' => 'PartuzaOAuthLookupService', 'extension_class_paths' => '/Library/WebServer/Documents/partuza/Shindig' );
Save and close the file, and then restart Apache. The values entered into local.php will override those in container.php, allowing you to keep the SVN repository files intact.
18.119.162.49