Install Xibo on Debian
The recommended install for Xibo is using Docker. I orignally created a guide on how to do it manually on older versions but as of 4.5.0 there have been major changes in how Xibo works. I am expecting more breaking changes in the near future.
I have installed Xibo CMS on Debian Trixie using Apache2 as the web server and enforcing TLS using this configuration. I have completed this using the autogenerated self-signed certificates for TLS (not trusted). You will need to follow another guide for creating public-signed certificates. I recommend using acme.sh for automating certificates.
This guide is updated for installing Xibo CMS 4.5.0.
A local install of QuickChart is not covered in this guide but recommended.
Install Requirements
All of the requirements can be installed using apt.
1
sudo apt install apache2 cron libapache2-mod-{xsendfile,php8.4} mariadb-server mariadb-client nftables php8.4-{cli,gd,xml,mysql,zip,soap,curl,mbstring,zmq,memcached,opcache,mongodb,gnupg} curl
Configure Required Services
Configure Apache2
This enables the necessary apache2 modules and creates a site configuration using vim.
1
2
sudo a2enmod rewrite ssl session headers
sudo vim /etc/apache2/sites-available/xibo-cms.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<VirtualHost *:443>
DocumentRoot "/var/www/cms/web"
ServerName xibo.example.com
ServerAdmin [email protected]
KeepAlive Off
LimitRequestBody 0
XSendFile on
XSendFilePath /var/lib/xibo-cms
SSLEngine on
SSLCertificateFile "/etc/ssl/certs/ssl-cert-snakeoil.pem"
SSLCertificateKeyFile "/etc/ssl/private/ssl-cert-snakeoil.key"
<Directory "/var/www/cms/web">
DirectoryIndex index.php index.html
AllowOverride All
Options -Indexes +FollowSymLinks -MultiViews
Allow from all
Require all granted
</Directory>
Alias /brand /var/lib/xibo-cms/brand
<Directory /var/lib/xibo-cms/brand>
php_admin_value engine Off
Options -Indexes -FollowSymLinks -MultiViews
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
This disables the default site and enables the newly created xibo-cms site configuration.
1
2
sudo a2dissite 000-default.conf
sudo a2ensite xibo-cms.conf
Configure MariaDB
This creates a user named xibo-cms and sets a password in MariaDB. Make sure to change MY_NEW_PASSWORD to your password of choice. First enter mariadb/mysql console by runinng sudo mysql, then run these SQL commands.
1
2
3
4
5
CREATE USER 'xibo-cms'@'localhost' IDENTIFIED BY 'MY_NEW_PASSWORD';
CREATE DATABASE `xibo-cms`;
GRANT ALL PRIVILEGES ON `xibo-cms`.* TO 'xibo-cms'@'localhost';
FLUSH PRIVILEGES;
quit;
Configure PHP
The PHP configuration needs to be modified to allow upload of larger files and a few other parts I pulled from Xibo’s Dockerfile.
1
sudo vim /etc/php/8.4/apache2/php.ini
You need to modify the file to change the following settings. To simplify this you can use sed. See below for those commands.
1
2
3
4
5
6
7
8
9
10
11
12
13
allow_url_fopen = Off
error_reporting = E_ERROR | E_WARNING | E_PARSE
expose_php = Off
max_execution_time = 300
memory_limit = 256M
post_max_size = 2G
session.cookie_secure = Off
session.cookie_httponly = On
session.cookie_samesite = Lax
session.gc_divisor = 100
session.gc_maxlifetime = 1440
session.gc_probability = 1
upload_max_filesize = 2G
And also for cli.
1
sudo vim /etc/php/8.4/cli/php.ini
1
2
3
4
5
6
7
8
allow_url_fopen = Off
error_reporting = E_ERROR | E_WARNING | E_PARSE
expose_php = Off
max_execution_time = 0
memory_limit = 256M
session.gc_divisor = 100
session.gc_probability = 1
upload_max_filesize = 2G
Using sed will replace the necessarry information in the files quickly.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
sed -i "s/allow_url_fopen = .*$/allow_url_fopen = Off/" /etc/php/8.4/apache2/php.ini
sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/8.4/apache2/php.ini
sed -i "s/expose_php = .*$/expose_php = Off/" /etc/php/8.4/apache2/php.ini
sed -i 's/max_execution_time = .*$/max_execution_time = 300/g' /etc/php/8.4/apache2/php.ini
sed -i 's/memory_limit = .*$/memory_limit = 256M/g' /etc/php/8.4/apache2/php.ini
sed -i 's/post_max_size = .*$/post_max_size = 2G/g' /etc/php/8.4/apache2/php.ini
sed -i 's/session.cookie_secure = .*$/session.cookie_secure = Off/g' /etc/php/8.4/apache2/php.ini
sed -i 's/session.cookie_httponly = .*$/session.cookie_httponly = On/g' /etc/php/8.4/apache2/php.ini
sed -i 's/session.cookie_samesite = .*$/session.cookie_samesite = Lax/g' /etc/php/8.4/apache2/php.ini
sed -i "s/session.gc_divisor = .*$/session.gc_divisor = 100/" /etc/php/8.4/apache2/php.ini
sed -i "s/session.gc_maxlifetime = .*$/session.gc_maxlifetime = 1440/" /etc/php/8.4/apache2/php.ini
sed -i "s/session.gc_probability = .*$/session.gc_probability = 1/" /etc/php/8.4/apache2/php.ini
sed -i 's/upload_max_filesize = .*$/upload_max_filesize = 2G/g' /etc/php/8.4/apache2/php.ini
sed -i "s/allow_url_fopen = .*$/allow_url_fopen = Off/" /etc/php/8.4/cli/php.ini
sed -i "s/error_reporting = .*$/error_reporting = E_ERROR | E_WARNING | E_PARSE/" /etc/php/8.4/cli/php.ini
sed -i "s/expose_php = .*$/expose_php = Off/" /etc/php/8.4/cli/php.ini
sed -i 's/max_execution_time = .*$/max_execution_time = 0/g' /etc/php/8.4/cli/php.ini
sed -i 's/memory_limit = .*$/memory_limit = 256M/g' /etc/php/8.4/cli/php.ini
sed -i "s/session.gc_divisor = .*$/session.gc_divisor = 100/" /etc/php/8.4/cli/php.ini
sed -i "s/session.gc_probability = .*$/session.gc_probability = 1/" /etc/php/8.4/cli/php.ini
sed -i 's/upload_max_filesize = .*$/upload_max_filesize = 2G/g' /etc/php/8.4/cli/php.ini
Install Xibo CMS
When I am configuring server software outside of a package manager I always place it under the /srv folder. I will be installing Xibo CMS under /srv/xibo-cms. I will also be creating the library directory for Xibo under /var/lib/xibo-cms/. I open a shell using the www-data user to save on having to change ownership of the files later.
1
2
3
4
5
sudo mkdir /srv/xibo-cms /srv/xibo-xmr /var/lib/xibo-cms
sudo chown www-data: /srv/xibo-cms /var/lib/xibo-cms
cd /srv/xibo-cms
sudo -u www-data -s
curl -OJL https://github.com/xibosignage/xibo-cms/releases/download/4.5.1/xibo-cms-4.5.1.tar.gz
This extracts the contents of the archive without placing it into a folder.
1
2
tar -xzf xibo-cms-4.5.1.tar.gz --strip-components=1
rm xibo-cms-4.5.1.tar.gz
Download the complete xibo-cms archive to extract some extra parts that are required.
1
2
3
curl -OJL https://github.com/xibosignage/xibo-cms/archive/refs/tags/4.5.1.tar.gz
tar -C /var/lib/xibo-cms -xvzf xibo-cms-4.5.1.tar.gz --strip-components=2 xibo-cms-4.5.1/docker/brand
rm xibo-cms-4.5.1.tar.gz
Create the required settings.php file and enter in the database details from earlier.
1
vim /srv/xibo-cms/web/settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
defined('XIBO') or die(__("Sorry, you are not allowed to directly access this page.") . "<br />" . __("Please press the back button in your browser."));
$dbhost = 'localhost';
$dbuser = 'xibo-cms';
$dbpass = 'MY_NEW_PASSWORD';
$dbname = 'xibo-cms';
$dbport = '3306';
define('SECRET_KEY','');
if (file_exists(dirname(__FILE__) . '/settings-custom.php')) {
include_once dirname(__FILE__) . '/settings-custom.php';
}
Add a required random secret key.
1
2
SECRET_KEY=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 8)
/bin/sed -i "s/define('SECRET_KEY','');/define('SECRET_KEY','$SECRET_KEY');/" /srv/xibo-cms/web/settings.php
Initialise the Database
This requires the command you need to run anytime you upgrade.
1
php /srv/xibo-cms/vendor/bin/phinx migrate -c "/srv/xibo-cms/phinx.php"
Add Certificates
This is a new requirement for layout management. I haven’t looked into exactly what it is encrypting but you are unable to manage layouts without them.
1
2
3
4
mkdir -p /var/lib/xibo-cms/certs
openssl genrsa -out /var/lib/xibo-cms/certs/private.key 2048
openssl rsa -in /var/lib/xibo-cms/certs/private.key -pubout -out /var/lib/xibo-cms/certs/public.key
php -r 'echo base64_encode(random_bytes(32)), PHP_EOL;' >> /var/lib/xibo-cms/certs/encryption.key
Set the correct permissions for these certificates.
1
2
chmod 600 /var/lib/xibo-cms/certs/private.key
chmod 660 /var/lib/xibo-cms/certs/public.key
Configure XMR
The binary required for this is not in the xibo-cms package anymore. You need to download it to the /srv/xibo-xmr directory.
1
2
cd /srv/xibo-xmr/
curl -OJL https://github.com/xibosignage/xibo-xmr/releases/download/1.3/xmr.phar
Create XMR Configuration File
1
vim /srv/xibo-xmr/config.json
Enter the following information. You can configure this all with IPv6, which is what I have done on my server.
1
2
3
4
5
6
7
8
{
"sockets": {
"ws": "0.0.0.0:8080",
"api": "0.0.0.0:8081",
"zmq": ["tcp://*:9505"]
},
"debug": true
}
There is other configuration I found but I can’t find anything in the documentation about it.
1
2
3
4
5
6
7
8
{
"debug": true,
"queuePoll": 5,
"queueSize": 10,
"ipv6PubSupport": false,
"relayOldMessages": false,
"relayMessages": false
}
Create XMR service
Exit out of the www-data user shell and create the new systemd unit.
1
2
exit
sudo vim /etc/systemd/system/xibo-xmr.service
Enter the following.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[Unit]
Description=Xibo XMR
After=network.target
[Service]
User=www-data
Group=www-data
ExecStart=/usr/bin/php8.4 /srv/xibo-xmr/xmr.phar
Restart=always
KillMode=process
RestartSec=1
[Install]
WantedBy=multi-user.target
Start the service
1
2
3
sudo systemctl daemon-reload
sudo systemctl enable xibo-xmr.service
sudo systemctl start xibo-xmr.service
Check the status of the xibo-xmr service to confirm it is working.
1
sudo systemctl status xibo-xmr.service
Configure XTR
1
sudo crontab -u www-data -e
Select the editor you prefer and then enter the following line.
1
* * * * * /usr/bin/php8.4 /srv/xibo-cms/bin/xtr.php
Configure Firewall
I have used nftables to configure this. It was installed at the start with apt. I have used the simple ruleset for a server from nftables.org’s wiki.
1
sudo vim /etc/nftables.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
flush ruleset
table inet firewall {
chain inbound_ipv4 {
# accepting ping (icmp-echo-request) for diagnostic purposes.
# However, it also lets probes discover this host is alive.
# This sample accepts them within a certain rate limit:
#
# icmp type echo-request limit rate 5/second accept
}
chain inbound_ipv6 {
# accept neighbour discovery otherwise connectivity breaks
#
icmpv6 type { nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert } accept
# accepting ping (icmpv6-echo-request) for diagnostic purposes.
# However, it also lets probes discover this host is alive.
# This sample accepts them within a certain rate limit:
#
# icmpv6 type echo-request limit rate 5/second accept
}
chain inbound {
# By default, drop all traffic unless it meets a filter
# criteria specified by the rules that follow below.
type filter hook input priority 0; policy drop;
# Allow traffic from established and related packets, drop invalid
ct state vmap { established : accept, related : accept, invalid : drop }
# Allow loopback traffic.
iifname lo accept
# Jump to chain according to layer 3 protocol using a verdict map
meta protocol vmap { ip : jump inbound_ipv4, ip6 : jump inbound_ipv6 }
# Allow SSH on port TCP/22 and allow HTTP(S) TCP/80 and TCP/443
# for IPv4 and IPv6.
tcp dport { 22, 443, 9505, 8080 } accept
# Uncomment to enable logging of denied inbound traffic
# log prefix "[nftables] Inbound Denied: " counter drop
}
chain forward {
# Drop everything (assumes this device is not a router)
type filter hook forward priority 0; policy drop;
}
# no need to define output chain, default policy is accept if undefined.
}
Restart nftables service to apply.
1
sudo systemctl restart nftables.service
Complete Installation
This creates a symlink to /var/www/cms directory to /srv/xibo-cms.
1
sudo ln -s /srv/xibo-cms /var/www/cms
Restart Apache2
1
sudo systemctl restart apache2
You can now browse to the server at the location you configured in the xibo-cms.conf. You will need to configure the settigns following for everything to load properly. In the docker installation it does this with SQL commands. Once you have completed these settings you will need to reload the page.
Web UI Configuration
Connect to the server in a web browser.
Sign in with the default admin username and password which is xibo_admin and password.
Change Admin Password
- Click on the user icon in the top right that says XI.
- Click the pencil/edit icon.
- Enter old and new password.
- Click Save.
Configure Library Location
- Click on Administration on the menu.
- Select Settings.
- Enter
/var/lib/xibo-cmsinto the Library Location field. - Create a random Secret Key for adding Players.
- Click Save.
Configure Displays
- Select Displays from Administration > Settings page.
- Select the Default Folder for new Displays if it is not selected. I have set it to Root Folder.
- Enter http://localhost:8081 for the XMR Private Address. This is the API access and is only needed from the CMS to XMR.
- If you see errors in the even log related to connections to this address, you might need to set it to the IP of the server.
- Enter ws://[IP Address clients can access the server from]:8080 into the XMR WebSocket Address.
- In my example the server is accessible on the local network on 10.0.0.100.
- You can also set it to wss for connections over TLS.
- Enter tcp://[IP Address clients can access the server from]:9505.
- Click Save.
You can now start adding clients.
SMTP Configuration
Install msmtp MTA with apt and create and edit /etc/msmtprc.
1
2
sudo apt install msmtp-mta
sudo vim /etc/msmtprc
Add the following and edit as needed. For more information about msmtp configuration see the debian wiki.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
account cms
host smtp.gmail.com
port 587
auth off
user example
password password
tls on
tls_starttls on
maildomain gmail.com
domain gmail.com
from [email protected]
account default : cms
Enable and start the MTA.
1
2
sudo systemctl enable msmtpd
sudo systemctl start msmtpd
The only way to test is to enable Password Reminder under Administration > Settings > Users > Password Policy. You can now sign out and click on Forgot Password? and send a password reset email.
Upgrading
Backup
The simplest thing to do is to stop apache2 and xibo-xmr service, moving the /srv/xibo-cms directory, and backing up the database.
1
2
3
sudo systemctl stop apache2 xibo-xmr
sudo mv /srv/xibo-cms /srv/xibo-cms.backup
sudo mysqldump xibo-cms > xibo-cms.sql
Create xibo-cms directory and change to it. Download the new version, in this example 4.0.8 extract it and copy back the necessary files. You will also need to delete the install/index.php file to stop a warning from appearing.
Installation
1
2
3
4
5
6
7
sudo mkdir /srv/xibo-cms
sudo chown www-data: /srv/xibo-cms
sudo -u www-data -s
cd /srv/xibo-cms
curl -OJL https://github.com/xibosignage/xibo-cms/releases/download/4.5.1/xibo-cms-4.5.1.tar.gz
tar -xvzf xibo-cms-4.5.1.tar.gz --strip-components=1
cp /srv/xibo-cms.backup/web/settings.php web/
Upgrade the database with this command which must be run from /srv/xibo-cms directory.
1
vendor/bin/phinx migrate -c phinx.php
Start up the services again.
1
2
exit
sudo systemctl start apache2

