Thursday 14 February 2013

Mahara and Moodle Integration (Mahoodle)



Greetings,


Here, we will be merging Mahara and Moodle ==> Mahoodle.
I will do this step by step to make it easier so that anyone can understand and he/she doesn't need to be technical person. So let's proceed with our integration

  • Open your favourite browser (mine is Opera) and browse 
  • http://localhost/mahara

  • Once the site is up and running please do click on Administration

  •  Now, within Configure Site, you can see Networking, do click Networking

  • Here, you can see WWW root, the Public Key, SHA1 Fingerprint, MD5 Fingerprint, Public key expires, Enable networking, Auto-register all hosts and Delete this key
  • Now, we just need to enable networking to yes from the drop down menu and the save changes.

  • Now, lets shift to Moodle and do the similar something.
  • Browse http://localhost/moodle

  • This is a bit different that mahara therefore, 
  • First, let's open up Site Administration ==> Advance Features
  • By default networking is turned off, so let's enable to yes and save changes.

  •  Since we enable or turned on the networking, we should be able to see Networking in Site Administrator.

  •  Now, let's go back to Mahara ==> Admin Home ==> Manage institution ==> Institution
  •  Click on Add Institution, fill in the form and when you see Authentication Plugin select XML-RPC

  • Authority Name: Mahoodle XMLRPC
  • WWW root : http://localhost/moodle
  • Site Name: Whatever you like
  • Allow ==> Update user info on login
  • Allow ==> We auto-create users 
  • Allow ==> We import content
  • You can have a look at the image above and set it accordingly and once your done then click on submit.
  • NOTE:- From Authentication plugin Add Internal only if you want users to login directly to Mahara without being redirect via Moodle. If you add both Internal and XMLRPC then user will be able to login directly and redirect both.
  • Now, again lets go back to moodle
  • Site Administrator ==> Networking ==> Manage Peers
  • In Hostname add Mahara's WWW root and in Application Type add Mahara

  •  Once you add host, moodle will fetch the public enctyption key rom the mahara server and display it.

  •  Now you can save the page and once again you will get the same page but with few other tabs. Once you get other tab click on Services to setup SSO with mahara.

  •  Here, lets just focus at SSO (Identity Provider) and SSO (Service Provider).
  • Check on SSO (Identity Provider) ==> "Publish"
  • Check on SSO (Service Provider) ==> "Subscribe"
  • then save changes

  •  Here, we need to enable Moodle Network Authentication (MNet authentication)
  • Click on Site Administration ==> Plugin ==> Authentication ==> Manage Authentication
  • Enable MNet authentication
  •  Now, lets click on Site Administrator ==> Users ==> Permission ==> Define Role

  • Click edit on Authenticated User and allow Roam to a remote application via MNet.
  • Now that we have finished giving mahara users permission, we can setup a a link to bring them to the site.
  • Go back to main page of moodle, on Setting ==> Turn Editing On
  • Now at the bottom you can see Add a Block, from the drop down menu select Network Server and now you should be able to see Mahara

  •  Finally, lets add few users, if already created just log out from both mahara and moodle. If you haven't yet created users then go to Site Administrator ==> User ==> Account ==> Add a new user
  • Now, login as a different user in moodle

  • Now you can see that I have logged in as different user and you can see Network Server (Mahara) as well.
  • Lets create mahara to initiate SSO

  • Now, you can see that the same user who was logged in Moodle is logged in Mahara as well

Wednesday 13 February 2013

Installing Moodle in RHEL, CentOS



Greetings Everyone,

I am pretty sure that most of us know what moodle is and what it does. Moodle is a Course Management System (CMS), also known as a Learning Management System (LMS) or a Virtual Learning Environment (VLE). It is a Free web application that educators can use to create effective online learning sites.

I will now start with the installation process.

  • First of all we need to have a clean RHEL, CentOS, Scientific Linux or Fedora machine with Apache server installed and you can refer it from my earlier blog LAMP or Apache Server installtion
  • Once you have finished installing Apache server we should proceed with moodle installation. Now, we need to download moodle and downloading moodle can be done in various ways but I would prefer downloading it from git. And, yes latest version currently that's the most stable and latest.
# cd /var/www/html

# git clone git://git.moodle.org/moodle.git

# cd moodle
# git branch -a
# git branch --track MOODLE_25_STABLE origin/MOODLE_25_STABLE
# git checkout MOODLE_25_STABLE  
  •  Now, lets create a data root for moodle and change permission and ownership
# mkdir /var/www/moodledata
# chown root:apache /var/www/moodledata
# chmod 770 /var/www/moodledata 
  •  We will be creating a utf8 database and yes, we are still using mysql 
# mysql -u root -p
# your-password
mysql> CREATE DATABASE moodle DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
mysql> GRANT ALL PRIVILEGES ON moodle.* to 'root'@'localhost' IDENTIFIED BY 'yourpassword';  
mysql> FLUSH PRIVILEGES;
mysql> quit 
  •  Lets navigate to /var/www/html/moodle and now we can do it in 2 different ways but I would prefer just copying config-dist.php to config.php or you could php install.php
  • Please do search in config.php and modify the place which are marked in RED below
# cd /var/www/html/moodle
          # cp config-dist.php config.php
