Manual:Admin:Settings

 This page provides you with all the settings options to configure Xibo to your environment. Each tab provides a set of forms where you can alter default settings and paths. The items in the boxes provide you with details of your PHP settings on the server with Xibo installed. Settings should only be modified by the administrator of the system, as incorrect settings could cause system stablility issues.  Content this tab allows you to set default content item settings, such as a default lenght and ratio. This helps Xibo if the file does not contain duration information. Default settings sets the default options on some forms to always appear and be applied unless altered. You can also change your time zone in this section. Error tab allows you to alter how Xibo handles errors. You can assign a mailbox to send errors and turn the error and audit lgos on and off. General settings provides details of your current settings in your PHP.ini file on your server. It also allows you to setup whether you are collecting statics off your Xibo displays. Path settings allows you to specify particular directory locations for where Xibo will store and look for items. It also allows you to specify where you have downloaded additional plugins like openflash charts. User this section is important if you intent to use a different authentication module to allow your users to log in to the system you will only need this section if you are familiar with an Ldap authentication module. Install Issues highlights some settings issues that stop some Xibo functions from functioning correctly on your network.

Introduction
When Xibo is running, logs and statistics slowly accumulate on the server and consume disk space. In extreme cases the sheer volume of those records can cause the server interface to slow and become unresponsive.

It's also reassuring to know that if there is a problem with a display and it stops checking in with the Xibo server, you'll be notified by email so you can take action to resolve the problem.

The maintenance script can be scheduled to run periodically and perform background cleanup tasks such as deleting old logs and statistics, and checking the status of the displays.

Prerequisites
In order to send email notifications, your PHP must have a working mail command.

You need to ensure your PHP installation is configured to send mail via a local or remote SMTP server.

Once you have verified that your PHP installation has a working mail command, you can proceed to the next step.

Setup for New Xibo Installations
Xibo server 1.2.0 and later have the maintenance functionality.

New Xibo installations come pre-populated with sane default values for the maintenance script, but with the entire system disabled. You can proceed to the configuration section.

Setup for Xibo Installations < 1.2.0
Only Xibo server versions 1.2.0 and later have this functionality. If you're upgrading your older Xibo server installations to 1.2.0 then you will be prompted to modify the default settings as part of the upgrade process.

If you decide to enable the maintenance script as part of your upgrade, it will automatically be configured to use "protected" mode as this is the most secure option. The other options are discussed in detail below. You should change your Maintenance Key immediately in protected mode as the default key is publicly available and offers no protection.

Configuration
Configuration for the maintenance script can be found in Xibo server at Management -> Settings -> Maintenance tab.

There are several options associated with the maintenance script:
 * Maintenance Enabled (MAINTENANCE_ENABLED)
 * Off - All maintenance functionality is disabled.
 * On - All maintenance functionality is enabled. You can use any of the methods below to call the maintenance script on a schedule without specifying a key.
 * Protected - All maintenance functionality is enabled. You must specify the correct key when calling the maintenance script. This is to prevent unauthorised persons from repeatedly calling the script and generating large amounts of alert email.


 * Maintenance Key (MAINTENANCE_KEY)
 * The secret key required to allow the maintenance script to run when "Maintenance Enabled" is set to "Protected" mode.


 * Email Alerts (MAINTENANCE_EMAIL_ALERTS)
 * Globally enable or disable the sending of email alerts. You can enable/disable alerts for individual displays in Display Management.


 * Alert Timeout (MAINTENANCE_ALERT_TOUT)
 * Globally configure how many minutes after a display lasts connects to the server we should consider it to have a problem and cause an alert to be sent. You can override this default for individual displays in Display Management. You should make sure this time is longer than the collection interval you have configured on your clients to avoid false positive alerts.


 * Email To (mail_to)
 * Who should the alert emails be sent to?


 * Email From (mail_from)
 * Who should the alert emails appear to be from?


 * Log Maximum Age (MAINTENANCE_LOG_MAXAGE)
 * How many days worth of log messages to keep. Logs older than this will be deleted. Set to 0 to keep all logs indefinitely.


 * Statistics Maximum Age (MAINTENANCE_STAT_MAXAGE)
 * How many days worth of statistics to keep. Statistics older than this will be deleted. Set to 0 to keep all statistics indefinitely.

Once you've decided which of the options you want to enable and the parameters required, you need to setup some mechanism for calling the maintenance.php script on a schedule. Skip to the appropriate section for your server below.

