local:vmoodle:install

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
local:vmoodle:install [2018/02/21 13:32]
admin [Components installation]
local:vmoodle:install [2023/01/31 16:46] (current)
Line 1: Line 1:
 +<​html><​!-- nomoodle --></​html>​{{ :​logo-apl.png?​nolink |}}<​html><​!-- /nomoodle --></​html>​
 ===== VMoodle (local) : Installation===== ===== VMoodle (local) : Installation=====
  
Line 31: Line 32:
 ==== Virtualisation file Configuration ==== ==== Virtualisation file Configuration ====
  
-Ce fichier permet de définir une première connexion à la base de données qui joue le rôle de registre de virtualisationDans une installation VMoodle classique, c'est la base de données du premier Moodle installé qui contient le registre (table mdl_block_vmoodle)Cependant, il vous est possible ​d'externaliser ce registre et de le gérer dans une autre base de données et une autre application (tant que vous respectez son schéma d'attributs).+This file is located in ''/​local/​vmoodle''​ as ''​vconfig.php'' and is responsible of the configuration switchThe configuration settings allow you to point where the vmoodle definition register is located. Usually you wil use the database of your primary installation to store the main register. It is also possible ​to move this register to another DB instance as long as the name of the table ''​{PREFIX}_local_vmoodle'' ​is conserved
  
-Le fichier de configuration modèle est situé dans le chemin : +A template file is provided as ''<​moodleroot>/​local/​vmoodle/​vconfig-dist.php''​. Copy this file as ''​vconfig.php''​ and change adequate values inside. The ''​vconfig.php''​ could be relocated anywhere in your server as long as the main config.php is able to include it.
  
-   <​moodleroot>/​local/​vmoodle/​vconfig-dist.php+In most case, you will simply have to report your main dbsettigns in this file. 
 +==== Update the main configuration file of Moodle ====
  
-Copiez ce fichier sous le nom vconfig.php dans ce même répertoire (ou dans n'​importe quel endroit où vous savez qu'il sera en sécurité) et renseignez la structure de connexion au registre. Dans une installation classique, ce seront les mêmes données que la connexion définie dans "​config.php"​ de Moodle.+The virtualisation trap need to be set in the master configuration of Moodle ​as any entrance page of moodle will call it at startup.
  
-==== Adapter le fichier de configuration principal ====+Updates are needed inorder to: 
  
-Tout le travail de la virtualisation s'​effectue dans le fichier de configuration ​principal de Moodle qui est toujours le premier fichier invoqué par toute "porte d'​entrée"​ de Moodle.+   * hook the configuration ​switch for standard use 
 +   * add special conditionnality for CLI script (VMoodle enabled scripts) 
 +   * Configure some network related behaviour when using MNET cross-services.
  
-Les modifications portent sur : +Hooking the vconfig.php will be the point where the current configuration (working database and moodledata volume) will switch.
  
-   * Le déroutage de virtualisation +=== Hooking the virtual configuration switch ===
-   * La mise en place du déroutage pour les scripts CLI compatibles +
-   * Des options de comportement de la plate-forme dans le cadre de réseaux de plates-formes.+
  
-le fichier vconfig.php défini précédemment effectue la boucle de reconfiguration virtuelle permettant de changer dynamiquement la base de données et le dossier de fichiers actif.+The main point about this hooking is that it MUST be placed before calling the ''​setup.php''​ include in your ''​config.php''​ file.
  
-=== Dérouter pour la virtualisation ===+   ... {CLI VMoodle Hook} ...
  
-Cette inclusion doit être placée juste après l'​appel au "setup.php" de votre fichier de configuration.+   ​require(</​path/​to/​moodleinstall>/​local/​vmoodle/​vconfig.php');
  
-   ... {position du déroutage CLI} ...+   require_once(dirname(__FILE__) ​'/​lib/​setup.php');
  
