Skip to navigation

PCPro-Computing in the Real World Printed from www.pcpro.co.uk

Register to receive our regular email newsletter at http://www.pcpro.co.uk/registration.

The newsletter contains links to our latest PC news, product reviews, features and how-to guides, plus special offers and competitions.

Real World Computing

Virtual machines, real users

Posted on 18 Jun 2009 at 11:06

Jon Honeyball keeps up with virtualisation and calls for greener servers, while David Moss continues setting up a course management system.

From here you can select the version of Moodle that you wish to install: I went for the latest weekly build, which at the time of writing was 1.94+, and is indicated as the best choice for a new server installation. (If you're feeling a bit more adventurous you could of course go for the latest build of Moodle 2 beta.) Once it's downloaded, extract the files to a folder called Moodle and put this into the root directory of C:, say (you can choose where to put it - one suggestion is to put it in the wwwroot folder, but I opted to keep it out of there).

You then need to set up PHP to work with Moodle. The settings you apply here will vary depending on which version of Moodle you're using, so I'm only going to mention those associated with this installation. For other settings, you'll need to consult the Moodle documentation. Open up the php.ini file and make sure the following elements are correctly set:

file_uploads = on

magic_quotes_gpc = on

magic_quotes_runtime = off

memory_limit = 128M (large sites may need more than that)

register_globals = off

safe_mode = off

session.auto_start = off

session.bug_compat_warn = off

session.save_handler = files

With regard to the PHP extensions required for Moodle, two items listed in the documentation as being recommended for Moodle version 1.6 or later are php_iconv.dll and php_tokenizer.dll. However, these files aren't needed if you're using PHP 5 or later, as the iconv and tokenizer functions are now built in, so no external DLLs are required in this case.

Other recommended extensions are ctype, curl, and openssl, plus sockets if you're going to use chat, and LDAP if you need to do LDAP authentication. All these extensions shipped with PHP, so using them is simply a matter of un-commenting the relevant sections in the Windows Extensions section of the php.ini file.

The next thing to do is configure IIS 7 to work with Moodle. As Moodle wasn't going to be the only web application running on this server, I fired up the IIS Manager and created a new virtual directory for Moodle under the Default Web Site, then converted it to an application in the same way as I had for PHPMyAdmin back in the July 2009 issue.

Now turn your attention to a file called config-dist.php in the Moodle folder. Create a copy of it and then rename it to config.php, load it into a text editor and you'll see the following values in its first section, Database Setup:

$CFG->dbtype = 'mysql'; // mysql or postgres7 (for now)

$CFG->dbhost = 'localhost'; // eg localhost or db.isp.com

$CFG->dbname = 'moodle'; // database name, eg moodle

$CFG->dbuser = 'username'; // your database username

$CFG->dbpass = 'password'; // your database password

$CFG->prefix = 'mdl_'; // Prefix to use for all table names

Change these values to reflect the ones you've set up for your own database, database user, password and the rest, then in the next section, Web Site Location, you'll need to set the location for your Moodle installation in the following line, which in my testing case was:

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

Next up is Server Files Location, which you set here (this is my example):

$CFG->dirroot = 'C:moodle';

After that you need to supply the Data Files Location (again, my example):

$CFG->dataroot = 'D:moodledata';

Once it's all done you can turn your attention finally to installing Moodle. See you next month for the next nail-biting instalment.

David Moss

1 2 3 4
Be the first to comment this article

You need to Login or Register to comment.

(optional)

Jon Honeyball

Jon Honeyball

Jon is one of the UK's most respected IT journalists and a contributing editor to PC Pro since it launched in 1994. He specialises in Microsoft technologies, including client/server and office automation applications.

Read more More by Jon Honeyball

advertisement

Latest Real World Computing
Latest Blog Posts Subscribe to our RSS Feeds
Latest News Stories Subscribe to our RSS Feeds
Latest Reviews Subscribe to our RSS Feeds

advertisement

Sponsored Links
 
SEARCH
SIGN UP

Your email:

Your password:

remember me

advertisement


Hitwise Top 10 Website 2008