Install MySource Matrix on TurnKey Linux

MySource Matrix is an open source web content management system (CMS). MySource Matrix is intended for use by mid-sized and large organisations rather than for use for smaller systems (i.e. less than 100 pages).

MySource Matrix is different from most other open source content management systems such as Typo3 or Mambo. Many open source CMS follows a Lego style of development philosophy where you start with the core CMS then download and add (like Lego blocks) different bits and pieces (extensions) to build a fully functional site. By comparison, MySource Matrix achieves much of its functionality in the core or in one of a handful of “super” extensions. The Lego approach works well on smaller sites but is less effective where large amounts of content is managed. In MySource Matrix the Asset Listing tool can be used to aggregate different types of content across a system to make:

  • A staff directory
  • An image library
  • A document library
  • A single page that summarises the content of your site
  • A harvest control list
  • An RSS feed
  • A product selection page for shopping

MySource Matrix is ready to use “out-of-the-box”; it does not require users to program the system, rather all functionality can be configured through set up through graphical user interfaces. MySource Matrix is designed to run on a Linux web server, running Apache, PHP and PostgreSQL. Other platforms and databases (eg Oracle) are also supported.

In this tutorial I will explain how to install MySource Matrix using a TurnKey Linux  appliance. TurnKey appliances are based very closely on Ubuntu. With minor exceptions, TurnKey appliances are assembled from unmodified Ubuntu binaries straight from the official Ubuntu repositories.

For our installation we use the LAPP Applicance. The LAPP stack is an open source web platform that can be used to run dynamic web sites and servers. It is considered by many to be a powerful alternative to the more popular LAMP stack and includes Linux, Apache, PostgreSQL (instead of MySQL) and PHP, Python and Perl.

The installation process requires cli access to php, through the php-cli module:

$ apt-get update
$ apt-get install php5-cli

Upgrade PEAR and install the packages, just to be sure they are all there:

pear upgrade PEAR
$ pear install DB
$ pear install Archive_Tar
$ pear install Mail
$ pear install Mail_Mime
$ pear install XML_HTMLSax
$ pear install XML_Parser
$ pear install Text_Diff
$ pear install Mail_Queue
$ pear install HTTP_Request
$ pear install HTTP_Client
$ pear install Net_URL
$ pear install Image_Graph
$ pear install Image_Color
$ pear install Image_Canvas
$ pear install Numbers_Roman
$ pear install Numbers_Words

Next we will do our PostgreSQL Database Setup:

$ su postgres
$ createuser -U postgres matrix
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
$ createuser -U postgres matrix_secondary
Shall the new role be a superuser? (y/n) n
Shall the new role be allowed to create databases? (y/n) n
Shall the new role be allowed to create more new roles? (y/n) n
$ createdb -U postgres -O matrix -E SQL_ASCII mysource_matrix
$ createlang -U postgres plpgsql mysource_matrix
$ su

By default Postgresql uses IDENT-based authentication. IDENT will never allow you to login via -U and -W options.

$ vim /etc/postgresql/8.3/main/pg_hba.conf
local   all         postgres                          trust
# "local" is for Unix domain socket connections only
local   all         all                               trust
sudo /etc/init.d/postgresql-8.4 restart

Now we are ready to begin with the installation of MySource Matrix.

$ apt-get install wget
$ cd /var/www
$ wget
$ tar -zxvf mysource_matrix-3.x.x.tar.gz
$ cd /var/www/mysource_matrix
$ php install/step_01.php /var/www/mysource_matrix

Step 1 of the installation has created two configuration files. These are the main system configuration files and are located at /var/wwww/mysource_matrix/data/private/conf/ and You have to make some modifications to these files.

define('SQ_CONF_DB_DSN', 'pgsql://matrix@unix()/mysource_matrix');
define('SQ_CONF_DB2_DSN', 'pgsql://matrix@unix()/mysource_matrix');
define('SQ_CONF_DB3_DSN', 'pgsql://matrix_secondary@unix()/mysource_matrix');
define('SQ_CONF_DBCACHE_DSN', 'pgsql://matrix@unix()/mysource_matrix');
 'db' => array (
                'DSN' => 'pgsql:dbname=mysource_matrix',
                'user' => 'matrix',
                'password' => '',
                'type' => 'pgsql',
        'db2' => array (
                'DSN' => 'pgsql:dbname=mysource_matrix',
                'user' => 'matrix',
                'password' => '',
                'type' => 'pgsql',
        'db3' => array (
                'DSN' => 'pgsql:dbname=mysource_matrix',
                'user' => 'matrix_secondary',
                'password' => '',
                'type' => 'pgsql',
        'dbcache' => array (
                'DSN' => 'pgsql:dbname=mysource_matrix',
                'user' => 'matrix',
                'password' => '',
                'type' => 'pgsql',
        'dbsearch' => NULL,

The second installation script will initialise the MySource Matrix database schema, creating database tables, views, functions and sequences.

$  php install/step_02.php /var/www/mysource_matrix

The third installation script installs the different types of assets into the system. It also creates some system assets, such as the Trash folder and the root user account.

$ php install/compile_locale.php /home/websites/mysource_matrix
$ php install/step_03.php /home/websites/mysource_matrix
$ php install/compile_locale.php /home/websites/mysource_matrix

Some directories of MySource Matrix require read and write permission for the user that the Apache web server is run as. All other directories should be read-only for the Apache user.

$ chmod -R 755 /var/www/mysource_matrix
$ cd /var/www/mysource_matrix
$ chown -R www-data:www-data data cache
$ chmod -R g+w data cache

Last but not least the Apache configuration:

$ vim /etc/apache2/sites-available/default

The config should look something like this:

<VirtualHost *:80>
DocumentRoot /home/websites/mysource_matrix/core/web
Options -Indexes FollowSymLinks
<Directory /home/websites/mysource_matrix>
  Order deny,allow
  Deny from all
<DirectoryMatch "^/home/websites/mysource_matrix/(core/(web|lib)|data/public|fudge)">
  Order allow,deny
  Allow from all
<FilesMatch "\.inc$">
  Order allow,deny
  Deny from all
<LocationMatch "/(CVS|\.FFV)/">
  Order allow,deny
  Deny from all
Alias /__fudge   /home/websites/mysource_matrix/fudge
Alias /__data    /home/websites/mysource_matrix/data/public
Alias /__lib     /home/websites/mysource_matrix/core/lib
Alias /          /home/websites/mysource_matrix/core/web/index.php/
$ /etc/init.d/apache2 restart

Leave a Reply