MySource Matrix Resources

Main Content

Installing and Configuring the Squiz Server

Introduction

Some processes within MySource Matrix are quite time and resource intensive, resulting in them running longer than the PHP script execution time limit allows. To avoid this, HIPO jobs run in steps or chunks to process a set number of assets at a time. With the use of the Squiz Server, these processes can be run from start to finish without needing to refresh the browser, and result in a quicker execution time than would normally be possible.

The Squiz Server is part of the module package for MySource Matrix covered by the SSV licence. Please contact your Squiz account manager for access to the Squiz Server, or use our contact us form to contact the Squiz sales team.

Extracting the Archive

You would have received the Squiz Server package as a single gzipped tar archive called squiz_server.tar.gz. You will need to extract the contents of this archive to begin installation. The default and recommended directory for installation is /usr/local.

The following commands assume the file squiz_server_tar-gz exists inside /usr/local.

$ cd /usr/local
$ tar -zxvf squiz_server.tar.gz
File Permissions

Make sure the server has write access to the PID file

/var/run/squiz_server.pid
Squiz server should belong to the same user as the one executing the web server process running MySource Matrix. This will avoid problems with files/directories created by the Squiz Server being inaccessible by the web interface.

If your Squiz Server is running as user apache who is in group www-data the permissions on the PID file should be set like the following

$ chown apache:www-data /var/run/squiz_server.pid

The permissions on all directories in the Squiz Server install should be 755, on files 644. All files and directories have to belong to a user other than the one running the Squiz Server.

EXCEPTION: logs/ should be writable by the Squiz Server process.

Configuring the Squiz Server

Inside the newly created squiz_server directory, there is a sample configuration file called server.conf.example. This file is used to identify each MySource Matrix system that is allowed to use this copy of the Squiz Server. The sample configuration file should should be copied to a file called server.conf and edited to reflect your settings.

$ cd /usr/local/squiz_server
$ cp server.conf.example server.conf
$ vi server.conf

Each system listed in the configuration file must have the following information specified.

  • a unique identifier
  • a system type
  • a home directory
The server.conf.example file contains detailed examples to show you how to correctly set these values, but in a common installation the server.conf file would look like the following.

<?php
$systems = Array(
    'system1' => Array(                                     
        'system_type' => 'MySource3',
        'system_root' => '/home/websites/mysource_matrix',
        ),
    );
?>

Running the Squiz Server

There are two ways of running the Squiz Server, as a System V init script, or as a process managed by the supervise daemon. Which approach to use will depend on your server configuration and is beyond the scope of this guide.

Running Squiz Server as a System V init Script
Please note that this example is correct for RedHat or Mandrake Linux distributions. Other platforms may require tweaking.

In the squiz_server/scripts directory, there is a file called squiz_server.init. Edit this file and change the following settings to match those of your server:

  • PHP - the full path to the PHP CLI command
  • KILL - the full path to the kill command
  • SU - the full path to the su command for running processes as superusers
  • SS_HOME - the location of the Squiz Server installation (/usr/local/squiz_server in the above examples)
  • SS_USER - the user that the Squiz Server will run as
  • PORT - the port that the Squiz Server will listen on
  • LOGFILE - the location where the Squiz Server will store its logs
  • PIDFILE - the location where the Squiz Server will store its process ID file

After the configuration is complete, you can test the Squiz Server is running correctly by issuing the following command:

$ squiz_server.init start

If the process starts up correctly, it is then ready to be added to the boot up process of the system. You will need to copy the squiz_server.init file to the system's init.d directory (usually /etc/init.d) and the run the following commands:

$ chkconfig squiz_server.init --add
$ chkconfig squiz_server.init on
Installing Squiz Server Under Supervise

To start installation of the Squiz Server under the supervise daemon, run the install_supervise.sh script, located in squiz_server/scripts/. Follow the prompts to configure the Squiz Server correctly. Once the script finishes, open the squiz_server/scripts/supervise/run file, and ensure all of the settings are correct. The descriptions for each of the settings is available in the above section, with the exception of WEBUSER, which describes the user the web server runs as.

For the Squiz Server to be found by the Supervise daemon, the path to the 'run' must be symbolically linked under the /service directory. Performing this for the example above would use the following command

$ ln -s /usr/local/squiz_server/scripts/supervise /service/squiz_server
Checking the install
To verify that the squiz server is running and listenning to incoming requests, you can run this command
$ netstat -nlp
You'll get a lengthy output, which should include a line like the following:
tcp  0   0      127.0.0.1:9090      0.0.0.0:*       LISTEN     16310/php
A PHP script listennig on port 9090 on localhost.

Configuring MySource Matrix System to Use the Squiz Server

The final step to get the Squiz Server running is to configure your MySource Matrix system to use the Squiz Server.

To access the Squiz Server configuration screen, follow these steps.

  1. Log into the MySource Matrix administration interface as the root user.
  2. Click on the System Configuration icon in the top-right corner of the interface.
  3. Select Squiz Server Configuration from the drop-down box at the top-right of the screen, just under the Back to bar.
The following options will be presented and must be completed before committing the screen.

  • System Root - the location where the Squiz Server was installed (/usr/local/squiz_server in our example)
  • System ID - the unique identifier specified in server.conf for this MySource Matrix system (system1 in our example)
  • Domain - the domain used to connect to this Squiz Server (localhost for a Squiz Server running on the same server as MySource Matrix)
  • Port - the port that the Squiz Server is listening on
After entering and committing these details, select HIPO Configuration from the drop-down box at the top-right of the screen. Lock this screen and change the Run on Squiz Server option to Yes.

Your MySource Matrix system is now running with the Squiz Server. Check that everything is working correctly by trying out some HIPO jobs, such as acquiring the locks on a page.