Server preparation

Starting point: a clean Ubuntu Server 18.04 installation

Run apt update and apt dist-upgrade to check if your Ubuntu installation is up-2-date.
Restart your server when updates are installed.

Install the following packages with sudo apt install ...

Remove MySQL strict mode as follows:

sudo nano /etc/mysql/conf.d/disable_strict_mode.cnf
[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

Get Cosnics

Follow the installation instructions above (server preparation), so all PHP packages are installed and MySQL is running without strict mode.

Option one: Get Cosnics from Github (latest version, but always in development)

Install the following extra packages:

Go to the folder /var/www and run the following command to get the latest Cosnics code:
git clone https://github.com/cosnics/cosnics.git

Now, go into the folder /var/www/cosnics and run the following command to get all dependencies:
composer install

Option two: Ask for a ZIP or TAR package with a installable Cosnics version

Extract the ZIP file into the folder /var/www

Next step:

Change your apache default website config so the www-root maps to /var/www/cosnics/web:
    DocumentRoot /var/www/cosnics/web

Set proper permissions to the /var/www/cosnics folder, the default Apache user in Ubuntu is www-data:
chown -R www-data:www-data /var/www/cosnics

Install Cosnics

Install Cosnics by going to your server URL.

After a successful installation, run the following commands on the terminal once:
cd /var/www/cosnics
sudo -u www-data php console chamilo:rights:structure:synchronize_locations

Troubleshooting: