Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Offline Moodle Create Environment: Difference between revisions

From MoodleDocs
No edit summary
No edit summary
Line 8: Line 8:
Portable Menu: PStartSetup211.exe obtained from [http://www.pegtop.de/start/]
Portable Menu: PStartSetup211.exe obtained from [http://www.pegtop.de/start/]


===Install Moodle===
==Create the Environment==
===Install The Architecture===
I could say install xampp because that's what we'll be doing but it's important to remember that xampp is simply a web server and database server, among other things, that is freely available and works on different operating systems. There are other solutions you could use and we've worked to ensure you could Switch it to these instead of xampp if you so desired.
 
Since we're using xampp the install is very simple. Just run the exe and chose where to unzip the files. No registry settings should be changed and no other operating system changes will be made. This is important to the overall concept of Offline Moodle in that it can be run from the folder it is unzipped to. All that you need to do is reconfigure xampp to recognise it's new location, thankfully a handle utility setup_xampp.bat does this for you so you just need to click it. Then start xampp with xampp_start.exe and xampp should start. If you're using windows xp you may notice firewall warnings. This is what firewalls do, basically xampp starting means a database and web server start. Each on needs to access the network and provide data over the network. That's why your firewall asks if this is ok with you. So just choose unblock when prompted.
 
When prompted chose where to unzip the xampp files to. We'll choose c:\offline for this tutorial but I normally nest it much further where I'm used to keeping project files.
 
===Start the Architecture===
This should be as easy as explained above reconfigure xampp to recognise its new location using setup_xampp.bat and then start it using xampp_start.exe. When you want to stop it just use the corresponding xampp_stop.exe file.
 
You'll get a black command prompt window pop up telling you xampp and it's services starting. Now open a web browser on your machine and type http://localhost into the address bar and press enter. You should be taken to the xampp home page. If you're not then wait a short while and try again in case xampp was still starting. If xampp won't start then check the xampp site for advice on how to fix the error. My main problem was forget to reconfigure it when I move the xampp folder or install it.
 
So there you go. There is another way to get xampp running using the xampp-control.exe but I'll levave you to play around with that. At this point we're not planning to promote use of this in our Offline Moodle installs simply because it presents the webserver and database as separate applications. Which while correct we don't want users to have to worry about this complexity. We just want them to start and stop Offline Moodle as they would any application.
 
===Secure XAMPP===
We have taken some small steps to secure the database and web server directories using standard approaches. Xampp
 
==Install Moodle==


Secure the mysql root password using the values below
Secure the mysql root password using the values below

Revision as of 08:59, 23 April 2008

Creating an Offline Moodle Environment

To ensure a standard approach to developing offline moodle environments it is important to record and maintain details

Source files

The environment comprises the following libraries Xampp: xampplite-win32-1.6.6.exe obtained from [1] Moodle: moodle-1.9.zip latest version obtained from [2] Portable Menu: PStartSetup211.exe obtained from [3]

Create the Environment

Install The Architecture

I could say install xampp because that's what we'll be doing but it's important to remember that xampp is simply a web server and database server, among other things, that is freely available and works on different operating systems. There are other solutions you could use and we've worked to ensure you could Switch it to these instead of xampp if you so desired.

Since we're using xampp the install is very simple. Just run the exe and chose where to unzip the files. No registry settings should be changed and no other operating system changes will be made. This is important to the overall concept of Offline Moodle in that it can be run from the folder it is unzipped to. All that you need to do is reconfigure xampp to recognise it's new location, thankfully a handle utility setup_xampp.bat does this for you so you just need to click it. Then start xampp with xampp_start.exe and xampp should start. If you're using windows xp you may notice firewall warnings. This is what firewalls do, basically xampp starting means a database and web server start. Each on needs to access the network and provide data over the network. That's why your firewall asks if this is ok with you. So just choose unblock when prompted.

When prompted chose where to unzip the xampp files to. We'll choose c:\offline for this tutorial but I normally nest it much further where I'm used to keeping project files.

Start the Architecture

This should be as easy as explained above reconfigure xampp to recognise its new location using setup_xampp.bat and then start it using xampp_start.exe. When you want to stop it just use the corresponding xampp_stop.exe file.

You'll get a black command prompt window pop up telling you xampp and it's services starting. Now open a web browser on your machine and type http://localhost into the address bar and press enter. You should be taken to the xampp home page. If you're not then wait a short while and try again in case xampp was still starting. If xampp won't start then check the xampp site for advice on how to fix the error. My main problem was forget to reconfigure it when I move the xampp folder or install it.

So there you go. There is another way to get xampp running using the xampp-control.exe but I'll levave you to play around with that. At this point we're not planning to promote use of this in our Offline Moodle installs simply because it presents the webserver and database as separate applications. Which while correct we don't want users to have to worry about this complexity. We just want them to start and stop Offline Moodle as they would any application.

Secure XAMPP

We have taken some small steps to secure the database and web server directories using standard approaches. Xampp

Install Moodle

Secure the mysql root password using the values below

Create the moodle database Run the following sql on the database create database `moodle` character set utf8; grant all on `moodle`.* to 'moodle'@'localhost' IDENTIFIED BY 'm00dl3';


Create config file

There are two ways 1) Create the file directly create a file using the following values in the root of the moodle directory called config.php

<?php /// Moodle Configuration File

unset($CFG);

$CFG->dbtype = 'mysql'; $CFG->dbhost = 'localhost'; $CFG->dbname = 'moodle'; $CFG->dbuser = 'moodle'; $CFG->dbpass = 'm00dl3'; $CFG->dbpersist = false; $CFG->prefix = 'mdl_';

$CFG->wwwroot = 'http://localhost/moodle'; $CFG->dirroot = dirname(__FILE__); $CFG->dataroot = dirname(__FILE__).'\\..\\..\\moodledata'; $CFG->admin = 'admin';

$CFG->directorypermissions = 00777; // try 02777 on a server in Safe Mode

require_once("$CFG->dirroot/lib/setup.php"); // MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES, // RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE. ?>

2) Use the install wizard Got to http://localhost.moodle Enter the values from above as they are requested. Once the config file is created change the values for $CFG->dirroot and CFG->dataroot as shown above to ensure they are dynamic paths that will work as the code is moved around.

Generate Database tables and load data

Got to http://localhost.moodle and follow the install process

Setup up initial data Username: Admin Password: m00dl3 Email: testofflinemoodle@open.ac.uk Email Activated: Hide my email address from everyone City/Town: Milton Keynes Country: United Kingdom

Front Page settings Full site name: Offline Moodle Short name for site: OfflineMoodle Front Page Description: Welcome to Offline Moodle

Setup session handling So that we don’t conflict with other moodles change the session to be unique. Go to Server> Session Handling. In the Cookie prefix box enter ‘offlinemoodle’ and save changes. You will now have to log back in.

Add student account Username: student Password: testing Email: offlinestudent@open.ac.uk Email Activated: Hide my email address from everyone City/Town: Milton Keynes Country: United Kingdom

Create root support files Pre configured help files Readme.htm system-requirements.htm Help folder and contents


Internet Shortcuts Offline Moodle.lnk Offline Moodle at the Open University.lnk Location

Security passwords are available on request to [c.chambers@open.ac.uk] Database: User: root Password:

Directory protection: Will create a .htaccess file for password protection over http

User: root Password: