Moodle GApps

by Rashan Anushka

Contents

Introduction

Google Apps is a collection of collaboration and communication tools hosted by Google. Currently it has 3 editions; the Standard Edition, the Premier Edition and the Education Edition. The good thing about Google Apps, as far as the educational institutes are concern, is that the Education Edition, which is very similar to there Premier Edition, is given freely and it provides a wide range of services including some communication tools like email, gTalk and some collaborative tools like Calender, docs/spreadsheets etc... Also it has some well documented APIs which can be used to integrate all these services into institution's existing IT infrastructure.

On the other hand Moodle is a course management system (CMS) designed using sound pedagogical principles, which is distributed freely under GNU GPL license. It has a very large user base as well as a active developer base. According to http://moodle.org/stats, Moodle is being used by about 15 million users around the world.

This document's primary focus is on how to integrate these two very popular and widely used systems so that users can experience the excellent services provided by these two products under one roof.

Requirements

Note: Currently the code is tested on Linux environment with above configurations only.

Current Status & Future Development

Currently the following is possible via Moodle;

The following developments have been planed in future;

Installing and Configuring the code for Moodle 1.8.3+

 yum install httpd php php-xml xmlsec1 xmlsec1-openssl
    <temp_location>
          | _ _ admin
          |       |_ _ gapps
          |
          | _ _ mail
     define('GAPPS_USERNAME', 'your_googleApps_admin_username');
     define('GAPPS_DOMAIN', 'your_googleApps_domain_name');
     define('GAPPS_PASSWORD', 'your_googleApps_admin_password');
     define('GAPPS_USERNAME', 'your_googleApps_admin_username');
     define('GAPPS_DOMAIN', 'your_googleApps_domain_name');
     define('GAPPS_PASSWORD', 'your_googleApps_admin_password');
     define('XMLSEC',path_to_xmlsec_binary');  // if the binary is in your PATH, then it is ususally 'xmlsec1'
     define('LD_LIBRARY_PATH','path_to_xmlsec-openssl_library'); // Usually it is '/usr/bin'
$ADMIN->add('misc', new admin_externalpage('gapps', 'Google Apps', "$CFG->wwwroot/$CFG->admin/gapps/"));

Configuring Google Apps

Sign-in page URL

http://<YOUR_MOODLE_PATH>/mail/index.php

Sign-out page URL

http://<YOUR_MOODLE_PATH>/index.php

Change password URL

http://<YOUR_MOODLE_PATH>/mail/index.php

Note: For production use, please follow the instruction given bellow on generating certificates.


Appendix: Generating Certificates

This section will briefly explain how to generate your own certificate and PKI keys by using OpenSSL to be use in a production environment. The keys and certificates can be based on either RSA or DSA.

For RSA based keys

openssl genrsa -out myrsaprivkey.pem 1024

Since the code expect the keys in DER format, the following is necessary;

openssl rsa -in myrsaprivkey.pem -pubout -outform DER -out myrsapubkey.der
openssl pkcs8 -topk8 -inform PEM -outform DER -in myrsaprivkey.pem -out myrsaprivkey.der -nocrypt

For DSA based keys (Recommended)

openssl dsaparam -out mydsaparam.pem 1024
openssl gendsa -out mydsaprivkey.pem mydsaparam.pem

Since the code expect the keys in DER format, the following is necessary;

openssl dsa -in mydsaprivkey.pem -outform DER -pubout -out mydsapubkey.der
openssl pkcs8 -topk8 -inform PEM -outform DER -in mydsaprivkey.pem -out mydsaprivkey.der -nocrypt
openssl req -new -x509 -key mydsaprivkey.pem -out mycert.pem

Note: In the case of RSA keys, you should replace the private key above with myrsaprivkey.pem