Moodle for Windows on a USB Stick

Moodle for Windows on a USB Stick

by Brett Drinkwater -
Number of replies: 37

After a number of failed attempts to get the Complete XAMPP Moodle installation working on a USB Memory Stick, I decided to search for an alternative. Google took me to CH Software's WOS - Webserver on a Stick. Getting Moodle up and running on my Stick was so simple with WOS that I though I would share it with fellow moodlers.

I've also posted these instructions on the Moodle Docs site.

WOS Portable does not need an extra drive letter and it is ready to run instantly after unzipping; just plug a USB stick in any Windows computer and you have a functional instance of 'Moodle on a Stick'

Webserver on a Stick (WOS) packages a complete Apache/PHP/MySQL webserver with a wrapper that automatically configures and starts the servers; the Small Edition takes only 20 Mb. It is published under the GNU GPL.

The complete package with a vanilla Moodle 1.5.3, WOS Portable SE 1.1.1, Apache 2.0.5, PHP 5.1.2 (and 4.4.1), and MySQL 4.1.18-nt - all free, open source software - occupies less than 100Mb.

Installation

For best results you should always install and run WOS from the root directory of a drive. The first time it's run, WOS configures the paths for the servers based on the current directory.

1. Start by downloading the latest versions of WOS Portable or WOS Portable Small Edition.

2. Unzip the file and copy to your USB Stick.
Switch to the stick and double click start.exe to begin the WOS installation.

3. Choose your language, then click through the Terms of Use.
WOS starts up and displays the WOS Status dialog box and opens your web browser to the WOS start page.

* You should now see the follow on the WOS startup page.
Apache 2.0.55 is running
PHP 5.1.2 works (or PHP4 if you configured it that way)
MySql 4.1.18-nt is running
Document Root is: F:/www

4. Setup your Database
Click on the PHPMyAdmin link on the Start page.
In PHPMyAdmin, type a name for your database. ie: 'moodle' and click Enter.

5. Now Download your preferred version of Moodle from the Moodle Download page and unzip the file to your www directory on the USB stick.

6. Run Moodle Installation.
Using the directory and settings above, the URL is http://localhost/moodle/install.php.

Now you simply work through the normal Moodle installation procedures.

