Claroline – Server installation (dev) – EN

Claroline Connect is an Open Source LMS (Learning Management System) licensed under GPLv3 to create and administer online training and workspaces. It is written in PHP and developed by the Research and Development Center of ECAM and the Catholic University of Louvain. The latest functional version via the archive is 7.0.0 (or 16.05, old numbering), compatible with PHP ≤ 7.1. We will install here the latest version in development via Composer / PHP CLI, 12.4 (new numbering), compatible with PHP ≥ 7.1. It is therefore compatible with Debian 10 Buster where PHP is installed in version 7.3 by default.

Open Source alternatives to Claroline Connect :

THIS COURSE IS AVAILABLE IN VIDEO
(DETAILED AND MORE COMPLETE VERSION)

English version

How to install an Open Source LMS – Part 1
How to install an Open Source LMS – Part 2

GOAL

The goal of this article is the installation and configuration of Claroline 12.4 on a self-hosted LAMP7 server (Linux Apache 2.4 MariaDB 10.3 PHP 7.3) on the Debian Buster 10.2 64-bit Linux distribution (LAMP 1/4).

LOGICAL DIAGRAM

PREREQUISITES

1. Prerequisites before setting up

  • A functional Debian Buster 10.2 64-bit server (basic installation with usual system utilities and SSH service)
  • Additional basic packages : sudo, dnsutils, git, resolvconf, terminator, tree
  • Domain used : opensharing.priv

2. Initial network configuration :

Claroline server
FQDN mylms.opensharing.priv
IP address 192.168.1.10
Network 192.168.1.0/24
Gateway 192.168.1.1
dns-nameservers8.8.8.8 8.8.4.4
dns-search opensharing.priv

Initial content of the file /etc/network/interfaces :

sudo nano /etc/network/interfaces
auto lo
iface lo inet loopback

allow-hotplug enp0s3
iface enp0s3 inet static
	address 192.168.1.10
	netmask 255.255.255.0
	network 192.168.1.0
	broadcast 192.168.1.255
	gateway 192.168.1.1
	dns-search opensharing.priv
	dns-nameservers 8.8.8.8 8.8.4.4

Initial content of the file /etc/hosts :

sudo nano /etc/hosts
127.0.0.1       localhost.localdomain                   localhost
192.168.1.10    mylms.opensharing.priv                  mylms

Note : The loopback address 127.0.1.1 must be removed on a fixed IP server and replaced by the latter, such as the example above.

Initial content of the file /etc/host.conf :

sudo nano /etc/host.conf
order hosts, bind
multi on

Initial content of the file /etc/resolv.conf (generated automatically) :

cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 8.8.8.8
nameserver 8.8.4.4
search opensharing.priv

Notes : The file /etc/resolv.conf should not be edited once the resolvconf package has been installed.

To take into account the changes to the configuration files related to the network, restart the network service and the network interface configured as fixed IP:

sudo systemctl restart networking
sudo ifup enp0s3

Verifying the correct network configuration:

ping 8.8.8.8
dig opensharing.fr

RÉALISATION

1. Installing Apache (LAMP 2/4)

sudo apt-get update
sudo apt-get upgrade
apt-get install apache2 apache2-doc

2. Configuring Apache (LAMP2/4)

Creating a minimal configuration for our LMS :

sudo nano /etc/apache2/sites-available/mylms.conf
<VirtualHost *:80>

   DocumentRoot /var/www/mylms/web/
   ServerName mylms.opensharing.priv

   <Directory /var/www/mylms/web/>
        Options -Indexes +FollowSymlinks +MultiViews
        AllowOverride All
        Require all granted
   </Directory>

   ErrorLog /var/log/apache2/mylms.error.log
   CustomLog /var/log/apache2/mylms.access.log combined

</VirtualHost>

Disabling the default site:

sudo a2dissite 000-default

Activation of the site hosting our LMS:

sudo a2ensite mylms

Restarting the Apache daemon :

sudo systemctl restart apache2

3. Installing MariaDB (LAMP 3/4)

sudo apt-get install mariadb-server mariadb-client

4. Configuring MariaDB (LAMP 3/4)

