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 [2016/05/11 11:34]
admin [Adapter le fichier de configuration principal]
local:vmoodle:install [2023/01/31 16:46] (current)
Line 1: Line 1:
-===== Installation ===== +<​html><​!-- nomoodle --></​html>​{{ :​logo-apl.png?​nolink |}}<​html><​!-- /nomoodle --></​html>​ 
-===== VMoodle =====+===== VMoodle ​(local) : Installation=====
  
-'''​Avertissement :'''​ 
  
-La mise en oeuvre et l'​exploitation d'une plate-forme Moodle sous virtualisation applicative nécessite une bonne connaissance du fonctionnement de la plate-forme et une bonne connaissance technique de l'​environnement technique des plates-formes LAMP en général, et d'​autant plus que les fonctions de réseau entre les différentes instances doivent être activées+<​html><​!-- nomoodle ​--></​html>​{{ :vmoodle.png?​nolink&​120}}<​html><​!-- /nomoodle --></​html>​
  
-Edunao peut fournir du conseil en déploiement et en construction de "​constellations"​ de Moodle de grande dimension+====Introduction==== 
 + 
 +:!: ''​Warning :''​ Setting up a virtualized array of moodle assumes you have a good knowledge of moodle administration and installation,​ and a correct background in LAMP application administration.  
 + 
 +ActiveProlearn can provide full support in helping building, setting up and training exploitation staff to master the architecture
  
 ==== Installation ==== ==== Installation ====
  
-Pour virtualiser une plate-forme ​Moodle, vous devez :+What you basically need to virtualize a Moodle ​installation is:
  
-   ​* ​Installer le composant local VMoodle +   ​* ​Install your moodle using a non virtualized codebase as a main moodle instance. 
-   ​* ​Installer le bloc VMoodle +   * Add/Install the VMoodle ​plugin. 
-   ​* ​Configurer le fichier de configuration spécifique de la virtualisation +   ​* ​Add/​Install ​VMoodle ​block and report plugins. 
-   ​* ​Modifier votre fichier standard de configuration+   ​* ​Configure a local/​vmoodle/​vconfig.php on the local/​vmoodle/​vconfig-dist.php base. 
-   ​* ​Modifier quelques fichiers de l'​implémentation du réseau Moodle (pour assurer la stabilité des clefs réseau si vous utilisez le réseau).+   ​* ​Plug in to your main configration script the VMoodle trap sequence
 +   ​* ​Report some patchs in the /mnet implementation if you are planningn using MNET and want to get MNET stable over time.
  
-==== Installer les composants ​====+==== Components installation====
  
-   ​* ​Téléchargez les archives du composant de virtualisation ​(local_vmoodle ​et block_vmoodle) ​et déployez les respectivement dans les répertoires ​'/​local' ​et '/​blocks' ​de votre plate-forme+   ​* ​Download the zips from the repositories ​(local_vmoodleblock_vmoodle ​and report_vmoodleand extract respectively the archives in '/​local'​'/​blocks' ​and '/​report'​ directory in your moodle
-   ​* ​Naviguez dans l'​administration du site pour terminer l'installation ​logique des composants.+   ​* ​Browse to the Administration Notifications to terminate ​installation.
  
-Après l'​installationla virtualisation n'est pas opérationnelleVotre Moodle "​principal"​ continue à fonctionner comme un Moodle normal.+After plugins have been installedyour moodle is still NOT capable to answer to virtual domainsYour virtualized installation keeps working a s standard moodle.
  
-Si vous opérez une version inférieure à 2.8 de Moodle, seul le bloc VMoodle 2.7 doit être installé. Voir l'​entrée [[BlockVMoodle|VMoodle avant 2.8]] pour les détails concernant l'​installation dans cette version.+Note that we DO NOT support any more the pre-28 ​version. 
 +==== Virtualisation file Configuration ====
  
-==== Configurer le fichier de virtualisation ====+This file is located in ''/​local/​vmoodle''​ as ''​vconfig.php''​ and is responsible of the configuration switch. The 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. ​
  
-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).+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.
  
-Le fichier de configuration ​modèle est situé dans le chemin : +In most case, you will simply have to report your main dbsettigns in this file. 
 +==== Update the main configuration ​file of Moodle ====
  
-   <​moodleroot>/​local/​vmoodle/​vconfig-dist.php+The virtualisation trap need to be set in the master configuration of Moodle as any entrance page of moodle will call it at startup.
  
-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.+Updates are needed inorder to: 
  
-==== Adapter le fichier de configuration ​principal ====+   * 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.
  
