How to Install Xibo 1.7.8 on Ubuntu Server 16.04 LTS

Post Reply
User avatar
LHammonds
Site Admin
Site Admin
Posts: 660
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

How to Install Xibo 1.7.8 on Ubuntu Server 16.04 LTS

Post: # 459Post LHammonds
Thu Jul 21, 2016 8:43 am

Greetings and salutations,

I hope this thread will be helpful to those who follow in my foot steps as well as getting any advice based on what I have done / documented.

To discuss this thread, please participate here: Ubuntu Forums >>need to create thread<<

High-level overview

Xibo allows multiple displays to show media contained on multiple different screen layouts on a scheduled basis.

This tutorial will cover how to manually setup a Xibo server which will use a separate dedicated database server.

The server will be installed inside a virtual machine in vSphere running on ESXi servers. Notes will also be supplied for doing the same thing for VirtualBox on a Windows 10 PC. Although there are some VMware-specific and VirtualBox-specific steps, they are very few and the majority of this documentation will work for other Virtual Machines or even directly installed onto a physical machine (e.g. bare-metal install). If you have any advice on doing things better, please let me know by replying to the Ubuntu forums thread above.

Tools utilized in this process
Helpful links

The list below are sources of information that was helpful in the creation of this document.
Assumptions

This documentation will need to make use of some very-specific information that will most-likely be different for each person / location. And as such, this information will be noted in this section. They will be highlighted in red throughout the document as a reminder that you should plug-in your own value rather than actually using these "place-holder" values.

Under no circumstance should you use the actual values listed below. They are place-holders for the real thing. This is just a checklist template you need to have answered before you start the install process.

Wherever you see RED in this document, you need to substitute it for you will use in your environment.
  • Ubuntu Server name: srv-xibo
  • Ubuntu Server IP address: 192.168.107.12
  • Database Server Name (remote): srv-mysql
  • Database Server IP (remote): 192.168.107.20
  • Database Admin ID: root
  • Database Admin Password: rootpass
  • Database ID: xibouser
  • Database Password: xibouserpass
  • Xibo Library Location: /srv/xibo-library
  • Xibo Secret Key: YourSecretXiboKey
  • Email Server Name (remote): srv-mail
  • Email Server IP (remote): 192.168.107.25
  • Ubuntu Admin ID: administrator
  • Ubuntu Admin Password: myadminpass
Xibo Ubuntu Server - Setup an Ubuntu server for use as the Xibo server. This tutorial assumes the server was configured according to this tutorial: How to install and configure Ubuntu Server

MySQL/MariaDB server - Setup a separate and dedicated database server. This tutorial assumes the server was configured according to this tutorial: How to install and configure MariaDB

It is also assumed the reader knows how to use the VI editor. If not, you will need to beef up your skill set or use a different editor in place of it.

User avatar
LHammonds
Site Admin
Site Admin
Posts: 660
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Prerequisites

Post: # 460Post LHammonds
Mon Jul 25, 2016 8:47 am

Partition Changes

We will be using the /srv partition to store the large video files so we will need to increase this partition. We will assume we have an additional 30 GB of space available. Here are the commands to increase the volume to 21 GB and then expand the file system to 20 GB.

Code: Select all

lvextend -L21G /dev/LVG/srv
resize2fs /dev/LVG/srv 20G
Server Name Resolution

You might need to edit your local host file so you can use friendly names for servers if you don't add them to your internal DNS servers.

Edit the local host file by typing vi /etc/hosts and add your servers to the end of the file as needed. Example:
192.168.107.20 srv-mysql 192.168.107.25 srv-mail
Configure MariaDB / MySQL

In this scenario, a dedicated and general-purpose database server already exists and it will be used to hold the application's database.
  1. Connect to the MariaDB/MySQL server using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass) and then temporarily grant yourself super user privileges by typing sudo su
  3. Type the following commands:
    mysql -u root -p Enter password: rootpass
    CREATE DATABASE xibo CHARACTER SET utf8 COLLATE utf8_bin; CREATE USER 'xibouser'@'%' IDENTIFIED BY 'xibouserpass'; GRANT ALL ON xibo.* TO 'xibouser'@'%'; FLUSH PRIVILEGES; exit
    The above commands will allow the database account to connect from any machine from anywhere in the world. This might be OK if your database is not accessible outsite your local network or if your machine name changes or you have multiple servers that connect to the same database that use the same ID. You can make this more secure by specifying your application server when granting access. Make sure the database server will recognize the server name (via hosts file or DNS) or just use the IP address:
    CREATE USER 'xibouser'@'srv-xibo' IDENTIFIED BY 'xibouserpass'; GRANT ALL ON xibo.* TO 'xibouser'@'srv-xibo';
    or
    CREATE USER 'xibouser'@'192.168.107.12' IDENTIFIED BY 'xibouserpass'; GRANT ALL ON xibo.* TO 'xibouser'@'192.168.107.12';
    This will prevent anyone knowing the credentials from logging into the database from any other remote machine not specified in the grant command.

    If your application is running on the database server (typical on a developer machine / non-production scenario), create the user like this:
    CREATE USER 'xibouser'@'localhost' IDENTIFIED BY 'xibouserpass'; GRANT ALL ON xibo.* TO 'xibouser'@'localhost';
    This will prevent anyone knowing the credentials from logging into the database from any other remote machine.

    If you mess anything up, you can remove the database and user by issuing these commands:
    DROP USER xibouser; FLUSH PRIVILEGES; DROP DATABASE xibo;
