The Flamenco Project

Flamenco MacOS 10.4.10 Installation Notes

by Rajendra Bose, November 8, 2007

introduction

The following specialized notes are meant to accompany the last (4/22/2006) documentation update for release flamenco-1.0, and concern standalone, local installation of Flamenco on one (Intel) MacBook running MacOS 10.4.10 in August 2007, for Flamenco demonstration purposes only.

macos10_4_install

The accompanying folder macos10_4_install includes the pdfs of some of the online technical notes mentioned in this document, as well as the original and modified unix install script and python .cgi script for MacOS 10.4.10  flamenco installation and use.

code executables location

Apache, python and mysql are required for Flamenco.  In my system, most source code installs were performed in /usr/local/src, but the executable files are usually located elsewhere after installation.  In my system the python executable is stored in /usr/local/bin, the mysql executable is stored in /usr/local/mysql/bin, and the flamenco executable is stored in /usr/local/flamenco/bin.  (My system runs the bash shell, so I added these directory paths to the front of the PATH environment variable in my .bash_login file in my home directory.)

[For more about the use of  /usr/local/ on MacOS X to reserve priority for local user application installations see http://hivelogic.com/narrative/articles/using_usr_local which is included as the document usr_local_and_Filesystem_hierarchy_standard.pdf

apache

I used the MacOS 10.4 preinstalled version of apache (version 1.3.33) , which is started and stopped via System Preferences: Sharing, using the "Personal Web Sharing" checkbox under the "Services" tab.  In MacOS X, the configuration file for this is located at /etc/httpd/httpd.conf

mysql

I installed the binary distribution of MySQL 5.0 for MacOS X (see http://dev.mysql.com/doc/refman/5.0/en/mac-os-x-installation.html) with a single root user and password; once installed, the MySQL server can be started and stopped via System Preferences: MySQL.  If additional MySQL tools are installed, can use Applications: MySQL Tools:MySQL Administrator to set the servername as "localhost" and use port 3306.

python and MySQLdb module

I installed python 2.4.4 in /usr/local/src so as not to disturb the preinstalled python 2.3.5 on MacOS 10.4. (I did not use the very latest version of python, because I needed to ensure compatibility with flamenco-1.0)

I then installed the python-mysql library (MySQL-python-1.2.2) (from http://sourceforge.net/projects/mysql-python).  According to the README, I modified the path to the  mysql_config file in the configuration file named site.cfg before running the install script.  I also installed webware (see http://dotnet.org.za/ncode/archive/2007/01/31/setting-up-mysql-for-python-mysqldb-on-mac-os-x-2.aspx)

mysql install issue: wrong directory path

When testing that the python-mysql library was correctly installed, I came across the following mysql 5.x install issue (see http://forums.mysql.com/read.php?50,106212,157396#msg-157396):  the system expects the file libmysqlclient_r.15.dylib to be at the location:

/usr/local/mysql/lib/mysql/

whereas this file (and others) is actually located at:

/usr/local/mysql/lib/

thus I needed to manually create a directory mysql in /usr/local/mysql/lib/ and copy everything in the lib directory into this new directory for the python-mysql library to function correctly (creating a symbolic link to /usr/local/mysql/lib/ named mysql did not seem to work).

flamenco install issue: modify install script

The Linux flavor of UNIX differs from the MacOS X flavor in a few details, including the available flags for the copy command cp.  Thus I had to modify the install script for flamenco, by changing "cp -a" to "cp -pR" in 2 locations, so the install script would work correctly on MacOS X.

See the modified install script.

importing the example into flamenco

On my system, I used the following commands in Terminal to import the flamenco example:

/usr/local/flamenco/bin/flamenco import /usr/local/src/flamenco-1.0/example

During the import process, I accepted most defaults; I needed to specify the mysql root user and password as part of import.

flamenco cgi script issues

At this point, to test, I started the MacOS X apache web server (and mysql database server) via System Preferences:Sharing and ran the flamenco cgi script in a Firefox 2.x browser by typing in the address:

http://127.0.0.1/cgi-bin/flamenco.cgi

but got the error message:

"The MySQLdb module for Python could not be loaded. Flamenco needs this module in order to work. Please reinstall Flamenco or download the module from SourceForge."

After further investigation to address this issue, I found the solution to be to comment out the try/except lines in flamenco-cgi to avoid the error message.

See the modified cgi script, flamenco_cgi_modified

flamenco cgi script location

I used the MacOS 10.4 preinstalled version of apache; thus needed to copy the (modified) file flamenco.cgi (the original after installation is located at /usr/local/flamenco/bin/flamenco.cgi) to:

/Library/Webserver/Documents/CGI-Executables

running the flamenco example

Here I assume the flamenco example is running on a standalone machine, using the local machine (localhost or 127.0.0.1) to host the flamenco server.

I found that starting instances of flamenco by clicking on the links at:

http://127.0.0.1/cgi-bin/flamenco.cgi

can be problematic; it seems like the incorrect hyperlinks are generated.  Thus I successfully ran a flamenco instance (such as the example) in the following way:

1. Turn on the apache web server and mysql database server using System Preferences.

2. Manually start the flamenco instance in Terminal by typing:

/usr/local/flamenco/bin/flamenco start example

3. Open Firefox browser and enter the address for the start page of the specific flamenco instance, for example:

http://127.0.0.1/cgi-bin/flamenco.cgi/example/Flamenco

4. Test and explore the demonstration.  When finished, manually stop the flamenco instance in Terminal by typing:

/usr/local/flamenco/bin/flamenco stop example

and optionally stop the web and database servers using System Preferences.

 

About this Documentation

This documentation was written by Rajendra Bose on November 8, 2007. The Flamenco team has not attempted to test this information.