-   ​require(</​chemin/​vers/​monmoodle>/​local/​vmoodle/​vconfig.php'​);​+=== Adding the CLI hook ===
  
-   ​require_once(dirname(__FILE__) . '/​lib/​setup.php'​);​+**What issue it solves:**
  
-=== Mette en place le déroutage ​CLI ===+Standard cli script just play the operations loading the standard configuration. VMoodle switches the configuration dynamically analysing the current HTTP required hostname or URL. In CLI mode you do NOT have this information in the execution environment and the admin needs to provide it in some way. 
  
-Le déroutage des scripts ​CLI permet de jouer une partie du fichier de configuration,​ puis rendre la main au script CLI appelant, recevoir l'​hôte cible dans les paramètres de ligne de commande, puis revenir enfin rejouer la configuration complète sur la nouvelle configuration virtualisée.+The CLI VMoodle hooking allows the following process to occur:
  
-Ajoutez la séquence suivante avant votre appel à vconfig.ghp :+   * The CLI script starts and loads an incomplete moodle configuration (just getting the vmoodle register db description),​ 
 +   * The script receives the command line parameters in which a ''​--host''​ additional option has been added. 
 +   * The script reloads the full configuration file till the end, activating the virtualistion switch. 
 + 
 +Add the following code to your ''​config.php''​ file before including ''​vconfig.ghp''​:
  
    // this fragment will trap the CLI scripts trying to work for a virtual node, and    // this fragment will trap the CLI scripts trying to work for a virtual node, and
Line 74: Line 80:
    }    }
  
-=== Clefs de configuration techniques ayant un impact sur le fonctionnement de VMoodle ===+**Important** : Only adapted CLI script will be able to process data in virtual submoodles. Most of the standard admin scripts have been adapted and are provided in the ''/​local/​vmoodle/​cli''​ directory. In additions we added for each standard script a ''​bulk''​ script for launching each script on the complete register.
  
-   $CFG->​mainhostprefix = 'http://​physique.monmoodle';+Note : use the ''​--help'' ​command-line attribute to see the options. ​
  
-Cette clef permet d'expliciter quel est le Moodle principal à tout momentCeci est utile pour certains composants associés à la virtualisation qui doivent reconnaître,​ une fois leur configuration ​acquises'il sont le Moodle principal ou s'ils sont virtuels.+=== Routing the instance domains to the single moodle install === 
 + 
 +As the physical install is unique, tou will have to configure your apache or nginx virtual hosts to converge to this single location. The easiest way to do so is: 
 + 
 +  * In apache : Adding ​''​ServerAlias''​ clauses to the VHost definition 
 +  * On nginx : Adding ''​servername''​ additional instructions to the ''​server''​ structure routing the moodle root. 
 + 
 +If you have one single domain for all your moodles and your web server ​configuration ​and DNS supports wildcardyou can wildcard the subdomain as ''​*.mymoodles.edu''​ for convenience.  
 + 
 +=== Global configuration keys having an influence on the VMoodle behaviour === 
 + 
 +   ​$CFG->​mainhostprefix = '​http://​someprefixthatmatchsmymainmoodle';​ 
 + 
 +This key allows any instance to know which host matches the master install of moodle. We use this for some features such as f.e. identifying who is the "​master network admin account"​ of the whole plant.
  
    ​$CFG->​forced_plugins_settings['​user_mnet_hosts'​]['​admin_override'​] = true;    ​$CFG->​forced_plugins_settings['​user_mnet_hosts'​]['​admin_override'​] = true;
  
-Cette clef permet de forcer le bloc [[:​Blocks:​UserMnetHosts|User Mnet Hosts (Mes hôtes du réseau)]] à laisser exceptionnellement passer les administrateurs principaux locaux (compte ​admin) à travers le réseauUn exemple courant d'​utilisation est après l'​appel à vconfig.php :+This key will allow to force the [[:​Blocks:​UserMnetHosts|User Mnet Hosts]] ​blocks to let the local admins go through the network links. Usually we will forbid local subadmins to roam, but the master global ​admin should be able toA sample of this settign is possible in vconfig.php :
  
    ​$CFG->​forced_plugins_settings['​user_mnet_hosts'​]['​admin_override'​] = false;    ​$CFG->​forced_plugins_settings['​user_mnet_hosts'​]['​admin_override'​] = false;
Line 89: Line 108:
    }    }
  
-Dans cette configuration, ​seul l'​administrateur ​local de la plate-forme principal pourra visiter les autres plates-formesLes administrateurs locaux des Moodle virtuels se verront afficher un refus de circuler. La raison de cette précaution est que la circulation des utilisateurs réplique les comptes dans les plates-formes visitées. Ceci peut conduire à de nombreuses confusions que de détenir dans toutes les plates-formes les administrateurs locaux de toutes les autres.+Using this configuration, ​the master moodle admin will be allowed to roam to any submoodle. The local subadmins will notAs roaming to aénother moodle creates an image of the user account, mulitplying the admin account could lead to some confusing states.
  
    ​$CFG->​mnetsiteadmins = true;    ​$CFG->​mnetsiteadmins = true;
        
