Blog

Install Squiz Matrix in 10 minutes on Debian 6.0

Tue, Jul. 24, 2012

If you have ever been confused or overwhelmed by the thought of installing Squiz Matrix, worry no more. Use this simple guide and you will have Matrix up and running in 10 minutes.

Hosting: Linode
OS: Debian 6.0 using root user
Matrix: 4.10.0

Install the Essentals

// Update and install needed packages
apt-get update
apt-get install apache2 postgresql-8.4 php5 php5-cli php5-pgsql php-pear php5-curl php5-ldap php5-gd postfix cvs curl vim postfix

PEAR

// Update and install PEAR packages
pear upgrade PEAR
pear install MDB2 Mail Mail_Mime XML_HTMLSax XML_Parser Text_Diff HTTP_Client Net_URL I18N_UnicodeNormalizer Mail_mimeDecode Mail_Queue HTTP_Request Image_Graph-0.8.0 Image_Color Image_Canvas-0.3.4 Numbers_Roman Numbers_Words-0.16.4 pear/MDB2#pgsql

Install Matrix

// Create Folder to hold Matrix
mkdir /home/websites
cd /home/websites
// Checkout and install Matrix
curl -O http://public-cvs.squiz.net/cgi-bin/viewvc.cgi/mysource_matrix/scripts/dev/checkout.sh?view=co
mv checkout.sh\?view\=co checkout.sh
sh checkout.sh mysource_4-10-0

Database

// Edit Postgres config
vim /etc/postgresql/8.4/main/pg_hba.conf
// Use trust for both
# Database administrative login by UNIX sockets
local all postgres trust
# "local" is for Unix domain socket connections only
local all all trust
// Restart Postgres
/etc/init.d/postgresql restart
// Create users and DB
createuser -SRDU postgres matrix
createuser -SRDU postgres matrix_secondary
createdb -U postgres -O matrix -E UTF8 squiz_matrix
createlang -U postgres plpgsql squiz_matrix

Init Matrix

// Init the main config
cd /home/websites/squiz_matrix
php install/step_01.php /home/websites/squiz_matrix
// Edit the main config file
vim data/private/conf/main.inc
// The following configuration settings need to be completed as a minimum
SQ_CONF_SYSTEM_ROOT_URLS
SQ_CONF_DEFAULT_EMAIL
SQ_CONF_TECH_EMAIL
// Edit Database file
vim data/private/conf/db.inc
// Update the PHP array
$db_conf = array (
       'db' => array (
          'DSN' => 'pgsql:dbname=squiz_matrix',
          'user' => 'matrix',
          'password' => '',
          'type' => 'pgsql',
          ),
       'db2' => array (
          'DSN' => 'pgsql:dbname=squiz_matrix',
          'user' => 'matrix',
          'password' => '',
          'type' => 'pgsql',
          ),
       'db3' => array (
          'DSN' => 'pgsql:dbname=squiz_matrix',
          'user' => 'matrix_secondary',
          'password' => '',
          'type' => 'pgsql',
          ),
       'dbcache' => NULL,
       'dbsearch' => NULL,
       );

return $db_conf;

// Init database schema
php install/step_02.php /home/websites/squiz_matrix
// Install core asset types
php install/compile_locale.php /home/websites/squiz_matrix
php install/step_03.php /home/websites/squiz_matrix
php install/compile_locale.php /home/websites/squiz_matrix

Fix Permissions

chmod -R 755 /home/websites/squiz_matrix
cd /home/websites/squiz_matrix
chown -R www-data:www-data data cache
chmod -R g+w data cache

Apache

// Edit apache virtual hosts file
vim /etc/apache2/sites-enabled/000-default

<VirtualHost *:80>
ServerName server.example.com
DocumentRoot /home/websites/squiz_matrix/core/web

Options -Indexes FollowSymLinks

<Directory /home/websites/squiz_matrix>
Order deny,allow
Deny from all
</Directory>
<DirectoryMatch "^/home/websites/squiz_matrix/(core/(web|lib)|data/public|fudge)">
Order allow,deny
Allow from all
</DirectoryMatch>
<DirectoryMatch "^/home/websites/squiz_matrix/data/public/assets">
php_flag engine off
</DirectoryMatch>

<FilesMatch "\.inc$">
Order allow,deny
Deny from all
</FilesMatch>
<LocationMatch "/(CVS|\.FFV)/">
Order allow,deny
Deny from all
</LocationMatch>

Alias /__fudge /home/websites/squiz_matrix/fudge
Alias /__data /home/websites/squiz_matrix/data/public
Alias /__lib /home/websites/squiz_matrix/core/lib
Alias / /home/websites/squiz_matrix/core/web/index.php/
</VirtualHost>

