Install Squiz Matrix in 10 minutes on Debian 6.0
Tue, Jul. 24, 2012If 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.
Comments