[Server-devel] Server-devel Digest, Vol 75, Issue 25

Tony Anderson tony at olenepal.org
Tue Aug 6 02:23:54 EDT 2013


On 08/06/2013 05:40 AM, Jerry Vonau wrote:
> I'd be interested in the contents of the xs-moodle files or is that an
> example? Sounds like 20-xc-generic looks for xc-* directories and files
> in those directories to execute, need to see the code to be sure on what
> you require.
The install file for Moodle is

  cd "$UM_MOUNTPOINT"/XC
if [ -f xc-moodle/xc-moodle-install ]; then
         log notice "Installing moodle"
         cd xc-moodle
         if bash xc-moodle-install; then
             log notice "moodle installed successfully"
         else
             log notice "moodle install failed with code $?"
             error_beep
         fi
else
         log notice 'moodle not found'
         error_beep

fi

The xc-moodle-install file is:

#!/bin/bash

#take backup from existing moodle
#su - postgres
#pg_dump moodle-xs > moodle-xs.sql

#stop httpd
/etc/init.d/httpd stop

#copy the moodle folder to /library
rm -rf /library/moodle
cp -r moodle /library/moodle
chown -R apache:apache /library/moodle

#restore the moodle-xs.sql backup of the database
psql -d moodle-xs -f moodle-xs.sql
#replace config.php file in /var/www/moodle/web and update 
/etc/httpd/conf.d/moodle.conf (if necessary)
cp config.php /var/www/moodle/web
cp moodle.conf /etc/httpd/conf.d

#start httpd
/etc/init.d/httpd start

Naturally, Moodle itself is installed as part of XS-0.7. This installs a 
PostgreSQL backup of Moodle content (courses). It also moved the Moodle 
data to /library.
This was a mistake in the XS implementation. Data directories which can 
grow
with use should be in /library not in the root partition. This is the 
change in
config.php.

The essence of this technique is that 20-xc-generic needs to be 
installed by xo-custom, xs-setup, or in the build. Once that is 
installed, a deployment can
perform any additional installations of content or packages via xc-install.

It would probably be useful to have a library of these optional 
installations.

Currently, I am using this technique to install the courseware for the 
Learn
activity, Django, the library, wiki4schools, mediawiki, wiktionary, the 
beginnings of a learning management system, and the beginnings of an 
itembank of questions. I hope to have an install script for IIAB 
(probably one for the front end and one or more for the content).

Tony




More information about the Server-devel mailing list