NOTE: During the databases setup, use root as the database user and leave the password field blank (warning: security risk if opening to your LAN/WAN

It should work just like it does on the web or on your hard drive windows installation.

Troubleshooting

Moodle requires a number of PHP settings to be active for it to work. On most servers these will already be the default settings. However, I noticed the WOS package required register_globals needed to be turned off and magic_quotes gpc turned On. These are defined in PHP's configuration file (usually called php.ini):

WOS Portable is freeware, and there is no official support.

If you have a problem after running through the above, try the troubleshooting hints on the WOS Wiki.

Hope this guide helps others to run Moodle on a Stick.

Cheers

Brett Drinkwater

Average of ratings: -
In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick

by Anthony Borrow -
Picture of Core developers Picture of Plugin developers Picture of Testers
This is very exciting for demo purposes. Thank you very much for sharing this information with us. I had backed up our production server to my USB drive but this will take that backup to the next level.
In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick

by Art Lader -
Thanks, Brett! Very good info. smile

-- Art
In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick

by Matt Campbell -
Thanks, Brett, for this wonderful resource.  I've set this up for a MoodleMoot we're having here in Oklahoma this July.

I've got 1.5.3 and 1.6 installed, with three users on each - admin, teacher, and student.  The password for each is moodle.

This is available at http://instructor.metrotech.org/~mcampbell/ and if anyone would like to test it, you're more than welcome to take a look.  It will need to go on a 512 meg USB stick, with plenty of room for courses.  Please let me know what you think, along with any problems or course suggestions you may have.

Thanks,
Matt
In reply to Matt Campbell

Re: Moodle for Windows on a USB Stick

by Kristian Besley -

Hi all,

even though this is probably against the whole principle of WOS portable, has anyone got it working over a local network? I've tried some instructions related to getting a wiki working and have had no joy. I always get the following permissions error whatever I try to open from a remote machine:

Forbidden

You don't have permission to access /index.php on this server.


Apache/2.2.0 (Win32) PHP/5.1.2 Server at 10.10.1.189 Port 80

Has anyone got any ideas?

Thanks,

Kris

In reply to Kristian Besley

Re: Moodle for Windows on a USB Stick

by Matt Campbell -
By default, WOS is set up to only allow access to localhost. You'll need to uncheck this and add the hosts you want to give access to. You can specify inidividual IPs or you can say 'all' - I haven't tried it from a subnet.

To get to the screen I'm showing, click 'Options' on the menu bar.

You'll also need to change this line in config.php:

$CFG->wwwroot   = 'http://localhost/moodle1';

and replace localhost with your IP address.

Moodle 1.6 will need the same change if you want to run it, except the folder is moodle2.

Thanks,
Matt

Attachment wos_settings.JPG
In reply to Matt Campbell

Re: Moodle for Windows on a USB Stick

by Bee Bell -
Matt, please help.

Did everything explained here.
When I clicked start.exe, the small window that shows WOS Portable - Status says:
Apache is not running
MySQL is running

I'm connected to a network!

So I tried what you suggested using the Options.
Unchecked the option "only allow access... (localhost) and
added "all" to "allow access from following IPs"

Still Apache does not run. When I click start.exe Internet Explorer opens with the URL: http://localhost/start/?lang=en and the message: The page cannot be found, etc, etc.

I have not installed Moodle yet in the USB stick because I want to be sure that Apache runs first.

Thanks for any help you can provide. I really need to install some Moodle courses on a stick to send them to a learner without Internet connections.
In reply to Bee Bell

Re: Moodle for Windows on a USB Stick

by Brett Drinkwater -
Hi Bee,

It's possible you may already be running something on port:80, eg: IIS, skype, xampp etc. which causes apache to fail

Try the following tip from the WOS WIKI:

What can I do if Apache is not starting?

Try the following: Press->Start->Execute->Input "cmd"->ENTER->Change to the WOS directory using cd c:\your\path\to\wos\apache2\bin

Then enter "apache -t" and press ENTER.

If the output is "syntax OK", just try to start apache:

"apache" and press enter.

Then in most cases the output is:

make_sock: could not bind to address 0.0.0.0.:80
No listening sockets available, shutting down
Unable to open logs.

This means you already have another application running on port 80 (eg. another webserver, skype or something like that). There are two solutions:

  1. Terminate this application
  2. Change the port of apache: Open the httpd.conf. Look for the line "Listen 80" replace it with "Listen <port>" (eg "Listen 8080"). Look for the line "ServerName localhost:80" and replace it with "ServerName localhost:<port>" (eg. "ServerName localhost:8080"). You must use at both lines the same port. Restart apache. Call localhost:<port> or 127.0.0.1:<port> (eg. 127.0.0.1:8080).

Let me know how you go.

Cheers
Brett
In reply to Matt Campbell

Re: Moodle for Windows on a USB Stick

by Brett Drinkwater -
Excellent Matt!
Great idea to provide the complete package in one zip file.  I've included your URL in the Moodle Docs version of this install guide.  Please let me know if you'd rather not have it there.

Hope the July Moot goes well.

Cheers
Brett
In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick

by Bee Bell -

Should the instructions for the entire package change? The current isntructions are relevant when each of the components have to be donwloaded separatetly. 

It would be good to include some "details" in the installation instructions such as what happens if the computer where the USB is is connected to the Internet through a network.

I have disconnected from the network. Folowed the instructions to change to port to 8080 as posted by WOS people and in this Forum, I rebooted each time and tried for many many hours to do this and nothing works so far.

In reply to Bee Bell

Re: Moodle for Windows on a USB Stick

by Matt Campbell -
I've got an coworker doing some testing for me right now and he's having the same problem - but he can plug his USB stick into another system and it works just fine. I also tried changing the port for him, but no joy. It's got to be something the system is doing - a service or something. I'll try to spend some time on his system tomorrow and see if I can figure it out.

I just had an opportunity to test this and got some weird results - different USB stick, his machine - works.  His USB stick, different machine - works.  His USB stick, his machine - doesn't work. 

So my next question would be, do you have a different machine or different USB stick you could try this with?

Thanks,
Matt

P.S. If it was working, would the instructions in the readme.txt in my zip file be good enough, or is there something I could improve?

In reply to Matt Campbell

Re: Moodle for Windows on a USB Stick

by Bee Bell -
Could you write very clear instructions on what to do with the "complete package in one zip file".

I download it from the Moodle docs version of the install guide and when I tried to extract it to the UBS stick it did not fit. The stick is 512 MB.

So I had to unzip it to my hard drive and then copy, one-by-one each of the directories and test what it fits.

\Apache2
\ImageMagick (does this need to be there really?)
\mysql
\php4
\php5 (this is the last one right?)
\www\moodle1 ( I guess this is version 1.5.?)
\ww\moodle2 (I guess this is version 1.6????)
\www\moodledata (does this corresponds to moodle1?)
\www\moodledata2

I did not copy ImageMagick, php4 and www\moodle2 neither www\moodledata2

The whole process of elimination to see what it fits is very, very long time, of course.

Then when I run start.exe on the stick I got a message saying some file in ph4 did not exist so I have to erase php5 and copy php4.
 
The whole process of elimination to see what it fits is very long, of couse.
Then when I run start.exe on the stick I got a message saying some file in ph4 did not exist so I have to erase php5 and copy php4. The it told me that something in ph5 did not exist and could not run. The it told me that the disk was full and I could not do anything else.

Thanks for any help


In reply to Bee Bell

Re: Moodle for Windows on a USB Stick

by Brett Drinkwater -

Hi Bee,

Sounds like you are having a tough time with this MOS istallation. sad

There is no conceiveable reason why the complete package would not fit on a 512stick. It's not partitioned is it??

I think your best bet is to start from scratch. (I know, more wasted time, sorry smile ) Delete all content from your USB stick and run it through a quick reformat. In Windows XP go to MyComputer, find your stick, <Right Click> and select Format from the menu.

Once that is done, windows will tell you how much space is on the drive. If it doesn't say 512 then you may have a faulty memory stick.

If all that works fine, unzip your complete installation to your local hard drive and then copy the unzipped package to your USB stick.

Now go to the stick, open the folder and run START.EXE.
You'll see the following dialogue box:
WOS

Open your browser and go to http://localhost/start/index.php

You should then see the following:
WOS start page

Set up your database by clicking on the phpMyAdmin link on the start page.

In phpMyAdmin, insert a name for your database and click "Create"

No need for a mysql password at this point, unless you are opening this installation to the world.

Now you should be able to install either of the moodle packages. Using the directory and settings I've outlined above, the URL to begin installation would be:

 http://localhost/moodle1/install.php. (Moodle 1.5.3)

http://localhost/moodle2/install.php  (Moodle 1.6)

If you are going to install both versions of moodle, you'll need to remember to either create a second database or use a different Table Prefix during the second installation.

Hope this helps to bring your efforts to a successful conclusion.

Cheers
Brett

In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick

by Bee Bell -
Thanks for trying to help.

Formatted stick.

Installed everything on F:

This time it fits

Disconnected cable fomr network. Rebooted computer

Run start.exe

A small window entitle WOS Portable appears saying apache is running and MySQL is running

Then Internet Explorer opens and the URL address is

http://localhost/start/?lang=en

With the message:

The page cannot be found

The WOS Portable window says apache is not running.

Changed the Options to say All instead of the default IP.

Same thing happens.

So I'm still stuck there!


In reply to Bee Bell

Re: Moodle for Windows on a USB Stick

by Brett Drinkwater -

Bee,

Just noticed in the complete package that Matt has already configured the databases for both installations. So, disregard most of my recent post and take a look at the instructions outlined in Matts readme.txt file

Readme File from the Complete installation package

==================
This installation assumes that your USB key is set to Drive F. 

Please set this accordingly, or change /www/moodle1/config.php and /www/moodle2/config.php to reflect the proper drive letter.

Then, double click on the start.exe and follow the instructions on the screen.

Your browser should open automatically and give you a start page.  If your browser doesn't open, open a browser and enter:

http://localhost/moodle1 - if you want Moodle 1.5.3

or

http://localhost/moodle2 - if you want Moodle 1.6

Usernames and passwords for both installations are:

Admin - moodle
Teacher - moodle
Student - moodle

In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick

by Bee Bell -

Been there, done that.

Nothing works!

Thanks anyway, I guess I will have to give up with this approach and try another.

In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick

by Matt Campbell -
No problem at all!  I'm glad to be able to contribute something back.
In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick

by Athail Pulino -

Dear Brett:

Following your instructions I got WOS installed and working (not the small which do not have phpmyadmin). Then, created the database moodle and everything worked fine.

After download and unzip moodle-latest-15.zip and unzip it to the pendrive (on www directory) I started to install (I have installed Moodle a lot of times since version 1.4.1) and get the the screen attached to this message.

Any advice.

Thanks in advance.

Athail Pulino

Attachment Image3.jpg
In reply to Athail Pulino

Re: Moodle for Windows on a USB Stick

by Matt Campbell -
Try changing your Moodle and Data directories to:

E:\www\moodle1
E:\www/moodledata

I'm not quite sure why you would have the double slashes or the wos directory - the www folder should be in the root of your USB drive.


In reply to Athail Pulino

Re: Moodle for Windows on a USB Stick

by Brett Drinkwater -
Athail Pulino wrote:
After download and unzip moodle-latest-15.zip and unzip it to the pendrive (on www directory) I started to install (I have installed Moodle a lot of times since version 1.4.1) and get the the screen attached to this message.

How did you go with this Athail?

Did you have any luck following Matt's recommendations?

You need to move your directories up one level so that www is at the root ie: E:\www\moodle

Also be sure to use the WOS control panel to change the path as this makes the necessary changes in the apache configuration file.

Regards
Brett

In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick - Dealing with Drive changes.

by Paul Andrews -
One problem with WOS + Moodle is that Moodle depends on knowing the drive letter that's been assigned to the USB stick - it needs the path info for it's config.php file.

However, you can tweak Moodle's Config to pick up the drive letter using

$path = getenv('DOCUMENT_ROOT');

and then get the drive letter using:

$drive = $path {0};

So now this config.php should always work, no matter which drive the PC assigns to the USB stick - code is below & the file is attached.

Red - bits to add.
Green - bits that are specific to my install & would need to be changed to suit your install.

smile



<?php  /// Moodle Configuration File

unset($CFG);

$path = getenv('DOCUMENT_ROOT');
//echo $path."Moodle";
$drive = $path {0};
//echo $drive;

$CFG->dbtype    = 'mysql';
$CFG->dbhost    = 'localhost';
$CFG->dbname    = 'moodle';
$CFG->dbuser    = 'root';
$CFG->dbpass    = '';
$CFG->dbpersist =  false;
$CFG->prefix    = 'mdl_';
$CFG->wwwroot   = 'http://localhost/moodle';
$CFG->dirroot   = $drive.':\Mobile_Moodle\www\Moodle';
$CFG->dataroot  = $drive.':\Mobile_Moodle\www/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.
?>






In reply to Paul Andrews

Re: Moodle for Windows on a USB Stick - Dealing with Drive changes.

by Rosemary Leadley -

 Apologies for cross posting but I think this is the best forum for this problem.

 I am having problems getting Moodle to run from a stick - for demo purposes.

Gave up with this a few weeks ago but returned to it again this weeked and getting same problem.

Unzipped the whole package to the usb and ran WOS from the stick first time. Stick is drive F: as recommended.

Two machines XP home and  XP Pro tried and problem replicates.

MySQL and Apache runs - browser opens but get can't find page - I attach a shot of both the browser page and WOS Control Panel in hope of any ideas you may have?

Any help gratefully received.

Rosemary 

In reply to Rosemary Leadley

Re: Moodle for Windows on a USB Stick - Dealing with Drive changes.

by Ted Hastings -

Hi,

I am having exactly the same problem. I've tried it on two different PCs, both running Windows XP professional, and a laptop running Windows XP Home.

I've also tried it on a virgin installation of Windows XP Professional running under Microsoft Virtual PC.

All have produced the same results as described by Rosemary.

It looks as if the problem is pretty fundamental to Windows XP or some of its default settings.

Regards,

Ted

 

 

 

In reply to Ted Hastings

Re: Moodle for Windows on a USB Stick - Dealing with Drive changes.

by Rahim Virani -
Sounds like you guys are having problems with windows.

Might I make a suggestion instead of hacking up the MOS install.

The stick is not mapping to f:\?

Fix it the windows way :\

If this is the case, right click on my computer --> Manage
This will load the microsoft managment console
on the left hand side click "disk managment" then right click on the drive label (closest to the left) and remap the drive (the one that your usb stick is currently recognized as).

BE CAREFULL YOU CAN DO SOME SERIOUS DAMAGE in Microsoft Management Console!

Hope this helps smile
In reply to Ted Hastings

Re: Moodle for Windows on a USB Stick - Dealing with Drive changes.

by Rosemary Leadley -

 

 

Hi Ted

I did getting to work eventually - this seemed to be the key for me.

Hope it helps

Rosemary

http://moodle.org/mod/forum/discuss.php?d=49642&parent=237647

Average of ratings: Useful (1)
In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick

by Hannah Mathias -

Is there anyone in Wales or close to, who would be like to come and talk to the Wales Moodle User Group on 16th March about how they are using Moodle on a memory stick?

We'd only be able to cover expenses!

Thanks

Hannah

In reply to Hannah Mathias

Re: Moodle for Windows on a USB Stick

by Don Schwartz -
Gee Hannah I'd love to come if you'd expense me from the US. Seriously. Only about $850 US round trip. big grin

I spoke on this topic at the Northeast Moodlemoot last June and would love to help anyone who needs assistance.

My presentation has now been posted here.

I've yet to add voice or additional text to what is a Moodle Book Slideshow but what is there should be helpful to a knowledgeable Moodler.

Just a bit of my introduction.

**Above all else remember this**
1 - Install with Xampp to your hard drive first then move it to the Thumb.
2 - Port 80 must be free. If running another local web server or Skype, shut them off.
3 - The Moodle config.php will probably need editing on different PCs as the USB drive will be a different drive letter.
In reply to Don Schwartz

Re: Moodle for Windows on a USB Stick

by Hannah Mathias -

Hi Don

Wish I could get you over from the states!! I've managed to find someone in Wales t o talk about it. But I'll make your presentation available too if thats ok?

Thanks

Hannah

In reply to Hannah Mathias

Re: Moodle for Windows on a USB Stick

by Don Schwartz -
Hannah,

Please do use the presentation.

What is the date of the event? I'll try to update with voice or text.

ds
In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick

by Pedro Caldeira -

Hello Fellows


I’m trying to install moodle in my USB Stick and I`m getting stuck at the setup database step.


Problem is that i can`t see any PHPMyAdmin link on WOS the Start page , as you can see above :

WOS page

Any help is appreciate

Regards

In reply to Brett Drinkwater

Re: Moodle for Windows on a USB Stick - PHP config

by Ben Newton -

I have installed moodle and Wos on a 1 gig usb as reccommended but can not seem to alter the PHP config file so am getting a problem on the second page of the moodle install. It tells me that I have a problem with the register_globals needing to be turned off and magic_quotes gpc turned On. How do I do this? I can see the config file but am not very technical so I dont know what to do with it. Any help would be appreciated.

Thankyou

Ben

In reply to Ben Newton

Re: Moodle for Windows on a USB Stick - PHP config

by Stuart Mealor -

Hi Ben

This question relates to basic Moodle installation/setup (not specific WOS/MOS)

Halfway down look at: Check PHP settings section

Stuart

In reply to Stuart Mealor

Re: Moodle for Windows on a USB Stick - PHP config

by Emma Duke-Williams -
Unlike Brett, who started this thread, I just couldn't get Moodle with WOS working at work; no matter what I tried! I had the problem that I have seen others mention of WoS starting, and then promptly stopping. I came to the conclusion that it was something to do with the way Networked machines were set up (I have admin rights on mine, but it still wasn't enough). I could get it going at home, so I knew that I was nearly there!

However, I eventually found Pierre Gorissen's video of using Xampp to do it. With a little scepticism I tried it - and was very pleased to find that not only did it work on my computer, it even worked on a very locked down student PC!
In reply to Emma Duke-Williams

Re: Moodle for Windows on a USB Stick

by Ian Britt -
My apologies if the is the wrong thread etc. I was hoping to get some help on why I have no "restore" icon in my moodle 1.8 running on a USB stick. I can create coursed and back them up but not restore.

I have moodle 1.5 running at my website and have been able to add courses by "restore" but not on my stick.
In reply to Brett Drinkwater

Moodle for Windows on a USB Stick-Apache nil run

by barbara nance -

hI Brett

Am hoping you can help with what i am sure is a basic problem to many;

Have downloaded and unzipped onto my stick which is F.

However when I try ansd start, Apache is not running

MySQl is fine

Please could you help. BAsic instructions please as am a simpple sole.

Many thanks

B