Hosting several Moodle branches in one Ubuntu machine

Hosting several Moodle branches in one Ubuntu machine

by Germán Valero -
Number of replies: 5
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

I am a language pack maintainer for the Mexican Spanish language.

In order to test/try/debug the translations of Moodle plugins, I need to use several local Moddle servers with many branches from 2.0 to 3.1 (and DEV). Previously, this was very easy using different folders and the Moodle installer packages for windows. But after experiencing an unwelcomed  forzed upgrade to Windows 10, all my local Moodle servers in different folders stopped working.

I, of course, rolled back into Windows 7, but I seriously think that Linux might be a better environment for using local Moodle servers, but I have not been able to find a how-to guide for hosting several different branches of Moodle in one machine (besides using virtualization) and quickly changing from one branch into another. I am a less-than-average Ubuntu user who tries to avoid the command line as much as possible. I have an 8 core AMD PC with 16 GB RAM and a 2TB hdd.

Can anybody tell me if this is possible/recommended/easy/difficult, or if using virtual machines (eg, Virtualbox, Bitnami) would be a better approach ?

Or if this might be easier to do in a 6 years old Macbook ?

Thanks in advance for your help.

Average of ratings: -
In reply to Germán Valero

Re: Hosting several Moodle branches in one Ubuntu machine

by Fernando Acedo -
Picture of Plugin developers Picture of Testers

Hola Germán,

just create a folder for each instance inside the web folder and that would be enough. Do not need to create virtual hosts in Apache or virtual machines.

To access the sites you only need to add the folder to localhost URL: http://localhost/moodle31

I have an instance for each version from 1.9 to 3.1 and some more for theme development and testing among other for Joomla, Wordpress, etc

Average of ratings: Useful (3)
In reply to Fernando Acedo

Re: Hosting several Moodle branches in one Ubuntu machine

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Just to add to what Fernando said, it is very easy and you certainly dont need separate VMs for it smile

You do need a separate data folder for each instance and a separate database (I use phpmyadmin to set mine up, but thats not necessary), add each instance in its own folder, and carry on as Fernando said.

So my folder tree on my Linux (Mint - which is an Ubuntu derivative) laptop (my actual server at home would be more) looks something like:

var
--www
    ----maharadata
    ----moodlecleandata
    ----moodlestabledata
    ----moodlemasterdata
    ----moodletestingdata
    ----uswmoodledata
    ----html
        ------mahara
        ------moodleclean
        ------moodlestable
        ------moodlemaster
        ------moodletesting
        ------uswmoodle


Average of ratings: Useful (2)
In reply to Germán Valero

Re: Hosting several Moodle branches in one Ubuntu machine

by Ken Task -
Picture of Particularly helpful Moodlers

Just to add 2 cents on what others have already shared ...

Have several sandboxed Moodles on a single CentOS X server all of different versions .. only the ones that are supported for security fixes and above - 2.7,2.8,2.9,3.0, and now a 3.1.  Pretty much 'stock' Moodles with only occasional addons, etc. for testing.

All have their separate code and data directories as well as their separate DB's.

My 2 cents: install and maintain them all with git ... even if you don't prefer/like command line, that is by far the most efficient way to update and/or upgrade a site.

/var/www/html/moodle27/version.php:$release  = '2.7.14 (Build: 20160509)'
/var/www/html/moodle28/version.php:$release  = '2.8.12 (Build: 20160509)'
/var/www/html/moodle29/version.php:$release  = '2.9.6+ (Build: 20160520)'
/var/www/html/moodle30/version.php:$release  = '3.0.4+ (Build: 20160603)'
/var/www/html/moodle31/version.php:$release  = '3.1+ (Build: 20160603)'

The git -b command locks a site into the version provided with the rest of the git command ... for example, installing the 3.1, which is a long term support version, installed with git -b option.   Don't plan on upgrading nor testing upgrades with that one.

git clone -b MOODLE_31_STABLE git://git.moodle.org/moodle.git moodle31

All the other moodles I have on that server have been installed via git 

git clone git://git.moodle.org/moodle.git [nameofdir]

then from nameofdir

git branch --track MOODLE_2#_STABLE origin/MOODLE_2#_STABLE
git checkout MOODLE_2#_STABLE

2# is the version number.

That allows one to march that moodle upwards ... higher branch(es).   So one can test an upgrade (as opposed to an 'update').

This second method 'gits' more code and backups will range in the 5+ Meg range due to all the older version git stuff    The 3.1 much less (restricted to 3.1 branch):

545M    ./moodle296-code-20160604145012.tar

193M    ./moodle31+-code-2016060883737.tar

Like I said ... 'contributed'? 2 cents.

'spirit of sharing', Ken

Average of ratings: Useful (4)
In reply to Ken Task

Re: Hosting several Moodle branches in one Ubuntu machine

by Germán Valero -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Thanks to Fernando, Richard and Ken for their kind and quick suggestions.

It seems pretty easy to do smile

I will try it in the weekend and hopefully write about it on Moodle Docs.

In reply to Germán Valero

Re: Hosting several Moodle branches in one Ubuntu machine

by Germán Valero -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Hi,

I added some Moodle Documentation at https://docs.moodle.org/31/en/Step-by-step_Installation_Guide_for_Ubuntu#Hosting_several_Moodle_branches_in_one_Ubuntu_server .

Please feel free to add, remove or change as needed smile

I also added some Moodle Documentation at https://docs.moodle.org/dev/Translation_FAQ#How_can_I_test_my_plugins_translations_of_several_.28different.29_Moodle_branches.3F but it lacks info about hosting several Moodle branches in one Mac  sad

Average of ratings: Useful (2)