Wednesday, December 10, 2014

DSpace, LAMS, Mahara and OpenSim install on CentOS...

There are five blogs in this series.

Please select the link below as required:-

DSpace Install Blog 

LAMS Install Blog 

Mahara Install Blog

OpenSim Install Blog

Server Syncronisation Blog

Upgrading to Mahara 1.10.1

Upgrading to Mahara version 1.10.1

I followed a similar process to previous upgrades in upgrading from 1.9.2

Login as the root user

Back up database

pg_dump -U mahara mahara > ../mahara_dump_Dec_14

Download the latest release of Mahara 

wget https://launchpadlibrarian.net/191203866/mahara-1.10.1.tar.gz

Create/modify the upgrade shell script and then run it

[root@vle bin]# cat upgrademahara
cd /root
echo "Please put Mahara into maintenance mode before performing the upgrade
echo "Please download the latest version of Mahara into the root users home directory
echo "Please backup the database from the BASH command line e.g.  pg_dump -U mahara mahara > mahara_dump_Dec_14"
echo "Press any key when ready"
read dummy
echo "Enter new version number of Mahara to upgrade to e.g. 1.10.1"
read newver
echo "Enter existing version number of Mahara to backup e.g. 1.9.2"
read oldver
mv /var/www/html/mahara /root/mahara_old_$oldver
tar -xzvf mahara-$newver.tar.gz
cd mahara-$newver
cp -pr htdocs /var/www/html
mv /var/www/html/htdocs /var/www/html/mahara
cp /root/mahara_old_$oldver/config.php /var/www/html/mahara
cp -pr /root/mahara_old_$oldver/artefact/outcome /var/www/html/mahara/artefact
echo "Please visit http://vle.bromley.ac.uk/mahara to complete the upgrade"

cd bin
nano upgrademahara
chmod 755 upgrademahara
./upgrademahara

There were no issues and the upgrade went smoothly.



Tuesday, July 30, 2013

Upgrading Mahara to version 1.7.2

This proved very straightforward, following the process used with previous upgrades.

All that was necessary was to modify one line of the upgrade shell script to use the version 1.7.x repository as shown below:

wget http://launchpad.net/mahara/1.7/$newver/+download/mahara-$newver.tar.gz


Thursday, January 10, 2013

Upgrading Mahara to version 1.6.2

Upgrade from 1.5.1 to 1.6.2

To be on the safe side backup up the database before proceding with the upgrade:
[root@vle bin]# pg_dump -U mahara mahara > ../mahara_dump_Jan13

I used the following modified script for the upgrade:

[root@vle bin]# cat upgrademahara
cd /root
echo "Please put Mahara into maintenance mode before performing the upgrade
"echo "Press any key when ready"
read dummy
echo "Enter new version number of Mahara (must be 1.6 series) to upgrade to e.g. 1.6.2"
read newver
echo "Enter existing version number of Mahara to backup e.g. 1.5.1"
read oldver
wget http://launchpad.net/mahara/1.6/$newver/+download/mahara-$newver.tar.gz
mv /var/www/html/mahara /root/mahara_old_$oldver
tar -xzvf mahara-$newver.tar.gz
cd mahara-$newver
cp -pr htdocs /var/www/html
mv /var/www/html/htdocs /var/www/html/mahara
cp /root/mahara_old_$oldver/config.php /var/www/html/mahara
cp -pr /root/mahara_old_$oldver/artefact/outcome /var/www/html/mahara/artefact
echo "Please visit http://vle.bromley.ac.uk/mahara to complete the upgrade"


On visiting the upgrade page the upgrade ran smoothly

Thursday, June 21, 2012

Upgrading Mahara to version 1.5.1

Upgrade from 1.4.1 to 1.5.1

To be on the safe side backup up the database before proceding with the upgrade:

[root@vle bin]# pg_dump -U mahara mahara > ../mahara_dump_June12


I used the following modified script for the upgrade:

[root@vle bin]# cat upgrademahara
cd /root
echo "Please put Mahara into maintenance mode before performing the upgrade
"echo "Press any key when ready"
read dummy
echo "Enter new version number of Mahara (must be 1.5 series) to upgrade to e.g. 1.5.1"
read newver
echo "Enter existing version number of Mahara to backup e.g. 1.4.1"
read oldver
wget http://launchpad.net/mahara/1.5/$newver/+download/mahara-$newver.tar.gz
mv /var/www/html/mahara /root/mahara_old_$oldver
tar -xzvf mahara-$newver.tar.gz
cd mahara-$newver
cp -pr htdocs /var/www/html
mv /var/www/html/htdocs /var/www/html/mahara
cp /root/mahara_old_$oldver/config.php /var/www/html/mahara
cp -pr /root/mahara_old_$oldver/artefact/outcome /var/www/html/mahara/artefact
echo "Please visit http://vle.bromley.ac.uk/mahara to complete the upgrade"


