Mar 5, 2009

The Uniform Server Revisited

There are times when you're writing a blog that you know that you're the only one reading it or that you're writing the post for a specific event or purpose. I wrote a post a while back about the Uniform Server that I was using frequently at the time. Well, times change as do my interests and the Uniform Server wasn't updating itself quick enough to accommodate the many changes in Moodle. Plus, Moodle began offering Moodle packages for Windows based on XAMPP, and I began to think that UniServer was a dead project. This led me to recommend that new Moodlers download the Moodle windows packages and/or download XAMPP and Moodle individually.

Today's RSS feeds brought me a surprise, though, Around the Corner - specifically mentioned this old article in his discussion of a Moodle "sandbox" for those new Moodle administrators - Set Up Your Own Moodle Server for Training. So, I went back to my old favorite and discovered that UniServer had recently been updated to version 4.0-Mona. This version isn't specificially mentioned on the Uniform Server website (yet), but, is the latest version available at their SourceForge project page.

A quick download - only 8.8 MB - , a trip to for the latest Weekly Build, then a glance at the Uniform Server Wiki and I had a brand new "vanilla" Moodle to play with.

I was impressed with the new "Unicontroller" that allows you to easily view and start your server. The "Apanel" is simple to use, and relatively self explanatory. I was also very happy to see that UniServer was able to install the latest weekly build of Moodle without any hiccups what so ever.

UniServer is not quite ready for Moodle 2.0, however - when I looked at http://localhost/moodle/admin/environment.php?version=2.0, it showed that the Zip PHP Extension is not available - all other components passed.

NOTE: This problem is actually VERY easy to overcome. According to Moodle Docs: admin/environment/php extension/zip all that needs to happen is to "uncomment the line extension=php_zip.dll in the php.ini file". After checking my Uniserver folder at F:\UniServer\udrive\usr\local\php, I noticed that the php_zip.dll file is missing from the extensions folder. So, I downloaded the Windows Binary zip file at and then copied the php_zip.dll file from the ext folder into F:\UniServer\udrive\usr\local\php\extensions. I then opened up the php.ini file in Notepad and removed the ";" from the extension=php_zip.ini line (line 602 in my php.ini file).  Restart Apache (Stop Apache and then Start Apache) and this restriction is gone!

The Installing Moodle on 4.0-Mona article on the UniServer Wiki has some really good tips here. I'd want to point out to portable (flash drive) users the section on Hard Coded Paths. The most amazing thing I've ever seen was their discussion on how to Automatically Run Cron. Honestly, I'd long ago given up on Cron in XAMPP or UniServer and just manually run Cron when I needed to. The steps here work - amazing....

It's also interesting to note that the steps that I originally mentioned in "How to enable The Uniform Server for public access" are still applicable in 4.0-Mona. Making those simple changes in the .htaccess file will enable external users to view your site hosted with UniServer.

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';

In conclusion, The Uniform Server (UniServe) is an excellent alternative to XAMPP. It may actually be preferred over XAMPP due to it's simplicity and more obvious - it's size. A default XAMPP install is approximately 221 MB, XAMPPlite is approximately 116 MB. UniServer is only 43.4 MB. UniServer with a default Moodle install (including php_zip.dll) is approximately 94.5 MB.

The Uniform Server is one alternative to hosting a "sandbox" Moodle Server for Training. I will admit that I gave up on this powerful little WAMP server, but, I won't again. Give it a try, I think it should meet your needs and save you a little space too!


Ric said...

Excellent write up. If you check out 4.3-Mona that missing php_zip.dll is now included with this new version.

Your tip and modification for “moving from event to event.” Looks very useful hence taken the liberty and will post on UniServer Wiki

All the best

gdunc said...

FYI... the Wiki Entry can be found at Installing Moodle on 4.0-Mona

This wiki made installing Moodle sooo simple on UniServer. Check it out!!