-Cette clef permet de modifier le comportement de la pile MNET en autorisant des comptes externes (réseau) a être administrateurs de site localement  ​+This key allows remote users to become ​site administrators of the local moodle. This is forbidden by standard Mnet rules but VMoodle implementation propose patchs to override.
  
-==== Mise en oeuvre du cron virtualisé ​====+==== Cron setup in virtualized environements ​====
  
-=== Mise en place à partir de cron simples ​===+=== Using unitary crons for each nodes ===
  
-Un plate-forme ​Moodle ​fonctionne avec une tâche ​cron associée qui effectue tout un ensemble de tâches automatiques et cadencées sur les données de Moodle+Moodle ​site has a unique ​cron task that performs a lot of distinct delayed and scheduled processings in moodle
  
-La mise en oeuvre de plates-formes virtualisées nécessite également de mettre en oeuvre ces tâches pour chacune des instances virtuelles qui sont créées dans la virtualisation+A standard way of setting up would setup a cron line for each of the virtual moodle an installation contains
  
-En HTTP, vous pouvez enregistrer vos tâches cron sur les domaines d'​exploitation propres de vos instances, comme vous le feriez pour des plates-formes standardPar contre, pour une mise en oeuvre par script serveur utiliser le script standard /​admin/​cli/​cron.php n'est pas possible, car ce type d'​appel ne fournit aucune informations permettant au basculement virtuel de se faire+If you use the HTTP method to run cronsf.e.
  
-Pour obtenir un basculement effectif de l'instance de serviceutilisez à la place le script : +   */10 * * * * wget -O /dev/null -q http://​virtual1.mymoodles.edu 
 + 
 +then you can register as many ''​wget''​ calls pointing all your subdomains, as yo'll do for independant standard moodles. If you use the command line method you will have to run the VMoodle enabled cron scriptand tell in the command line for which host you are running the script:
  
    /​local/​vmoodle/​cli/​cron.php --host=http://​my_virtual.mymoodledomain.com    /​local/​vmoodle/​cli/​cron.php --host=http://​my_virtual.mymoodledomain.com
  
-en précisant explicitement la racine ​wwwroot ​que vous voulez adresser.+You will provide the "​official" ​wwwroot ​the virtual site is attached to.
  
-=== Utilisation de l'​ordonnanceur de cron ===+=== Using the VCron hyper rotator ​===
  
-VMoodle ​fournit en plus un ordonnanceur de cron qui est lancé sur l'​installation principaleet est capable de faire "​tourner"​ automatiquement le déclenchement des crons virtuels de toutes les instancesVous pouvez utiliser ce script en mode HTTP ou en mode script ​+The VMoodle ​implementation provides a vcron scheduler that will be lauched in the master moodle host contextand will automatically rotate and schedule all submoodle ​crons. ​VCron scheduler can operate using HTTP calls or command line execs (internally configured) and can itself be invoked through ​HTTP: 
  
    wget http://​main.mymoodledomain.com/​local/​vmoodle/​vcron.php    wget http://​main.mymoodledomain.com/​local/​vmoodle/​vcron.php
  
-ou+or in command line
  
    sudo -uwww-data php /​root/​to/​moodle/​local/​vmoodle/​cli/​vcron.php    sudo -uwww-data php /​root/​to/​moodle/​local/​vmoodle/​cli/​vcron.php
  
-La fréquence de rotation de l'​ordonnanceur de cron doit être très rapide afin de permettre que chaque site virtuel soit activé suffisamment souvent+You may internally configure the vcron settings to raise the number of virtual moodle processed per cron run.
  
 +the basic calculation for vcron rotation is : 
  
-----+With a "run per turn" of 1 and 20 virtual moodles and a cron period of 1 minute per turn, each vmoodle will be processed once per 20 minutes. Raising the "run per turn" to 2 will divided the effective cron period to 10 minutes per vmoodle instance.
  
 +For very large moodle arrays, it may be worth having a separated machine to process the crons for all the moodle instances. Cron processes may ovelap one on each other, but will not pull down theusual user's page distribution too much. 
 +
 +A very advanced feature (undocumented here) allow to distribute the vcron scheduling on several clusters.
 +
 +----
  
 <​html><​!-- nomoodle --></​html>​ <​html><​!-- nomoodle --></​html>​
local/vmoodle/install.1519216337.txt.gz · Last modified: 2024/04/04 15:50 (external edit)