MoodleBox - A Vagrant local development environment

MoodleBox - A Vagrant local development environment

by Heitor Silva -
Number of replies: 12

Hello guys! How are you?

I've made a simple Vagrant box, to run Moodle 3, and to be a development machine ready for other PHP developers...

You can check the code here: https://github.com/olivatecnologia/vagrant-moodlebox

It's a simpler version, compared to Moodle Hat and PuppetLamp.

You can check these other two projects on the links below:

https://github.com/mackensen/moodle-hat

https://github.com/rlorenzo/puppet-lamp

Happy coding, and best regards!

Average of ratings: Useful (2)
In reply to Heitor Silva

Re: MoodleBox - A Vagrant local development environment

by Eric Merrill -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Very nice.

You may want to look at adding Solr, so people can test against Global Search.

In reply to Eric Merrill

Re: MoodleBox - A Vagrant local development environment

by Heitor Silva -

Eric,

why don't you open an Issue on github, and I'll be glad to make that when I have the time!

;)

thx for the suggestion!!!

Average of ratings: Useful (1)
In reply to Heitor Silva

Re: MoodleBox - A Vagrant local development environment

by Eric Merrill -
Picture of Core developers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers

pssshhhh - wanting it done the right way. What is wrong with you wink

In reply to Eric Merrill

Re: MoodleBox - A Vagrant local development environment

by john attwood -

How can I move that image up to my Google GCE account.  I guess I will have to do it myself and write up the instructions.


 I want to get this going for setup to run one Moodle locally with intermittent power and internet and have one on my Google Cloud Compute. Once I get both up I will use Virtsync to keep them updated. 



Well... I cannot connect to the vagrant VM  on my Centos7 host...it list vboxnet0 as 192.168.1.1 I tried both 1 and 2 neither work. 

I can ssh... maybe nginx server not up ... but it should be up right ?  Wait I read documentation and it say nginx usually not start by itself ?

sudo service nginx start doesn't work but I don't know where it is. 


Ok i confirmed nginx is up but ?????? mysql is also up ??? what's left ................. why cant i connect....


No firewall

No Selinux .............still no moodle. 

In reply to john attwood

errors

by john attwood -
 default: fatal: destination path '/home/vagrant/.nodenv' already exists and is not an empty directory

I

fatal: destination path '/home/vagrant/.nodenv/plugins/node-build' already exists and is not an empty directory.


cannot find this directory.

Job for mysql.service failed. See 'systemctl status mysql.service' and 'journalctl -xn' for details.


I checked an mysql was up

maybe i just go home for the day.

In reply to Heitor Silva

Re: MoodleBox - A Vagrant local development environment

by Tomasz Muras -
Picture of Core developers Picture of Plugin developers Picture of Plugins guardians Picture of Translators

I have created yet another vagrant box for moodle + moosh development: http://moosh-online.com/dev/.

It seems to me that we should join the forces and create The Ultimate Moodle Vagrant Dev Box. Or at least share the scripts for installing various bits (like Moodle, moosh, phpmyadmin).

In reply to Tomasz Muras

Re: MoodleBox - A Vagrant local development environment

by Daniel Neis Araujo -
Picture of Core developers Picture of Plugin developers Picture of Translators

Very nice vagrant box with moosh!

I was just wondering why use "bento/ubuntu-16.06" instead of "ubuntu/xenial64" ...


Moodle Hat seems to be nice as it have Selenium + Behat + PHPUnit installed as well, but it uses Puppet to install things and altough it may be nice to have it in your environment, most people are not used to it and it insert some "indirections" when you are already using a vagrantfile to define what will be available, even when it is one more provision to setup instead of plain bash scripts. This project also "customizes" the virtual machine to use 4096MB of RAM that may be too much for some developers


The one by Heitor Silva, that started the thread, installs nodejs and some of its modules and also make some configuration for the vim editor and other things that makes that box looks a little personal. It also uses nginx with php-fpm instead of the more traditional apache server. With it, you also have to access the the url /moodle of your virtual machine instead of having it in the document root, that for me is a downside.


The puppet-lamp projects uses a CentOS image, and requires the user to create the database and a user for it after the setup, that seems to be not needed as the other solutions provide it. They do not support composer and states that they will need to create another vagrantbox for that. But they use composer to download and install some dependencies for their own version of Moodle. They are more modest setting the memory to 1024MB only and also use puppet to setup things. It seems they install clamav, shifter, tex and something related to mediawiki.


It would be even better if we have a Moodle official Vagrantfile ... are there a tracker issue for that already?



In reply to Daniel Neis Araujo

Re: MoodleBox - A Vagrant local development environment

by Daniel Neis Araujo -
Picture of Core developers Picture of Plugin developers Picture of Translators

A fix:

"The puppet-lamp project ... do not support behat " (not composer, as said).

In reply to Daniel Neis Araujo

Re: MoodleBox - A Vagrant local development environment

by Tomasz Muras -
Picture of Core developers Picture of Plugin developers Picture of Plugins guardians Picture of Translators

I have had problems setting up my box with Vagrant + ubuntu/xenial64, so I went with bento after the recommendation here.

I didn't want to use puppet, to keep it simple - the installation is so simple that it seems to me like puppet would be unnecessary extra layer. The same with php-fpm - standard apache with mod_php should be good for dev environment. I also prefer mod_php because it will support $CFG->apacheloguser setting.

Why i susing  /moodle directory to access Moodle installation inside your VM a problem for you?

In reply to Tomasz Muras

Re: MoodleBox - A Vagrant local development environment

by Daniel Neis Araujo -
Picture of Core developers Picture of Plugin developers Picture of Translators

Oh, it is not a problem, at all, it is just a "downside" because i think its quicker to only type localhost:8080 than localhost:8080/moodle on the address bar, even if it gets "memorized" by the browser, its simpler, because you don't expect to have another app running on the same box.

=)

In reply to Heitor Silva

Re: MoodleBox - A Vagrant local development environment

by Johannes Burk -
Picture of Core developers Picture of Plugin developers

I'm currently learning about vagrant (and docker) and try to find a way that best fits my needs for moodle plugin development. This way I've found your thread. Thank you for sharing your work with the community!

I wanted to comment/suggest just a few things. As I understand it what you have build is a Vagrant Project and not a Vagrant Box, isn't it? (see https://www.vagrantup.com/docs/boxes.html). I thinking about creating a Moodle Vagrant Box. This would bring the advantage of easily setting up additional instances when needed for different projects.

It may be more comfortable to not have the Moodle code included in the repository as a zip file but clone the Moodle repository on provisioning. And when the moodle directory would be a vagrant synced folder it would be easy to use an IDE or editor on the host machine for development.