// Restart apache
/etc/init.d/apache2 restart

Cron Setup

// Edit apache user cron file
crontab -u www-data -e
// Add cron jobs
*/15 * * * * php /home/websites/squiz_matrix/core/cron/run.php
0 0 * * * /home/websites/squiz_matrix/scripts/session_cleanup.sh /home/websites/squiz_matrix
*/15 * * * * php /home/websites/squiz_matrix/packages/bulkmail/scripts/run.php

Login to Matrix

Now login to Matrix using root for the username and password.

Nicholas Hubbard
Owner

Comments

Lockie
Jul 26, 2012
Awesome stuff Nic! I got it installed on a new Linode server following these instructions. Working well, though I was getting a 403 and had to change apache to "Allow from all" instead of deny - I'm sure this is a security problem. Any help?
Nic Hubbard
Jul 26, 2012
Hmm, there shouldn't be a reason why you would have to chance any of the apache stuff. The virtual host block comes straight from the Squiz website. Did you make sure to run the permissions steps?
Suren
Jul 27, 2012
Brilliant work mate! im going to try these steps myself...looks too simple ;-)
Lockie
Jul 29, 2012
Thanks Nic. Turns out I had my apache config slightly wrong to begin with. All working a treat now. Cheers.
Ash
Jul 31, 2012
Perfect guide! I followed the steps exactly and had the Matrix up on a cloud server with Debian 6.0 in no time. No issues here. Thanks heaps Nic.
Nicholas Hubbard
Oct 4, 2012
No problem, happy to help!
nick
Oct 4, 2012
Really nice tutorial, simple to follow with no really big dramas! I am having one little issue with my install however... When adding nested content to a paint layout the page refreshes but the nested content doesn't "stick". I have been reading a number of posts around this that i believe you have been apart of. The post mention increasing some suhosin settings (maxnamelength and a couple of other similar settings). I have made these changes and am still having the issue mentioned above. Any idea what else i may need to look into? Once again, thank you for the tutorial! Really appreciate posts like this.
Nicholas Hubbard
Oct 4, 2012
Have you made sure to restart Apache after your changes to the Suhosin config?
Ash
Oct 25, 2012
Any chance of a follow up guide that shows how to upgrade versions, using a system that you have set up from this guide? Would be pretty awesome :)
Nicholas Hubbard
Oct 25, 2012
I would be happy to do another guide. Do you mean instructions other than using the upgrade scripts provided by Squiz? That is what I always use.
Ash
Oct 29, 2012
I tried using the Squiz Manuals as a guide and maybe its because I'm special, but the upgrade caused errors going from 4.10.0 to 4.10.3 on a local VM. I thought following steps that you provide will probably be a lot easier to understand if it is in similar format to this tutorial.
Nicholas Hubbard
Nov 2, 2012
Ah I see. Let me see if I can schedule out some time to write up a new tutorial about upgrading.
Monty
May 13, 2013
Hi At first many thanks for such a clean article. I followed the instruction in my home Debian 6 (Squeeze). But when I am trying to get in to Admin interface then it is generating error Asset "session handler_default" is not installed on the system. Can you please
Andrew
Nov 8, 2013
Hi Nic, I just wondered if this tutorial was still valid? I worked on Squiz Matrix for five years and would like to get back into it by installing my own copy but the old Squiz Suite website doesn't seem to be running now. I wondered if they'd changed their 'open source' policies and that may affect the installation procedure above.
Nicholas Hubbard
Nov 10, 2013
Yeah, this guide should still be valid, but I will be writing a new one for Debian 7.0 using Digital Ocean. Squiz Matrix is definitely still open-source. They just moved all the info over the to manuals site.
Darren
Apr 6, 2016
Hi Nic, I have just tried to install this on a brand new Debian 8.4.0 (64-Bit) operating system but it failed. Some points below in case others are also trying at some stage. The version of postgres has stopped being supported. I changed it to 9.4 to get it to work as follows: apt-get install apache2 postgresql-9.4 php5 php5-cli php5-pgsql php-pear php5-curl php5-ldap php5-gd postfix cvs curl vim postfix The instructions seemed to be fine again until I tried to check out the source code. Their source repository seems to have stopped serving? I get the error: curl: (6) Could not resolve host: public-cvs.squiz.net Do you have any tips? Have you made any progress on the newer version of the instructions? Thanks in advance, Darren
Nicholas Hubbard
Apr 6, 2016
Squiz no longer has a public repository for Matrix, it is all on github now and you have to have permission to use it. It isn't like it used to be...

Add Comment