On visiting the upgrade page two errors appeared

Your PHP session.entropy_length setting is too small. Set it to at least 16 in your php.ini to ensure that generated session IDs are random and unpredictable enough.
No site-wide password salt has been set. Edit your config.php and set the "passwordsaltmain" parameter to a reasonable secret phrase.

It was necessary to edit /etc/php.ini and set the session.entropy_length parameter as follows

session.entropy_length = 16

[root@vle bin]# nano /etc/php.ini

After which Apache was restarted for the changes to take effect:

[root@vle bin]# service httpd restart

A number of additional lines needed to be added to the existing config.php file:

// If set, this email address will be displayed in the error message if a form
// submission is suspected of being spam. This reduces the frustration for the
// user in the event of a false positive.
$cfg->emailcontact = 'helpme@bromley.ac.uk';

// Set this to enable a secondary hash that is only present in the config file
$cfg->passwordsaltmain = 'some long random string here with lots of characters'';

// When changing the salt (or disabling it), you will need to set the current salt as an alternate salt
// There are up to 20 alternate salts
$cfg->passwordsaltalt1 = 'another long random string here with lots of characters'';

// closing php tag intentionally omitted to prevent whitespace issues

The following commands were used to edit config.php

[root@vle bin]# cd /var/www/html/mahara/
[root@vle mahara]# nano config.php


On refreshing the Mahara admin screen the error messages had gone away and I was able to login as the administrator

Thursday, April 23, 2009

Mahara installation and upgrade on Centos 5.x

(Last updated with a guide to upgrading Mahara from 1.4.0 to 1.4.1)

Please scroll to the bottom of this blog for the latest posting.


Installing Mahara

This blog was written after installing Mahara 1.1.2 on a CentOS 5.3 box already running Moodle, LAMS and DSpace.

Please note that in some places these instructions are specific to our installation.

The process I followed is explained below:

Login as root
su - postgres

Create the Mahara user and database in postgresql:
Note that postgresql was already installed and configured during the DSpace installation. For more information please select this link.

-bash-3.2$ createuser -U postgres -d -A -P mahara
Enter password for new role:
Enter it again:
Shall the new role be allowed to create more new roles? (y/n) n
CREATE ROLE

-bash-3.2$ createdb -U mahara -EUTF8 mahara
CREATE DATABASE
-bash-3.2$ exit

nano /var/lib/pgsql/data/pg_hba.conf and add the line
host mahara mahara 127.0.0.1 255.255.255.255 md5
service postgresql restart

Download and install Mahara:

cd
lynx http://eduforge.org/frs/?group_id=176
tar -xzvf mahara-1.1.2.tar.gz
cd mahara-1.1.2
cp -pr htdocs /var/www/html/mahara
cd /var/www/html/mahara
cp config-dist.php config.php
nano config.php

