Jump to navigation Jump to search

Installing Moodle on 5.0-Nano

1,513 bytes added, 19:02, 20 December 2009
no edit summary
<span id="top"></span>
{| cellpadding="2"
|__TOC__||'''Installing Moodle on 5.0-NanoSeries'''
This step-by-step guide shows how to install Moodle on Uniform Server V5.0-Nano. In addition shows how to resolve fixed paths allowing Moodle to be run from a USB memory stick.
Windows does not support true cron jobs however V5.0-Nano has an integrated portable Cron catering for both hard drive and USB memory stick installations.
== Pre-Installation ==
# '''A)''' Create a new folder named '''moodle_b''' (Can be any name)
# Extract a new copy of Uniform Server V5.05-Nano to this folder<br>(Double click on file to extract).
'''''Download Moodle'''''
Admin login
* Username: ''' bossadmin'''* Password: '''fred123UniServer-54'''
'''''[[#top | Top]]'''''
Its a small file locate the following three lines (yours may be slightly different):{||-|
$CFG->dbtype = 'mysql';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'root';
$CFG->dbpass = 'root';
$CFG->dbpersist = false;
$CFG->prefix = 'mdl_';
$CFG->wwwroot = 'http://localhost/moodle';
$CFG->dirroot = 'C:\moodle_b\UniServer\www\moodle';
$CFG->dataroot = 'C:\moodle_b\UniServer/moodledata';
$CFG->admin = 'admin';</pre> The hard coded paths start with '''C:''' followed by a list of folders to |} Second line assumes you are running the Moodle installation these hard coded paths prevent portabilityMySQL server on standard port 3306.  Another problem, first eighth line assumes you are running servers on localhost and standard port 80 this becomes an issue if you run [[#Move Servers | '''move servers''']] (multi-server operation) because it changes all ports.  Hard coded paths start with '''C:''' followed by a list of folders to the Moodle installation these hard coded paths prevent portability.
Solution is to let PHP automatically calculate absolute paths and web-root folderincluding ports used.
Replace the above three lines with the following code:{||-|
// === MPG Set base path ======================================================$splitArray path_array = explode("\\www",__DIR__dirname( __FILE__ )); // Split path at folder www $base = "$path_array[0]"; // absolute path to..UniServer/// ================================================== MPG End Set base path === // === MPG Get MYSQL port =====================================================// Use port from configuration file - because user can change this file $file_conf = $base .'usr\\local\\mysql\\my.ini'; // Config file  if ($filearray=file($file_conf)) { // read file into array foreach ($filearray as $txt) { // scan array for port if(preg_match("/^\s*port\s*= \s*(\d+)/", $txt,$match)){ // check save matches $mysql_port = $splitArraymatch[01]; // match found save port number break; // give up nothing else to do } }}else { // failed to read file echo "Cannot read the file"; }// find drive letter and sub===================================================== END Get MySQL Port === $CFG->dbtype = 'mysql';$CFG->dbhost = "localhost:$mysql_port";$CFG->dbname = 'moodle';$CFG->dbuser = 'root';$CFG-folders >dbpass = 'root';$CFG->dbpersist = false;$CFG->prefix = 'mdl_';
$root = 'http://'.getenv("HTTP_HOST").'/moodle'; // Local testing
//$root = 'http://'.GetHostByName($REMOTE_ADDR).'/moodle'; // moving from event to event
$CFG->wwwroot = $root;
$CFG->dirroot = $base.'\www\moodle';$CFG->dataroot = $base.'\moodledata';$CFG->admin = 'admin';
The above change makes Moodle completely portable.
* Under '''Plugins'''
* Navigate to sub-folder '''Uniform Server 5-Nano Plugins'''
* Download file [ V55_Moodle_l_9_5V55_Moodle_l_9_7.exe]
Save this to folder UniServer, to install double click on file. Moodle is pre-configured and ready to go. Check out the read me file for latest information.

Navigation menu