Claroline – Installation du serveur (dev) – FR

  • Auteur/autrice de la publication :
  • Post category:Non classé

Claroline Connect est un LMS (Learning management system) Open Source sous licence GPLv3 permettant de créer et d’administrer des formations et des espaces de collaboration en ligne. Il est écrit en PHP et développé par le Centre de Recherche et de Développement de l’ECAM et l’Université Catholique de Louvain. La dernière version fonctionnelle via l’archive est la 7.0.0 (ou 16.05, ancienne numérotation), compatible avec PHP ≤ 7.1. Nous installerons ici la dernière version en développement via Composer / PHP CLI, la 12.4 (nouvelle numérotation), compatible avec PHP ≥ 7.1. Elle est donc compatible avec Debian 10 Buster où PHP est installé en version 7.3 par défaut.

Alternatives Open Source à Claroline Connect :

CE COURS EST DISPONIBLE EN VIDÉO
(VERSION DÉTAILLÉE ET PLUS COMPLÈTE)

Version Française

Comment installer un LMS Open Source – Part 1
Comment installer un LMS Open Source – Part 2

Version Anglaise

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

OBJECTIF

L’objectif de cet article est l’installation et la configuration d’un serveur LAMP7 (Linux Apache 2.4 MariaDB 10.3 PHP 7.3) auto-hébergé Claroline en version 12.4 sur une distribution Linux Debian Buster 10.2 64bits (LAMP 1/4).

SCHEMA LOGIQUE

PRÉREQUIS

1. Prérequis avant réalisation

  • Un serveur Debian Buster 10.2 64 bits fonctionnel (installation basique avec utilitaires usuels du système et service SSH)
  • Packages de base supplémentaires : sudo, dnsutils, git, resolvconf, terminator, tree
  • Domaine utilisé : opensharing.priv

2. Configuration réseau initiale

Serveur Claroline
FQDN mylms.opensharing.priv
Adresse IP 192.168.1.10
Réseau 192.168.1.0/24
Passerelle 192.168.1.1
dns-nameservers 8.8.8.8 8.8.4.4
dns-search opensharing.priv

Contenu initial du fichier /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

Contenu initial du fichier /etc/hosts :

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

Rmq : L’adresse 127.0.1.1 doit être retirée sur un serveur à IP fixe et remplacée par cette dernière, tel que l’exemple ci-dessus.

Contenu initial du fichier /etc/host.conf :

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

Contenu initial du fichier /etc/resolv.conf (généré automatiquement) :

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

Rmq : Le fichier /etc/resolv.conf ne doit pas être édité dès lors que le paquet resolvconf a été installé.

Pour prendre en compte les modifications des fichiers de configuration relatifs au réseau, redémarrage du service réseau et de l’interface réseau configurée en IP fixe :

sudo systemctl restart networking
sudo ifup enp0s3

Vérification de la bonne configuration réseau :

ping 8.8.8.8
dig opensharing.fr

RÉALISATION

1. Installation de Apache (LAMP 2/4)

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

2. Configuration de Apache (LAMP2/4)

Création d’une configuration minimale pour notre LMS

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

   DocumentRoot /var/www/mylmshttps://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. Installation de Node.js 12 et 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. Installation de 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

Rmq : Temps d’exécution : 4 min 4 s avec 4 GB de 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. Première connexion par le Web

http://mylms.opensharing.priv

On accède au front-office :

On peut ensuite se connecter au site :

On accède ainsi à notre back-office :

On peut visualiser ses espaces d’activités :

On peut personnaliser notre site et ajouter nos ressources :