Installing Moodle on 5.0-Nano: Difference between revisions
New page: <span id="top"></span> {| cellpadding="2" |__TOC__||'''Installing Moodle on 5.0-Nano''' |} '''Introduction''' This step-by-step guide shows how to install Moodle on Uniform Server V5.0-Na... |
m Text replace - "projects/uniformserver" to "projects/miniserver" |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
<span id="top"></span> | <span id="top"></span> | ||
{| cellpadding="2" | {| cellpadding="2" | ||
|__TOC__||'''Installing Moodle on 5 | |__TOC__||'''Installing Moodle on 5-Nano Series''' | ||
|} | |} | ||
'''Introduction''' | '''Introduction''' | ||
This step-by-step guide shows how to install Moodle on Uniform Server V5 | This step-by-step guide shows how to install Moodle on Uniform Server V5-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 | Windows does not support true cron jobs however V5-Nano has an integrated portable Cron catering for both hard drive and USB memory stick installations. | ||
== Pre-Installation == | == Pre-Installation == | ||
Line 16: | Line 16: | ||
# '''A)''' Create a new folder named '''moodle_b''' (Can be any name) | # '''A)''' Create a new folder named '''moodle_b''' (Can be any name) | ||
# Extract a new copy of Uniform Server V5. | # Extract a new copy of Uniform Server V5.5-Nano to this folder<br>(Double click on file to extract). | ||
'''''Download Moodle''''' | '''''Download Moodle''''' | ||
Line 35: | Line 35: | ||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
== | == Switch to production, start servers == | ||
UniServer’s default is to use the production PHP configuration file however you may have switched configuration files during development. | |||
Before installing any applications ensure the production configuration is selected. | |||
'''''Check configuration file'':''' | |||
# Start UniTray, in folder UniServer double click on '''Start.exe''' tray icon created. | # Start UniTray, in folder UniServer double click on '''Start.exe''' tray icon created. | ||
# Check configuration: Left click '''tray icon > Server Status''' – Top of page php.ini displays either Production or development. | |||
# If Production displayed no action required you can start servers. | |||
# If development displayed proceed as follows: | |||
# Switch to production, Left click '''tray icon > Advanced > click php.ini switch to Production'''. | # Switch to production, Left click '''tray icon > Advanced > click php.ini switch to Production'''. | ||
'''''Start Servers'':''' | |||
* Start Uniform Server. Left click '''tray icon > click Start UniServer ''' | |||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
== Create a Moodle Database == | == Create a Moodle Database == | ||
Creating the Moodle database is straight forward, tables are automatically inserted during installation | Creating the Moodle database is straight forward, tables are automatically inserted during installation | ||
Line 159: | Line 170: | ||
|- | |- | ||
| | | | ||
9) '''''Current release information''''': Moodle 1.9.5+ (Build: | 9) '''''Current release information''''': Moodle 1.9.5+ (Build: 20091126)(leave Unattended operation un-checked): '''Continue''' | ||
|- | |- | ||
| | | | ||
Line 203: | Line 214: | ||
{| | {| | ||
|- | |- | ||
|Username:|| ''' | |Username:|| '''admin''' | ||
|- | |- | ||
|New password|| ''' | |New password|| '''UniServer-54''' | ||
|- | |- | ||
|Force password change|| '''leave unchecked''' | |Force password change|| '''leave unchecked''' | ||
Line 264: | Line 275: | ||
Admin login | Admin login | ||
* Username: ''' | * Username: '''admin''' | ||
* Password: ''' | * Password: '''UniServer-54''' | ||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 280: | Line 291: | ||
UniServer\www\moodle\'''config.php''' | UniServer\www\moodle\'''config.php''' | ||
Its a small file locate the following | Its a small file locate the following lines (yours may be slightly different): | ||
{| | |||
|- | |||
| | |||
<pre> | <pre> | ||
$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->wwwroot = 'http://localhost/moodle'; | ||
$CFG->dirroot = 'C:\moodle_b\UniServer\www\moodle'; | $CFG->dirroot = 'C:\moodle_b\UniServer\www\moodle'; | ||
$CFG->dataroot = 'C:\moodle_b\UniServer/moodledata'; | $CFG->dataroot = 'C:\moodle_b\UniServer/moodledata'; | ||
</pre> | $CFG->admin = 'admin'; | ||
</pre> | |||
|} | |||
Second line assumes you are running the MySQL server on standard port 3306. | |||
Another problem, 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 folder. | Solution is to let PHP automatically calculate absolute paths and web-root folder including ports used. | ||
Replace the above | Replace the above lines with the following code: | ||
{| | |||
|- | |||
| | |||
<pre> | <pre> | ||
$ | // === MPG Set base path ====================================================== | ||
$base | $path_array = explode("www", dirname( __FILE__ )); // Split path at 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 = $match[1]; // match found save port number | |||
break; // give up nothing else to do | |||
} | |||
} | |||
} | |||
else { // failed to read file | |||
echo "Cannot read the file"; | |||
} | |||
// ===================================================== END Get MySQL Port === | |||
$CFG->dbtype = 'mysql'; | |||
$CFG->dbhost = "localhost:$mysql_port"; | |||
$CFG->dbname = 'moodle'; | |||
$CFG->dbuser = 'root'; | |||
$CFG->dbpass = 'root'; | |||
$CFG->dbpersist = false; | |||
$CFG->prefix = 'mdl_'; | |||
$root = 'http://'.getenv("HTTP_HOST").'/moodle'; // Local testing | $root = 'http://'.getenv("HTTP_HOST").'/moodle'; // Local testing | ||
//$root = 'http://'.GetHostByName($REMOTE_ADDR).'/moodle'; // moving from event to event | //$root = 'http://'.GetHostByName($REMOTE_ADDR).'/moodle'; // moving from event to event | ||
$CFG->wwwroot = $root; | $CFG->wwwroot = $root; | ||
$CFG->dirroot = $base.' | $CFG->dirroot = $base.'www\moodle'; | ||
$CFG->dataroot = $base.' | $CFG->dataroot = $base.'moodledata'; | ||
$CFG->admin = 'admin'; | |||
</pre> | </pre> | ||
|} | |||
The above change makes Moodle completely portable. | The above change makes Moodle completely portable. | ||
Line 447: | Line 508: | ||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
== Plugin == | |||
The above instructions are generic allowing you to install the latest version of Moodle. | |||
If you prefer a click and go solution go to [http://sourceforge.net/projects/miniserver/files/Plugins/UniServer%2055-Nano%20Plugins/Applications/ '''SourceForge'''] | |||
* Under '''Plugins''' | |||
* Navigate to sub-folder '''Uniform Server 5-Nano Plugins''' | |||
* Download file [http://sourceforge.net/projects/miniserver/files/Plugins/UniServer%2055-Nano%20Plugins/Applications/V55_Moodle/V55_Moodle_l_9_7.exe/download V55_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. | |||
'''''Note'':''' This plugin is intended to quickly get Moodle up and running allowing you to explore the software. If you intend running a production server delete the folders installed and perform a manual install this allows you to tailor Moodle and include any missing modules. | |||
'''''[[#top | Top]]''''' | |||
== MySQL Security == | |||
The above installation guide and associated downloadable plugin are intended to get the application up and running purely for testing. | |||
If you are intending to put the application on line make sure to read any security advice provided with the application and check providers web site. | |||
More impotently the above installation is an extreme security risk if put online as is. | |||
Its imperative you secure the MySQL server before putting your servers online. | |||
Please read the following page [[MySQL Security | '''MySQL Security''']] and restrict privileges to any user that has connection access to your server. | |||
'''''[[#top | Top]]''''' | |||
== Summary == | == Summary == | ||
Although there are a large number of steps Moodle is easy to install on Uniform Server. | Although there are a large number of steps Moodle is easy to install on Uniform Server. |