If you don't have permission to setup scheduled tasks on your server, you could arrange for a remote computer to call the maintenance.php script.

Windows Scheduled Task
This section is broadly based upon the Moodle Cron documentation available here.
 * Find the php.exe or php-win.exe program on your server. It will be in your PHP installation directory.
 * Setup a Scheduled Task.
 * - Go to Start -> Control Panel -> Scheduled Tasks -> Add Scheduled Task.
 * - Click "Next" to start the wizard:
 * - Click the "Browse..." button and browse to your php.exe or php-win.exe and click "Open"
 * - Type "Xibo Maintenance" as the name of the task and select "Daily" as the schedule. Click "Next".
 * - Select "12:00 AM" as the start time, perform the task "Every Day" and choose today's date as the starting date. Click "Next".
 * - Enter the username and password of the user the task will run under (it doesn't have to be a privileged account at all). Make sure you type the password correctly. Click "Next".
 * - Mark the checkbox titled "Open advanced properties for this task when I click Finish" and click "Finish".
 * - In the new dialog box, type the following in the "Run:" text box: c:\php\php-win.exe -f c:\path\to\xibo\maintenance.php secret Replace secret with your Maintenance Key if you're running in Protected Mode.
 * - Click on the "Schedule" tab and there in the "Advanced..." button.
 * - Mark the "Repeat task" checkbox and set "Every:" to 5 minutes, and set "Until:" to "Duration" and type "23" hours and "59" minutes. If you're Alert Timeouts are less than 5 minutes, you may want to run the maintenance script more often.
 * - Click "OK".


 * Test your scheduled task. You can test that your scheduled task can run successfully by clicking it with the right button and chosing "Run". If everything is correctly setup, you will briefly see a DOS command window while php executes and fetches the cron page and then it disappears. If you refresh the scheduled tasks folder, you will see the Last Run Time column (in detailed folder view) reflects the current time, and that the Last Result column displays "0x0" (everything went OK). If either of these is different, then you should recheck your setup.

Maintenance on Unix Servers
This section is broadly based upon the Moodle Cron documentation available here. There are different command line programs you can use to call the maintenance page from the command line. Not all of them may be available on a given server.

For example, you can use a Unix utility like 'wget':

wget -q -O /dev/null http://example.com/xibo/maintenance.php?key=changeme

Note in this example that the output is thrown away (to /dev/null).

The same thing using lynx:

lynx -dump http://example.com/xibo/maintenance.php changeme > /dev/null

Note in this example that the output is thrown away (to /dev/null).

Alternatively, you can use a standalone version of PHP, compiled to be run on the command line. The disadvantage is that you need to have access to a command-line version of php. The advantage is that your web server logs aren't filled with constant requests to maintenance.php and you can run at a lower I/O and CPU priority.

php /var/www/xibo/maintenance.php changeme

Example command to run at lower priority:

ionice -c3 -p$$;nice -n 10 /usr/bin/php /var/www/xibo/maintenance.php changeme > /dev/null

Running maintenance with crontab
This section is broadly based upon the Moodle Cron documentation available here. Most unix-based servers run a version of cron. Cron executes commands on a schedule.

Modern Linux distributions use a version of cron that reads it's configuration from /etc/crontab. If you have an /etc/crontab, edit it with your favourite editor, otherwise run the following to edit the crontab:

crontab -e

and then adding one of the above commands like:

*/5 * * * * wget -q -O /dev/null http://example.com/xibo/maintenance.php?key=changeme

The first five entries are the times to run values, followed by the command to run. The asterisk is a wildcard, indicating any time. The above example means run the command wget -q -O /dev/null... every 5 minutes (*/5), every hour (*), every day of the month (*), every month (*), every day of the week (*).

The "O" of "-O" is the capital letter not zero, and refers the output file destination, in this case "/dev/null" which is a black hole and discards the output. If you want to see the output of your cron.php then enter its url in your browser.


 * A basic crontab tutorial
 * Online version of the man page

For beginners, "EDITOR=nano crontab -e" will allow you to edit the crontab using the nano editor. Ubuntu defaults to using the nano editor.

Usually, the "crontab -e" command will put you into the 'vi' editor. You enter "insert mode" by pressing "i", then type in the line as above, then exit insert mode by pressing ESC. You save and exit by typing ":wq", or quit without saving using ":q!" (without the quotes). Here is an intro to the 'vi' editor.