Thursday, April 30, 2009

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

Thursday, April 23, 2009

Mahara install on Centos 5.x

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

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
Add last line to root crontab:

*/5 * * * * wget -q -O /dev/null http://127.0.0.1/ict/admin/cron.php
* * * * * 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

A very similar process worked successfully to upgrade mahara to later versions.

Login as root and move the existing mahara folder somewhere safe.

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 the above process worked fine.

This page is powered by Blogger. Isn't yours?