Binlog Format

If you cannot login but you have the right ID and password, you might need to enable mixed mode binary logging on the database server. Here is how you can change the logging mode if necessary.

Code: Select all

vi /etc/mysql/my.cnf
The default value is as follows even if it does not exist in the config file:

Code: Select all

[mysqld]
binlog-format=STATEMENT
To change to mixed mode, set it as follows:

Code: Select all

[mysqld]
binlog-format=MIXED
And restart the service:

Code: Select all

service mysql restart
Install Apache Web Server
  1. Connect to the server using PuTTY.
  2. At the login prompt, login with your administrator account (administrator / myadminpass) and then temporarily grant yourself super user privileges by typing sudo su
  3. Type the following commands:

    Code: Select all

    apt-get -y install apache2
  4. If you plan on utilizing email functions (and who doesn't!!!), type the following commands:

    Code: Select all

    apt-get -y install php-pear
    pear install mail
    pear install Net_SMTP
  5. Once that is done, open a web browser and go to http://192.168.107.12 and you should see a web page that says "It works!"
Fix ServerName
You might see the following error message in /var/log/apache2/error.log:

Code: Select all

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
To fix this, we need to add the ServerName variable.
  1. Edit or create /etc/apache2/conf-available/servername.conf and add the following line and then save/exit:

    Code: Select all

    ServerName localhost
  2. Now we need to enable it and reload Apache:

    Code: Select all

    a2enconf servername
    service apache2 reload
Install Xibo Prerequisites

At the time of this writing, Xibo only supports the "mysql" library and PHP 7.0 dropped support of "mysql" in favor of just "mysqli" Ubuntu Server 16.04 defaults to PHP 7.0 so we will have to use a different repository to install an earlier version of PHP that did support the old mysql library.
  1. At the server console, type the following:

    Code: Select all

    add-apt-repository ppa:ondrej/php
    apt-get update
    apt-get -y install php5.6 php5.6-gd php5.6-fpm libapache2-mod-php5.6 php5.6-mysql php5.6-mcrypt php5.6-soap php5.6-xml php5.6-zip php5.6-intl php5.6-curl
    a2enmod proxy_fcgi
    systemctl restart apache2
  2. Create a test file with the following commands:

    Code: Select all

    printf '%s\n' '<?php' 'phpinfo();' '?>' > /var/www/html/testphp.php
    chown www-data:root /var/www/html/testphp.php
    chmod 644 /var/www/html/testphp.php
  3. Now visit http://192.168.107.12/testphp.php and see if you get the phpinfo page.
  4. Edit existing php.ini variables and change their values to allow for large file uploads:

    Code: Select all

    vi /etc/php/5.6/apache2/php.ini
    max_execution_time = 200
    post_max_size = 4096M
    upload_max_filesize = 4096M
  5. Restart the Apache web services for the changes to take effect:

    Code: Select all

    systemctl restart apache2

User avatar
LHammonds
Site Admin
Site Admin
Posts: 660
Joined: Fri Jul 31, 2009 6:27 pm
Are you a filthy spam bot?: No
Location: Behind You
Contact:

Install Xibo

Post: # 461Post LHammonds
Mon Jul 25, 2016 10:20 am

  1. Copy the URL of the current release by visiting http://xibo.org.uk/get-xibo/

    Code: Select all

    wget https://github.com/xibosignage/xibo-cms/archive/1.7.8.tar.gz -O /tmp/xibo.tar.gz
    tar xvzf /tmp/xibo.tar.gz -C /var/www/html/ --strip-components=1
    chown www-data:root --recursive /var/www/html
    find /var/www/html/. -type d -exec chmod 755 '{}' \+
    find /var/www/html/. -type f -exec chmod 644 '{}' \+
    rm /tmp/xibo.tar.gz
    mkdir /srv/xibo-library
    chown www-data:root /srv/xibo-library
  2. Visit http://192.168.107.12/
  3. If you are missing any libraries such as "ZIP" you can run the following command to search the repository for available libraries to install:

    Code: Select all

    apt-cache search php zip
  4. If the installation wizard shows all requirements have been met, click Next
  5. Select the "Use an existing database" tab and set the following, then click Next:
    * Check: Use an existing database
    * Host: srv-mysql
    * Database Name: xibo
    * Database Username: xibouser
    * Database Password: xibouserpassword
  6. Xibo Administrator Account - Set the following and click Next:
    * Admin Username: xiboadmin
    * Admin Password: xiboadminpass
  7. Library Location - Set the following and click Next:
    * Library Location: /srv/xibo-library
    * Server Key: YourSecretXiboKey
    * Check: Statistics
  8. Xibo was successfully installed - If you see this screen, login with your xiboadmin user account you just specified.

Post Reply