Install Squiz Matrix in 10 minutes on Debian 7.0 using Digital Ocean
Sun, Nov. 10, 2013Note: This is an updated guide following in the footsteps of my previous installation guides. This uses Debian 7.0 and the newest 4.18.0 version of Matrix.
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: Digital Ocean
OS: Debian 7.0 32 bit using root user
Matrix: 4.18.0
Install the Essentals
// Update and install needed packages
apt-get update
apt-get install apache2 postgresql-9.1 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 Archive_Tar Mail Mail_Mime Mail_mimeDecode XML_HTMLSax XML_Parser Text_Diff Mail_Queue HTTP_Client HTTP_Request Net_URL Image_Graph-0.8.0 Image_Color Image_Canvas-0.3.4 Numbers_Roman Numbers_Words-0.16.4 pear/MDB2#pgsql I18N_UnicodeNormalizer
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-18-0
Database
// Edit Postgres config
vim /etc/postgresql/9.1/main/pg_hba.conf
// Use trust for both
# Database administrative login by Unix domain socket
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
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">
SetHandler default-handler
</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 by accessing www.yoursite.com/_admin
Comments