By default, the unix_socket plugin is active and allows authentication with local accounts of the same names. In other words, root-DB uses root-system to connect to databases.
If you want to differentiate these accounts and therefore use a different password, you will have to activate the plugin mysql_native_password, or even better the plugin ed25519, but here we will stay on the configuration unix_socket and we will not define a password for root- DB.

Securing access to databases :

sudo mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] n
 ... skipping.

By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] Y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] Y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] Y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] Y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

Creating a database and its administrator:

sudo mysql -u root
> CREATE DATABASE IF NOT EXISTS mylmsdb CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
> CREATE USER mylmsadmin@localhost IDENTIFIED BY "mylmsadminpw";
> GRANT ALL PRIVILEGES ON mylmsdb.* TO mylmsadmin@localhost;
> FLUSH PRIVILEGES;
> SHOW DATABASES;
> QUIT;

Restarting the MariaDB daemon :

sudo systemctl restart mariadb

5. Installing PHP and its modules (LAMP 4/4)

sudo apt-get install php php-apcu php-bcmath php-bz2 php-curl php-fpm php-gd php-geoip php-gmp php-imagick php-intl php-ldap php-mbstring php-memcached php-msgpack php-mysql php-pear php-soap php-xml php-xmlrpc php-zip libapache2-mod-php imagemagick

6. Configuring PHP (LAMP 4/4)

Configuring OPcache for performance tuning by caching compiled PHP scripts :

sudo nano /etc/php/7.3/mods-available/opcache.ini
opcache.memory_consumption=128
opcache.interned_strings_buffer=8
opcache.max_accelerated_files=16229
opcache.revalidate_freq=60
opcache.fast_shutdown=1
opcache.enable_cli=1

Claroline specific PHP configuration :

sudo nano -c /etc/php/7.3/apache2/php.ini
ligne  380
ligne  401
ligne  956
ligne 1795
max_execution_time = 60
memory_limit = 256M
date.timezone = 'Europe/Paris'
opcache.enable = 1

7. Installing Composer

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
All settings correct for using Composer
Downloading...

Composer (version 1.9.1) successfully installed to: /usr/local/bin/composer
Use it: php /usr/local/bin/composer

8. Installing Node.js 12 and NPM 6

curl -sL https://deb.nodesource.com/setup_12.x | sudo bash -
sudo apt-get install -y nodejs
nodejs --version

v12.13.1

npm --version

6.12.1

9. Installing Claroline

sudo mkdir /var/www/mylms/

mkdir: created directory ‘/var/www/mylms/’

sudo chown -v www-data:www-data /var/www/{,mylms}

changed ownership of ‘/var/www/’ from root:root to www-data:www-data
changed ownership of ‘/var/www/mylms’ from root:root to www-data:www-data

sudo -u www-data git clone https://github.com/claroline/Claroline /var/www/mylms/

Cloning into ‘/var/www/mylms’…
remote: Enumerating objects: 25, done.
remote: Counting objects: 100% (25/25), done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 70146 (delta 15), reused 1 (delta 1), pack-reused 70121
Receiving objects: 100% (70146/70146), 13.94 MiB | 4.53 MiB/s, done.
Resolving deltas: 100% (39908/39908), done.

cd /var/www/mylms/
sudo -u www-data php scripts/configure.php

Please provide a value for the following parameters:
database_host (localhost):
database_name (claroline): mylmsdb
database_user (root): mylmsadmin
database_password: mylmsadminpw
secret (change_me): mysecret
Config file app/config/parameters.yml written

sudo -u www-data composer update --prefer-dist --no-dev

Note : Execution time : 4 min 4 s with 4 GB of RAM

sudo -u www-data npm install
sudo -u www-data composer build
sudo -u www-data php app/console claroline:install
sudo -u www-data php app/console claroline:user:create -a

first name: John
last name: Doe
username: mylmsadmin
password: mylmsadminpw
email: admin@opensharing.priv

sudo systemctl restart mariadb
sudo systemctl restart apache2

10. First connection via the Web

http://mylms.opensharing.priv

The front-office can be accessed :

We can then connect to the site :

And the back office is displayed :

We can visualize our workspaces :

We can personalize our site and add our resources :

Fermer le menu
error

Si vous aimez ce site, partagez-le !

Facebook75
Twitter65
YouTube19
YouTube