
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/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>
Désactivation du site par défaut :
sudo a2dissite 000-default
Activation du site hébergeant notre LMS :
sudo a2ensite mylms
Redémarrage du démon Apache :
sudo systemctl restart apache2
3. Installation de MariaDB (LAMP 3/4)
sudo apt-get install mariadb-server mariadb-client
4. Configuration de MariaDB (LAMP 3/4)
Par défaut, le plugin unix_socket est actif et permet l’authentification avec les comptes locaux de mêmes noms. En d’autres termes, root-DB utilise root-system pour se connecter aux bases de données.
Si vous souhaitez différencier ces comptes et donc utiliser un mot de passe différent, il vous faudra activer le plugin mysql_native_password, ou encore mieux le plugin ed25519, mais ici nous resterons sur la configuration unix_socket et nous ne définirons pas de mot de passe pour root-DB.
Sécurisation de l’accès aux bases de données.
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!
Création d’une base de données et de son administrateur :
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;
Redémarrage du démon MariaDB :
sudo systemctl restart mariadb
5. Installation de PHP et ses 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. Configuration de PHP (LAMP 4/4)
Configuration de OPcache pour l’optimisation des performances par la mise en cache des scripts PHP compilés :
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
Configuration de PHP spécifique à Claroline :
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. Installation de 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. 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 :