/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2008 Catalyst IT Ltd (http://www.catalyst.net.nz)
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see .
*
* @package mahara
* @subpackage core
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2008 Catalyst IT Ltd http://catalyst.net.nz
*
*/
//
// 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%27s_Guide/Installing_Mahara#Mahara_Configuration
//
$cfg = new StdClass;

// database connection details
// valid values for dbtype are 'postgres8' and 'mysql5'
$cfg->dbtype = 'postgres8';
$cfg->dbhost = 'localhost';
$cfg->dbport = null;
$cfg->dbname = 'mahara';
$cfg->dbuser = 'mahara';
$cfg->dbpass = 'XXXX';
// Note: database prefix is NOT required, you don't need to set one except if
// you're installing Mahara into a database being shared with other
// applications (this happens most often on shared hosting)
$cfg->dbprefix = '';
// wwwroot - the web-visible path to your Mahara installation
// Normally, this is automatically detected - if it doesn't work for you
// then try specifying it here
//$cfg->wwwroot = 'http://vleinternal.bromley.ac.uk/mahara/';
// dataroot - uploaded files are stored here
// This is a ABSOLUTE FILESYSTEM PATH. This is NOT a URL.
// For example, valid paths are:
// * /home/user/maharadata
// * /var/lib/mahara
// * c:\maharadata
// INVALID paths:
// * http://yoursite/files
// * ~/files
// * ../data
//
// 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 = '/home/mahara';

mkdir /home/mahara
chown apache:apache /home/mahara

[root@vleinternal mahara]# crontab -e
Append the last line to the root crontab:

* * * * * wget -q -O /dev/null http://127.0.0.1/mahara/lib/cron.php

It is necessary to now install the following php modules before Mahara's Web based installer will run:

yum install php-devel
yum install php-pear
pear install pecl/json
yum install php-pgsql
yum install php-gd

nano /etc/php.d/json.ini and add
extension=json.so

nano /etc/php.d/pgsql.so and add
extension=pgsql.so

nano /etc/php.d/gd.so
extension=gd.so

Edit httpd.conf and set AllowOverride = All
restart apache
visit http://vleinternal.bromley.ac.uk/mahara/ to complete install

Once Mahara is installed you can login as follows:

Username: admin
Password: mahara

You will be prompted to change the password on first login.

Moodle-Mahara integration is straightforward and I successfully followed the instructions contained in the file mahoodle.pdf available from eduforge.


Mahara Upgrade Process

Below is the process I followed to upgrade Mahara from version 1.1.2 to version 1.1.3

Please note that in some places these instructions are specific to our installation.

A very similar process worked successfully to upgrade Mahara to later versions. Please see below for information on any problems I encountered with specific version upgrades.

mv /var/www/html/mahara /root/mahara_old_1.1.2

Download mahara-1.1.3.tar.gz as root, extract the contents of the tar archive and install the new version.

lynx http://eduforge.org/frs/?group_id=176
tar -xzvf mahara-1.1.3.tar.gz
cd mahara-1.1.3
cp -pr htdocs /var/www/html
mv /var/www/html/htdocs /var/www/html/mahara
cp /root/mahara_old_1.1.2/config.php /var/www/html/mahara

Then visit the upgrade script in Mahara from the browser to complete the upgrade:

http://vleinternal.bromley.ac.uk/mahara/admin/upgrade.php

When I upgraded from 1.1.7 to 1.2.0 I had the following error message when I went to the admin page:

Mahara: Site unavailable
Your server configuration does not include the dom extension. Mahara requires this in order to parse XML data from a variety of sources.


This was solved by installing php-xml and restarting Apache as shown below:

yum install php-xml
service httpd stop
service httpd start

When I upgraded from 1.2.0 to 1.2.2 the above process worked fine, although the download site URL has changed:

lynx https://launchpad.net/mahara/+download

When I upgraded from 1.2.2 to 1.2.3 and from from 1.2.3 to 1.2.4 the above process worked fine.

When I upgraded from 1.2.4 to 1.3.3 I ran into a problem with the default version of PHP installed with CentOS 5. When I went to complete the upgrade I received the message:

Mahara will not run on PHP < 5.2.0. Please upgrade your PHP version,
or move Mahara to a different host.

On checking as shown below I found the installed version of PHP was 5.1.6

rpm -q php
php-5.1.6-27.el5

This meant that before the upgrade could be completed I was going to have to upgrade PHP. The process I followed is shown below.

Install yum priorities:

yum install yum-priorities

Then enable priorities in the appropriate configuration file:

nano /etc/yum/pluginconf.d/priorities.conf

[main]
enabled = 1

Install access to the additional repositories:

wget http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm

Now change the repository priorities. i.e.

cd /etc/yum.repos.d
cat remi.repo
[remi]
name=Les RPM de remi pour Enterprise Linux 5 - $basearch
baseurl=http://rpms.famillecollet.com/enterprise/5/remi/$basearch/
http://iut-info.univ-reims.fr/remirpms/enterprise/5/remi/$basearch/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-remi
failovermethod=priority
priority=1

cat epel.repo
[epel]
name=Extra Packages for Enterprise Linux 5 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/5/$basearch
mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?repo=epel-5&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
priority=1

Set the the priorities of everything in the CentOS-Base.repo to priority=2

Now update php and mysql:

service httpd stop
service mysqld stop
yum --enablerepo=remi update mysql
yum --enablerepo=remi update php
service mysqld start
service httpd start

This successfully updates PHP and MySQL to the latest versions.

Now change the priorites of everything in the CentOS-Base.repo back to priority=1. Also change the priorities of the remi and epel repos to priority=10.

It occurred to me that the above process was going to be a bit messy each time I needed to update MySQL and PHP. My solution was to create two separate copies of the /etc/yum.repos.d directories. One contained files with the default repository priorities (yum.repos.d.orig) and the other contained the files with the priorities required to update PHP and MySQL(yum.repos.d.remi). I created the script below in /root/bin to run whenever I need to upgrade PHP and MySQL:

cat update.mysql.php
cd /etc
rm -rf yum.repos.d
cp -pr yum.repos.d.remi yum.repos.d
service httpd stop
service mysqld stop
yum --enablerepo=remi update mysql
yum --enablerepo=remi update php
service mysqld start
service httpd start
rm -rf yum.repos.d
cp -pr yum.repos.d.orig yum.repos.d
yum update
cd /root/bin

The upgrade to Mahara 1.3.3 then went smoothly and for convenience the commands I used are provided below:

cd /root
lynx http://launchpad.net/mahara/1.3/1.3.3/+download/mahara-1.3.3.tar.gz
mv /var/www/html/mahara /root/mahara_old_1.2.4
tar -xzvf mahara-1.3.3.tar.gz
cd mahara-1.3.3
cp -pr htdocs /var/www/html
mv /var/www/html/htdocs /var/www/html/mahara
cp /root/mahara_old_1.2.4/config.php /var/www/html/mahara

Visit the upgrade script in Mahara from the browser to complete the upgrade e.g.:

http://standbyvle.bromley.ac.uk/mahara/admin/upgrade.php


Setting up Moodle and Mahara so that Mahara views can be submitted to Moodle for assessment.

This was tested with Moodle 1.9.10 and Mahara 1.3.3

Please note that in some places these instructions are specific to our installation and assume SSO between Moodle and Mahara is already working.

Log in as the root user and download the following files to the root users home directory:

lynx "http://gitorious.org/mahara-contrib/mdl19-mod-mahara/archive-tarball/master"

lynx "http://gitorious.org/mahara-contrib/mdl19-mod-assignment-type-mahara/archive-tarball/master"

lynx "http://gitorious.org/mahara-contrib/plugin-artefact-outcome/archive-tarball/master"

Untar the downloaded archives:

tar -xzvf mahara-contrib-mdl19-mod-mahara-master.tar.gz
tar -xzvf mahara-contrib-mdl19-mod-assignment-type-mahara-master.tar.gz
tar -xzvf mahara-contrib-plugin-artefact-outcome-master.tar.gz

Rename and copy the downloaded Moodle module folders:

cp -pr mahara-contrib-mdl19-mod-mahara /home/vle1011user/moodle/mod/mahara
cp -pr mahara-contrib-mdl19-mod-assignment-type-mahara /home/vle1011user/moodle/mod/assignment/type/mahara

Create an empty lib.php file so Moodle doesn't say the module isn't present on disc:

touch /home/vle1011user/moodle/mod/mahara/lib.php

Login to Moodle using the /admin URL and the new modules will be installed.

Go to the admin menu in Moodle.

Under Modules > Activities > Manage activities it is necessary to have the eye CLOSED on the Mahara assignment mnet module.

Under Networking > Peers select your Mahara host, and then select the Services tab. Under the Mahara new assignment mnet module section at the top of the page, check Subscribe, and save the change.

Now when you go to Add an activity to a course, under Assignments you should see Mahara Portfolio as the bottom option.

If you have enabled outcomes within Moodle assessment you can make the outcomes of a graded asessment available to a student from within Mahara. This is optional an involves installing the outcome module into Mahara. To install this module follow the steps below:

cp -pr mahara-contrib-plugin-artefact-outcome /var/www/html/mahara/artefact/outcome

To install the plugin into Mahara, log in as the Mahara administrator, go to Site Administration > Administer Extensions > Plugin Administration and click the Install link beside the outcome artefact plugin. I understand that this is supposed to add the My Outcomes tab under the My Portfolio menu when an outcome enabled assignment is graded in Moodle. However students can just as easily view their results directly in Moodle.

Once a Mahara view is submitted to a Moodle assignment for assessment it is locked within Mahara so a user cannot change it. By default the view is only unlocked when the assignment is graded using outcomes. This can prove a problem as if outcomes are not set, or the assignment is deleted, then the view in Mahara remains permanently locked :(

A work around this, which releases a view once an assignment has been graded (regardless of whether outcomes are set in Moodle) is to comment out one line in the following file:

nano /home/vle1011user/moodle/mod/assignment/type/mahara/assignment.class.php

The relevant excerpt from the file is shown below:

function process_outcomes($userid) {
global $CFG, $MNET, $USER;
parent::process_outcomes($userid);

// Export outcomes to the mahara site
$grading_info = grade_get_grades($this->course->id, 'mod', 'assignment', $this->assignment->id, $userid);

if (empty($grading_info->outcomes)) {
// return;
}

if (!$submission = $this->get_submission($userid)) {
return;
}

Commenting out the return statement above means that once an assignment is graded in Moodle (whether or not it has outcomes set) the view is released in Mahara.

Whether there are any unwanted side effects of the above code amendment remains to be seen ;)

With thanks to Dominique-Alain JAN and Richard Mansfield for advice, which helped me to sort out issues with the view submission installation process.


Upgrade from 1.3.3 to 1.3.5

I followed the standard upgrade process detailed above. For convenience the commands I used are provided below:

cd /root
lynx http://launchpad.net/mahara/1.3/1.3.5/+download/mahara-1.3.5.tar.gz
mv /var/www/html/mahara /root/mahara_old_1.3.3
tar -xzvf mahara-1.3.5.tar.gz
cd mahara-1.3.5
cp -pr htdocs /var/www/html
mv /var/www/html/htdocs /var/www/html/mahara
cp /root/mahara_old_1.3.3/config.php /var/www/html/mahara

Visit the upgrade script in Mahara from the browser to complete the upgrade e.g.:

http://standbyvle.bromley.ac.uk/mahara/admin/upgrade.php

This worked fine on the test server but failed on the production server with the message:

Mahara: Site unavailable
A nonrecoverable error occured. This probably means you have encountered a bug in the system


On checking the Apache error_log file I found the following message:

[WAR] 6a (lib/mahara.php:1086) File /var/www/html/mahara/artefact/outcome/lib.php did not exist, referer: http://vle.bromley.ac.uk/mahara/

This immediately alerted me to the fact that the outcome module was missing. I copied over the outcome folder from the 1.3.3 backup:

cp -pr /root/mahara_old_1.3.3/artefact/outcome /var/www/html/mahara/artefact

And low and behold Mahara 1.3.5 worked fine :)


Upgrade from 1.3.5 to 1.3.6

I followed the standard upgrade process detailed above. For convenience I created a shell script to make life easier. The content of the script is shown below:

[root@vle bin]# cat upgrademahara
cd /root
wget http://launchpad.net/mahara/1.3/1.3.6/+download/mahara-1.3.6.tar.gz
mv /var/www/html/mahara /root/mahara_old_1.3.5
tar -xzvf mahara-1.3.6.tar.gz
cd mahara-1.3.6
cp -pr htdocs /var/www/html
mv /var/www/html/htdocs /var/www/html/mahara
cp /root/mahara_old_1.3.5/config.php /var/www/html/mahara
cp -pr /root/mahara_old_1.3.5/artefact/outcome /var/www/html/mahara/artefact

This worked like lightning and the upgrade went like a dream :)


