Installing MySource Matrix on Ubuntu

Having been through the experience of getting MySource Matrix up and running in on an Ubuntu Linux (8.04) server installation (which took a little bit of effort); I thought I’d document the process so others could use the info. 


Step 1 – Linux Installation

Well I started with an Ubuntu 8.04 server install, selecting the LAMP, OpenSSH and PostgresSQL server options.

Installing Extra Packages that will be required during the install

Some additional packages will need to be installed to handle the installation succesfully.  Running the following commands should take care of this:

sudo apt-get install curl
sudo apt-get install php5-cli
sudo apt-get install php5-pgsql
sudo apt-get install php-pear

PHP Pear Packages Configuration

In addition to some ubuntu packages, you will need some php packages installed as per the matrix prerequisites.

sudo pear install DB Mail Mail_Mime XML_HTMLSax XML_Parser Text_Diff

Step 2 – Database Configuration and Preparation

As per the instructions on the matrix site, we need to prepare the database for the installation of the MySource Matrix product.  Now most of the information that I am using to setup the Postgres installation comes straight from the postgres page on the ubuntu community site:

https://help.ubuntu.com/community/PostgreSQL

Creating the database users

sudo -u postgres createuser -D -P matrix
sudo -u postgres createuser -D -P matrix_secondary

To the prompts regarding superuser and roles, answer no to both questions.  The -P password parameter tells the createuser command that you want to set a password for the user.  Initially I didn’t use the password parameter but found the matrix database installation failed when I used no password (as such, I ended up having to use the psql console to alter the users).

Creating the database

sudo -u postgres createdb -O matrix -E SQL_ASCII mysource_matrix

Installing the PLPGSQL language into the new database

sudo -u postgres createlang plpgsql mysource_matrix

At this stage we should now have the database installed and available for the matrix installation, so let’s get cracking with that.

Step 3 – Matrix MySource Download and Installation

From here, you can pretty much pick up from the matrix installation instructions as per the Squiz site:

http://matrix.squiz.net/resources/installation

There are only a few differences:

  • When changing the ownership of the data and cache directories, use the user and group of “www-data” instead of “apache”.
  • Configuring hosts on apache on Ubuntu can be done better that what is specified in the installation instructions (see below), so I’d recommend having a bit of a read on the apache documentation.  But in essence, what you will probably be doing is creating a config file in the /etc/apache2/sites-available directory and then creating a symbolic link to it in the /etc/apache2/sites-enabled directory.

Step 4 – Leaning up your Machine

If you like me have created a virtual machine for your Matrix install, then you probably want to get rid of some of the extra stuff that has been installed as part of an out-of-the-box Ubuntu server installations (using the installation options I indicated towards the beginning of the article).    Based on the 8.04 version of the install, I performed the following steps to clean up a little:

TO BE COMPLETED…

Some Extra Notes – Port Forwarding with VirtualBox

As I have set up my Matrix install as a VirtualBox virtual machine using NAT networking, it was important to enable port forwarding to enable access to the webserver on the machine (as well as the SSH server).  To assist with this process the following article has some excellent information on how to set this up:

http://www.aviransplace.com/2008/06/12/virtualbox-configuring-port-forwarding-with-nat/

To make this process a little quicker, I created a batch file so I could do take care of things with one command:

SET VBOXPATH=C:Program FilesSunxVM VirtualBox
"%VBOXPATH%VBoxManage" setextradata %1 "VBoxInternal/Devices/pcnet/0/LUN#0/Config/%2/Protocol" TCP
"%VBOXPATH%VBoxManage" setextradata %1 "VBoxInternal/Devices/pcnet/0/LUN#0/Config/%2/GuestPort" %3
"%VBOXPATH%VBoxManage" setextradata %1 "VBoxInternal/Devices/pcnet/0/LUN#0/Config/%2/HostPort" %4

Which allows me to run the following command, instead of having to execute the three separate commands as per the article above:

VBoxPortForward "Local Matrix Server" Apache 8080 8080

One Response to “Installing MySource Matrix on Ubuntu”

  1. Martin says:

    Good Instructions for installing MySource Matrix on Ubuntu Damon, thanks, solved 99% of my install/”bang head against desk” issues, but when I attempted an install recently I found it still generated errors post install related to missing modules.

    I was installing MySource Matrix v3.20.3 on Ubuntu Server 8.10 and following the instructions here: http://matrixstuff.blogspot.com/2009/01/installing-mysource-matrix-on-ubuntu.html I successfully installed it.

    cheers,

    Martin

Leave a Reply