Installing Moodle on 4.0-Mona: Difference between revisions
Upazixorys (talk | contribs) No edit summary |
m (Reverted edits by Upazixorys (Talk); changed back to last version by Ric) |
||
Line 1: | Line 1: | ||
<span id="top"></span> | |||
< | {| cellpadding="2" | ||
</ | |||
{| cellpadding= | |||
|__TOC__||'''Installing Moodle on 4.0-Mona''' | |__TOC__||'''Installing Moodle on 4.0-Mona''' | ||
|} | |} | ||
Line 20: | Line 12: | ||
{| | {| | ||
|- | |- | ||
|valign= | |valign="top"| | ||
'''''Install Uniform server''''' | '''''Install Uniform server''''' | ||
# '''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 V4.0-Mona to this folder | # Extract a new copy of Uniform Server V4.0-Mona to this folder<br>(Double click on file to extract). | ||
'''''Download Moodle''''' | '''''Download Moodle''''' | ||
<ol start="4"> | |||
<li> '''B)''' Create a new folder '''moodle_a''' (Can be any name its only a temporary folder)</li> | |||
<li> Download the latest version (moodle-weekly-19.zip) of Moodle from [http://download.moodle.org/ Moodle download page]</li> | |||
<li> Copy the file dowloaded ('''moodle-weekly-19.zip''') to '''moodle_a'''</li> | |||
<li> Unzip '''moodle-weekly-19.zip''' into this folder.<br>(Right click on file, select extract all, extract to current path.)</li> | |||
</ol> | |||
'''''Copy files to Uniform Server''''' | '''''Copy files to Uniform Server''''' | ||
<ol start="8"> | |||
<li> '''C)''' Expand the folder '''moodle-weekly-19'''</li> | |||
<li> '''D)''' Copy folder '''moodle''' to Uniform Servers's root folder '''www'''</li> | |||
</ol> | |||
| | | | ||
[[Image:Moodle_1.gif]] | [[Image:Moodle_1.gif]] | ||
Line 47: | Line 39: | ||
{| | {| | ||
|- | |- | ||
|valign= | |valign="top"| | ||
{| | {| | ||
|- | |- | ||
|valign= | |valign="top"| | ||
# Start Uniform Server (Double click on '''Server_Start.bat''' in folder UniServer). | # Start Uniform Server (Double click on '''Server_Start.bat''' in folder UniServer). | ||
# From apanel (displayed in your browser when the server starts) click on the '''phpMyAdmin''' link. (left menu under tools) Note you can always return to apanel by typing | # From apanel (displayed in your browser when the server starts) click on the '''phpMyAdmin''' link. (left menu under tools) Note you can always return to apanel by typing <nowiki>http://localhost/apanel/</nowiki> into your browser address bar. | ||
# '''A)''' We want to create a new database. Enter '''moodle''' | # '''A)''' We want to create a new database. Enter '''moodle''' | ||
# '''B)''' Click on '''Create''' to create the database | # '''B)''' Click on '''Create''' to create the database | ||
|} | |} | ||
|valign= | |valign="top"| | ||
[[Image:Moodle_2.gif]] | [[Image:Moodle_2.gif]] | ||
|} | |} | ||
Line 64: | Line 56: | ||
All that remains is to run the Moodle installer script '''install.php'''. Type the following into your browser address bar. | All that remains is to run the Moodle installer script '''install.php'''. Type the following into your browser address bar. | ||
''' | '''<nowiki>http://localhost/moodle/install.php</nowiki>''' | ||
Most of the pages display information just click either the next or continue button to proceed to the next page. | Most of the pages display information just click either the next or continue button to proceed to the next page. | ||
Line 80: | Line 72: | ||
{| | {| | ||
|- | |- | ||
|& | | ||PHP version|| ||Pass | ||
|- | |- | ||
|& | | ||Session Auto Start|| ||Pass | ||
|- | |- | ||
|& | | ||Magic Quotes Run Time|| ||Pass | ||
|- | |- | ||
|& | | ||Insecure Handling of Globals|| ||Pass | ||
|- | |- | ||
|& | | ||Safe Mode|| ||Pass | ||
|- | |- | ||
|& | | ||File Uploads|| ||Pass | ||
|- | |- | ||
|& | | ||GD version|| ||Pass | ||
|- | |- | ||
|& | | ||Memory Limit|| ||Pass | ||
|} | |} | ||
|- | |- | ||
| | | | ||
3) '''''Please confirm the locations of this Moodle installation'':''' | 3) '''''Please confirm the locations of this Moodle installation'':''' | ||
* Web address | * Web address <nowiki>http://localhost/moodle</nowiki> | ||
* Moodle Directory | * Moodle Directory <nowiki>Z:\www\moodle</nowiki> Grayed out | ||
* Data Directory Z:\/moodledata | * Data Directory Z:\/moodledata | ||
For a default installation of Uniform Server these are correct click '''Next''' | For a default installation of Uniform Server these are correct click '''Next''' | ||
Line 108: | Line 100: | ||
{| | {| | ||
|- | |- | ||
|& | | ||Type:|| ||'''MySQL'''(mysql)|| | ||
|- | |- | ||
|& | | ||Host Server:|| ||'''localhost'''|| | ||
|- | |- | ||
|& | | ||User:|| || '''root'''|| -- (Uniform Servers default) | ||
|- | |- | ||
|& | | ||Password:|| || '''root'''|| -- (Uniform Server default) | ||
|- | |- | ||
|& | | ||Tables prefix:|| ||''' mdl_'''|| | ||
| | | | ||
|} | |} | ||
Line 125: | Line 117: | ||
{| | {| | ||
|- | |- | ||
|'''Name'''||& | |'''Name'''|| ||'''Information'''|| ||'''Report'''|| ||'''Status''' | ||
|- | |- | ||
|unicode||& | |unicode|| || || ||must be installed and enabled|| ||OK | ||
|- | |- | ||
|database||& | |database|| ||mysql|| ||version 4.1.16 is required and you are running 5.1.30|| ||OK | ||
|- | |- | ||
|php||& | |php|| || || ||version 4.3.0 is required and you are running 5.2.8|| ||OK | ||
|- | |- | ||
|php_extension||& | |php_extension|| ||iconv|| ||should be installed and enabled for best results|| ||OK | ||
|- | |- | ||
|php_extension||& | |php_extension|| ||mbstring|| ||should be installed and enabled for best results|| ||OK | ||
|- | |- | ||
|php_extension||& | |php_extension|| ||curl|| ||should be installed and enabled for best results|| ||OK | ||
|- | |- | ||
|php_extension||& | |php_extension|| ||openssl|| ||should be installed and enabled for best results|| ||OK | ||
|- | |- | ||
|php_extension||& | |php_extension|| ||tokenizer|| ||should be installed and enabled for best results|| ||OK | ||
|- | |- | ||
|php_extension||& | |php_extension|| ||xmlrpc|| ||should be installed and enabled for best results|| ||OK | ||
|- | |- | ||
|php_extension||& | |php_extension|| ||ctype|| ||should be installed and enabled for best results|| ||OK | ||
|} | |} | ||
|- | |- | ||
Line 224: | Line 216: | ||
|Prefered language:||English | |Prefered language:||English | ||
|- | |- | ||
|Leave rest blank||& | |Leave rest blank|| | ||
|} | |} | ||
Click '''Update profile''' | Click '''Update profile''' | ||
Line 255: | Line 247: | ||
== Starting Moodle == | == Starting Moodle == | ||
# Double click on '''Server_Start.bat''' located in folder '''G:\Uniform Server''' | # Double click on '''Server_Start.bat''' located in folder '''G:\Uniform Server''' | ||
# In your browser address bar type ''' | # In your browser address bar type '''<nowiki>http://localhost/moodle/</nowiki>''' | ||
'''''Note'':''' You can run apanel at any time by typing | '''''Note'':''' You can run apanel at any time by typing <nowiki>http://localhost/apanel</nowiki> into your browser address bar. | ||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 273: | Line 265: | ||
Its a small file locate the following two lines: | Its a small file locate the following two lines: | ||
<pre> | |||
$CFG- | $CFG->dirroot = 'Z:\www\moodle'; | ||
$CFG- | $CFG->dataroot = 'Z:\/moodledata'; | ||
? | ?> | ||
</pre> | |||
The hard coded paths start with '''Z:''' the solution is to let PHP calculate this drive letter (path) by replacing the above two lines with: | The hard coded paths start with '''Z:''' the solution is to let PHP calculate this drive letter (path) by replacing the above two lines with: | ||
<pre> | |||
$root= substr($_SERVER[ | $root= substr($_SERVER["DOCUMENT_ROOT"],0,-4); | ||
$CFG- | $CFG->dirroot = $root.'\www\moodle'; | ||
$CFG- | $CFG->dataroot = $root.'\/moodledata'; | ||
? | ?> | ||
</pre> | |||
The above change makes Moodle completely portable. | The above change makes Moodle completely portable. | ||
Line 297: | Line 289: | ||
For a personal implementation of Moodle you can run cron.php occasionally by typing the following into your browser address bar: | For a personal implementation of Moodle you can run cron.php occasionally by typing the following into your browser address bar: | ||
''' | '''<nowiki>http://localhost/moodle/admin/cron.php</nowiki>''' | ||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 308: | Line 300: | ||
UniServer\udrive\www\moodle\admin\'''run_cron.php''' | UniServer\udrive\www\moodle\admin\'''run_cron.php''' | ||
<pre> | |||
<? $dummy = file("http://localhost/moodle/admin/cron.php"); ?> | |||
</pre> | |||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 318: | Line 310: | ||
UniServer\'''run_cron.bat''' | UniServer\'''run_cron.bat''' | ||
<pre> | |||
:next | :next | ||
udrive\home\admin\program\unidelay.exe 60 | udrive\home\admin\program\unidelay.exe 60 | ||
Line 324: | Line 316: | ||
goto :next | goto :next | ||
exit | exit | ||
</pre> | |||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' | ||
Line 332: | Line 324: | ||
UniServer\'''run_cron_hidden.bat''' | UniServer\'''run_cron_hidden.bat''' | ||
<pre> | |||
start udrive\home\admin\program\uniserv.exe run_cron.bat | start udrive\home\admin\program\uniserv.exe run_cron.bat | ||
</pre> | |||
With the files in place start the servers and run '''run_cron_hidden.bat'''. | With the files in place start the servers and run '''run_cron_hidden.bat'''. | ||
Line 341: | Line 333: | ||
'''''Note 2'':''' You can run Cron from '''Server_Start.bat''' add the following line just below line ''':END''' (forth line from bottom of file): | '''''Note 2'':''' You can run Cron from '''Server_Start.bat''' add the following line just below line ''':END''' (forth line from bottom of file): | ||
<pre> | |||
start udrive\home\admin\program\uniserv.exe run_cron.bat | start udrive\home\admin\program\uniserv.exe run_cron.bat | ||
</pre> | |||
Hence every time you start the servers using '''Server_Start.bat''' or '''disk_start.vbs''' Cron will run. | Hence every time you start the servers using '''Server_Start.bat''' or '''disk_start.vbs''' Cron will run. | ||
Line 358: | Line 350: | ||
I lifted the following tip straight from [http://www.teachageek.com/2009/03/uniform-server-revisited.html '''gdunc'''] blog, it looks very useful, reproduced unedited: | I lifted the following tip straight from [http://www.teachageek.com/2009/03/uniform-server-revisited.html '''gdunc'''] blog, it looks very useful, reproduced unedited: | ||
One other thing that might be useful to add here is a small addition to the config.php file for those users who use UniServer on a laptop. Since the '''config.php''' file lists the wwwroot as | One other thing that might be useful to add here is a small addition to the config.php file for those users who use UniServer on a laptop. Since the '''config.php''' file lists the wwwroot as "localhost" external users are unable to view your moodle site correctly. For that reason, I would recommend the following changes to config.php: | ||
Locate the 'wwwroot' line in '''config.php''' | Locate the 'wwwroot' line in '''config.php''' | ||
<pre> | |||
$CFG- | $CFG->wwwroot = 'http://localhost/moodle'; | ||
</pre> | |||
Replace the above line with the following two lines, to let php figure out what your current IP address is and change it whenever your IP address changes. This can be very useful when moving from event to event. | Replace the above line with the following two lines, to let php figure out what your current IP address is and change it whenever your IP address changes. This can be very useful when moving from event to event. | ||
<pre> | |||
$domain = GetHostByName($REMOTE_ADDR); | $domain = GetHostByName($REMOTE_ADDR); | ||
$CFG- | $CFG->wwwroot = 'http://'.$domain.'/moodle'; | ||
</pre> | |||
'''''[[#top | Top]]''''' | '''''[[#top | Top]]''''' |
Latest revision as of 07:54, 24 November 2010
Installing Moodle on 4.0-Mona |
Introduction
This step-by-step guide shows how to install Moodle on Uniform Server V4.0-Mona. 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 hence I have included a portable-cron solution catering for both hard drive and USB memory stick installations.
Pre-Installation
Install Uniform server
Download Moodle
Copy files to Uniform Server
|
Create a Moodle Database
Creating the Moodle database is straight forward, tables are automatically inserted during installation
|
Moodle Installation
All that remains is to run the Moodle installer script install.php. Type the following into your browser address bar.
http://localhost/moodle/install.php
Most of the pages display information just click either the next or continue button to proceed to the next page. Item 4 requires the database user name and password for a personal installation we are using the defaults root and root. The following shows what to expect during installation:
1) Choose a Language: Select your language e.g. English (en) click Next | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
2) Checking your PHP Settings: passes all click NEXT Your server should pass all these tests to make Moodle run properly
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
3) Please confirm the locations of this Moodle installation:
For a default installation of Uniform Server these are correct click Next | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
4) Database configuration:
Click Next | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
5) Checking your environment:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
6) Download language pack Installation: Option to download a language pack NEXT | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
7) Configuration completed: config.php has been successfully created Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
8) GPL License: You have read the copyright notice! YES | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
9) Current release information: Moodle 1.9.4+ (Build: 20090204)(leave Unattended operation un-checked): Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
10) Setting up database: Takes some time wait as the install takes place: Database was successfully updated Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
11) Setting up module tables: Again wait, Workshop tables have been setup correctly Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
12) Setting up plugin tables: Truefalse tables have been set up correctly, Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
13) Upgrading database: Datbase was successfully upgraded Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
14) Upgrading database: Blocks version is now 2007081300 Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
15) Setting up block tables: Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
16) Setting up plugin tables: Paypal tables have been set up correctley Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
17) Setting up plugin tables: xml and other plugins set up correctly Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
18) Setting up plugin tables: xml tables have been set up correctly Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
19) Setting up plugin tables: user tables have been set up correctly Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
20) Setting up plugin tables: stats tables have been set up correctly Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
21) Setting up plugin tables: unittest tables have been set up correctly Continue | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
22) Setup administrator account: Admin set-up: On this page you should configure your main administrator account which will have complete control over the site. Make sure you give it a secure user name and password as well as a valid email address. You can create more admin accounts later on. Fill in details:
Click Update profile | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
23) Front Page settings: This page allows you to configure the front page and name of this new site. You can come back here later to change these settings any time using the Administration menus. Fill in details:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
24) Finished: This is your main admin page you can continue setting up Moodle or log out |
Note: Steps 22-23 I entered dummy information. You can change this information from admin at any time, however make sure you remember your admin password and name.
Stopping Moodle
- Logout from admin
- Double click on Stop.bat located in folder G:\Uniform Server
Starting Moodle
- Double click on Server_Start.bat located in folder G:\Uniform Server
- In your browser address bar type http://localhost/moodle/
Note: You can run apanel at any time by typing http://localhost/apanel into your browser address bar.
Portability Memory Stick
To run Moodle from a Memory stick, copy the folder UniServer and all its content to whatever drive your memory stick is on.
Note: This process is not fast; writing 102 MB (UniServer plus Moodle) took just over 20 minutes. In the same vain do not expect exceptional performance, Moodle uses a large database hence is slow when run from a memory stick. That said I found it just about acceptable.
Hard Coded path
During installation Moodle uses the drive letter (default Z) it is installed from and hard wires it into a configuration file. This means you cannot run or move the installation and expect Moodle to run. A solution to this problem requires modifying the Moodle configuration file config.php.
Open the following file in a text editor:
UniServer\udrive\www\moodle\config.php
Its a small file locate the following two lines:
$CFG->dirroot = 'Z:\www\moodle'; $CFG->dataroot = 'Z:\/moodledata'; ?>
The hard coded paths start with Z: the solution is to let PHP calculate this drive letter (path) by replacing the above two lines with:
$root= substr($_SERVER["DOCUMENT_ROOT"],0,-4); $CFG->dirroot = $root.'\www\moodle'; $CFG->dataroot = $root.'\/moodledata'; ?>
The above change makes Moodle completely portable.
Cron
Moodle has a cron.php script that needs to be periodically run. It takes care of various routine tasks for example unsubscribing inactive members and sending out email messages.
Manualy Run Cron
To keep Moodle happy you need to periodically run the cron.php script.
For a personal implementation of Moodle you can run cron.php occasionally by typing the following into your browser address bar:
http://localhost/moodle/admin/cron.php
Automatically Run Cron
Manually running Cron can become tedious a solution is to create a portable-cron using 4.0_Mona components, three new files are required as follows:
run_cron.php
This file runs the actual cron script cron.php its sole purpose is to convert local paths to server relative paths.
UniServer\udrive\www\moodle\admin\run_cron.php
<? $dummy = file("http://localhost/moodle/admin/cron.php"); ?>
run_cron.bat
This batch file uses unidelay.exe to provide a periodic tick. At the end of each delay PHP is run in CLI mode and runs script run_cron.php. the loop repeats indefinitely.
UniServer\run_cron.bat
:next udrive\home\admin\program\unidelay.exe 60 udrive\usr\local\php\php.exe -n udrive\www\moodle\admin\run_cron.php goto :next exit
The above batch file if run directly would be visible hence this batch file uses uniserv.exe to run the above hidden.
UniServer\run_cron_hidden.bat
start udrive\home\admin\program\uniserv.exe run_cron.bat
With the files in place start the servers and run run_cron_hidden.bat.
Note 1: unidelay.exe 60 runs the cron-job every 60 seconds increase this as required.
Note 2: You can run Cron from Server_Start.bat add the following line just below line :END (forth line from bottom of file):
start udrive\home\admin\program\uniserv.exe run_cron.bat
Hence every time you start the servers using Server_Start.bat or disk_start.vbs Cron will run.
Related links:
Tip - UniServer on a laptop
I lifted the following tip straight from gdunc blog, it looks very useful, reproduced unedited:
One other thing that might be useful to add here is a small addition to the config.php file for those users who use UniServer on a laptop. Since the config.php file lists the wwwroot as "localhost" external users are unable to view your moodle site correctly. For that reason, I would recommend the following changes to config.php:
Locate the 'wwwroot' line in config.php
$CFG->wwwroot = 'http://localhost/moodle';
Replace the above line with the following two lines, to let php figure out what your current IP address is and change it whenever your IP address changes. This can be very useful when moving from event to event.
$domain = GetHostByName($REMOTE_ADDR); $CFG->wwwroot = 'http://'.$domain.'/moodle';
Summary
Although there are a large number of steps Moodle is easy to install on Uniform Server.