-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.+Hooking the vconfig.php will be the point where the current ​configuration ​(working database and moodledata volume) will switch.
  
-Les modifications portent sur : +=== Hooking the virtual configuration switch ===
  
-   * Le déroutage de virtualisation +The main point about this hooking is that it MUST be placed before calling the ''​setup.php''​ include in your ''​config.php''​ file.
-   * 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.+   ... {CLI VMoodle Hook} ...
  
-=== Dérouter pour la virtualisation ===+   ​require(</​path/​to/​moodleinstall>/​local/​vmoodle/​vconfig.php'​);​
  
-Cette inclusion doit être placée juste après l'appel au "setup.php" de votre fichier de configuration.+   ​require_once(dirname(__FILE__) . '/lib/setup.php');
  
-   ... {position du déroutage ​CLI} ...+=== Adding the CLI hook ===
  
-   ​require(</​chemin/​vers/​monmoodle>/​local/​vmoodle/​vconfig.php'​);​+**What issue it solves:**
  
-   ​require_once(dirname(__FILE__) ​'/​lib/​setup.php');+Standard cli script just play the operations loading the standard configurationVMoodle 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
  
-=== Mette en place le déroutage ​CLI ===+The CLI VMoodle hooking allows the following process to occur:
  
-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 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.
  
-Ajoutez la séquence suivante avant votre appel à vconfig.ghp :+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 72: 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 moment. Ceci est utile pour certains composants associés à la virtualisation qui doivent reconnaître,​ une fois leur configuration acquise, s'il sont le Moodle principal ou s'ils sont virtuels.+=== Routing the instance domains to the single moodle install ===
  
-   ​$CFG->​user_mnet_hosts_admin_override = true;+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:
  
-Cette clef permet de forcer le bloc [[:Blocks:UserMnetHost|User Mnet Hosts (Mes hôtes du réseau)]] à laisser exceptionnelement passer les administrateurs principaux locaux (compte admin) à travers le réseau. Un exemple courant d'utilisation est après l'appel à vconfig.php :+  * In apache ​Adding ''​ServerAlias''​ clauses to the VHost definition 
 +  * On nginx Adding ​''​servername''​ additional instructions to the ''​server''​ structure routing the moodle root.
  
-   $CFG->user_mnet_hosts_admin_override ​= false;+If you have one single domain for all your moodles and your web server configuration and DNS supports wildcard, you 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; 
 + 
 +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 to. A sample of this settign is possible in vconfig.php : 
 + 
 +   ​$CFG->​forced_plugins_settings['​user_mnet_hosts'​]['​admin_override'​] ​= false;
    if (preg_match('#'​.$CFG->​mainhostprefix.'#',​ $CFG->​wwwroot)) {    if (preg_match('#'​.$CFG->​mainhostprefix.'#',​ $CFG->​wwwroot)) {
-      $CFG->user_mnet_hosts_admin_override ​= true;+      $CFG->forced_plugins_settings['​user_mnet_hosts'​]['​admin_override'​] ​= true;
    }    }
  
-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) ​ê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. 
 + 
 +==== Cron setup in virtualized environements ==== 
 + 
 +=== Using unitary crons for each nodes === 
 + 
 +A Moodle site has unique cron task that performs a lot of distinct delayed and scheduled processings in moodle.  
 + 
 +A standard way of setting up would setup a cron line for each of the virtual moodle an installation contains.  
 + 
 +If you use the HTTP method to run crons, f.e. 
 + 
 +   */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 script, and tell in the command line for which host you are running the script: 
 + 
 +   /​local/​vmoodle/​cli/​cron.php --host=http://​my_virtual.mymoodledomain.com 
 + 
 +You will provide the "​official"​ wwwroot the virtual ​site is attached to. 
 + 
 +=== Using the VCron hyper rotator === 
 + 
 +The VMoodle implementation provides a vcron scheduler that will be lauched in the master moodle host context, and 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 
 + 
 +or in command line 
 + 
 +   sudo -uwww-data php /​root/​to/​moodle/​local/​vmoodle/​cli/​vcron.php 
 + 
 +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. 
 + 
 +----
  
-[[:​Local:​VMoodle|Revenir à l'index du composant]]+<​html><​!-- nomoodle --></​html>​ 
 +[[:​Local:​VMoodle|back to VMoodle component ​index]] ​-  
 + ​[[:​Plugins|Back to plugins]] - [[:​start|Back to catalogue]] 
 +<​html><​!-- /nomoodle --></​html>​
local/vmoodle/install.1462959290.txt.gz · Last modified: 2024/04/04 15:50 (external edit)