# vim config.php
=========================================================================
// 1. DATABASE SETUP
//=========================================================================
// First, you need to configure the database where all Moodle data //
// will be stored. This database must already have been created //
// and a username/password created to access it. //
$CFG->dbtype = 'mysqli'; // 'pgsql', 'mysqli', 'mssql', 'sqlsrv' or 'oci'
$CFG->dblibrary = 'native'; // 'native' only at the moment
$CFG->dbhost = 'localhost'; // eg 'localhost' or 'db.isp.com' or IP
$CFG->dbname = 'moodle'; // database name, eg moodle
$CFG->dbuser = 'root'; // your database username
$CFG->dbpass = 'xxxxxx'; // your database password
$CFG->prefix = 'mdl_'; // prefix to use for all table names
$CFG->dataroot = '/var/www/moodledata';
$CFG->wwwroot = 'http://localhost/moodle';
  •  Once you have finished modifying /var/www/html/moodle/config.php. I am pretty sure everything is now ready to roll but lets fix permission before we browse and check it.
# chown -R root:apache /var/www/html/moodle
# chmod -R 770 /var/www/html/moodle 
  •  Now open your favorite browser and type in http://localhost/moodle, I am sure you should be seeing 
  • But in case you get "403 Forbidden Error", then try setting SELinux to permissive mode or Disable it

# setenforce 0
# getenforce (to check if its in permissive or enforcing mode)
 
  • Once you press continue, don't you worry it will perform server check and php extension and if you don't have you go back to terminal and install it


  • So let's install php extension (soap, xmlrpc and intl) and restart apache server
# yum install php-soap php-xmlrpc php-intl
# /etc/init.d/httpd restart 
  • Once these extensions are installed we are ready to rumble and the browser would look like this

  •  Finally, it will check if everything is working regarding moodle installation and create an account then your done.
  • Happy working with MOODLE


Tuesday 12 February 2013

Installing Mahara in CentOS, RHEL 6.3



First of all, mahara is a web application to build a eportfolio system. And I think most of you should know what mahara is therefore, I won't be explaining each and everything and instead going directly to Installation process.

Installation Process either in REHLor CentOS or Fedora but it will be similar to debian and ubuntu version as well

  • First we install LAMP or Apache, MySQL and PHP. I won't be going to installation of apache server, you can go to my blog where I have shown apache installation.
LAMP or Apache Server installtion
  • Now we need to remember to most up-to-date system
# yum update
  • Now, we can install git, there are other various ways to download and install but I would prefer to install via git
# cd /tmp
# yum install -y git
  •  Now, that's done we can begin download mahara
# git clone git://gitorious.org/mahara/mahara.git
# cd mahara
# git checkout -t origin/1.4_STABLE
  • Now, we need to copy files that are inside of htdocs to /var/www/html. And honestly, it doesn't need to be in /var/www/html, it can be anywhere but within your document root.
# cp -varpf htdocs /var/www/html
# cd /var/www/html
# mv htdocs mahara
  • So, now we have mahara folder in /var/www/html. Go inside the mahara folder and copy config-dist.php to config.php
# cd mahara

# cp config-dist.php config.php
  •  Use your favorite editor to edit the config.php file. I usually use VIM or gedit. And modify only in places where you see RED colour is highlighted. As, you can see, I am using MySQL but you can use PostgreSQL. Dataroot is where the mahara will be storing the data therefore, we can create it once we have modified and we know which name to use. I have used maharadata.

  •  Lets create a maharadata folder and change ownership to apache:apache (that's for Redhat and for Debian it should be www-data:www-data)
    # mkdir /var/www/maharadata
    # chown apache:apache /var/www/maharadata
  • Please dont' forget to create a database that use UTF8 character set. You can create it during installation of MySQL or now it doesn't really matter but I prefer it this way cause, I learned it this way. :)
# mysql -u root -p
# your-password
mysql> CREATE DATABASE mahara DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;
mysql> GRANT ALL PRIVILEGES ON mahara.* to 'root'@'localhost' IDENTIFIED BY 'yourpassword';  
mysql> FLUSH PRIVILEGES;
mysql> quit
# vim config.php
// MAHARA CONFIGURATION FILE
//
// Copy this file from config-dist.php to config.php, and change the values in
// it to suit your environment.
//
// Information about this file is available on the Mahara wiki:
// http://wiki.mahara.org/System_Administrator's_Guide/Installing_Mahara#Create_Mahara's_config.php
//
$cfg = new StdClass;
// database connection details
// valid values for dbtype are 'postgres8' and 'mysql5'
$cfg->dbtype = 'mysql5';
$cfg->dbhost = 'localhost';
$cfg->dbport = null;
$cfg->dbname = 'mahara';
$cfg->dbuser = 'root';
$cfg->dbpass = 'xxxxxxx';

// This path must be writable by the webserver and outside document root (the
// place where the Mahara files like index.php have been installed).
// Mahara will NOT RUN if this is inside your document root, because
// this is a big security hole.
$cfg->dataroot = '/var/www/maharadata';
$cfg->wwwroot = 'http://localhost/mahara/';
  • Now, just restart both httpd and mysqld servers and the browse localhost/mahara 
# /etc/init.d/httpd restart
# /etc/init.d/mysqld restart
Troubleshooting in case error
  • Most probably it should work and in case if your getting following error stating
                      Mahara: Site Unavailable
  • Then that basically means that the server is not being able to find data root maharadata. I would suggest you to create a another directory first, give permission then change the dataroot. I think this way it should perfectly work.
Main Installation of Mahara
  • Now I am pretty sure everyone can follow from there and its fairly simple, few clicks and everything will be up and running.