Upgrade from 1.3.6 to 1.4.0

I followed the standard upgrade process detailed above. The content of the modified script is shown below:

[root@standbyvle bin]# cat upgrademahara
cd /root
wget http://launchpad.net/mahara/1.4/1.4.0/+download/mahara-1.4.0.tar.gz
mv /var/www/html/mahara /root/mahara_old_1.3.6
tar -xzvf mahara-1.4.0.tar.gz
cd mahara-1.4.0
cp -pr htdocs /var/www/html
mv /var/www/html/htdocs /var/www/html/mahara
cp /root/mahara_old_1.3.6/config.php /var/www/html/mahara
cp -pr /root/mahara_old_1.3.6/artefact/outcome /var/www/html/mahara/artefact

Visit the upgrade script in Mahara from the browser to complete the upgrade e.g.:

http://standbyvle.bromley.ac.uk/mahara/admin/upgrade.php


Upgrade from 1.4.0 to 1.4.1

I used the following modified script for the upgrade:

[root@vle bin]# cat upgrademahara
cd /root
echo "Please put Mahara into maintenance mode before performing the upgrade"
echo "Press any key when ready"
read dummy
echo "Enter new version number of Mahara (must be 1.4 series) to upgrade to e.g. 1.4.1"
read newver
echo "Enter existing version number of Mahara to backup e.g. 1.4.0"
read oldver
wget http://launchpad.net/mahara/1.4/$newver/+download/mahara-$newver.tar.gz
mv /var/www/html/mahara /root/mahara_old_$oldver
tar -xzvf mahara-$newver.tar.gz
cd mahara-$newver
cp -pr htdocs /var/www/html
mv /var/www/html/htdocs /var/www/html/mahara
cp /root/mahara_old_$oldver/config.php /var/www/html/mahara
cp -pr /root/mahara_old_$oldver/artefact/outcome /var/www/html/mahara/artefact
echo "Please visit http://vle.bromley.ac.uk/mahara to complete the upgrade"