Giter Club home page Giter Club logo

puppet-lamp's Introduction

Introduction

This project allows CCLE developers to automatically create a virtual machine that is running the same LAMP stack that is being used for our Moodle 2 servers to help develop code in a production like environment.

Prerequisites

Download and setup VM

  1. Check out vagrant and puppet scripts that will create the Dev VM
    • mkdir ~/Projects && cd ~/Projects
    • git clone git://github.com/rlorenzo/puppet-lamp.git ccle
  2. Checkout CCLE the codebase from Github
    • cd ~/Projects/ccle
    • git clone [email protected]:ucla/moodle.git
    • cd moodle
    • git submodule init && git submodule update
  3. Start vagrant and run the puppet scripts
    • vagrant up
    • vagrant provision

Pre-moodle install

  1. First ssh into the Vagrant VM:
    • vagrant ssh
  2. Create moodle database
    • mysql --user=root --execute="CREATE DATABASE moodle DEFAULT CHARACTER SET UTF8 COLLATE utf8_unicode_ci;"
  3. Create moodle user and allow them to access moodle database
    • mysql --user=root --execute="GRANT ALL PRIVILEGES ON moodle.* TO 'moodle'@'localhost' IDENTIFIED BY 'test'; FLUSH PRIVILEGES;"
      • Can replace 'test' with any other password you want to use.

Setup CCLE version of Moodle

  1. On the host computer, create a link to the dev configuration file
    • cd ~/Projects/ccle/moodle
    • ln -s local/ucla/config/shared_dev_moodle-config.php config.php
  2. Then copy the file config_private-dist.php to config_private.php and change the dbuser/dbpass/wwroot/dataroot variables to the appropiate values if you are not using the default options.
  3. Import a sample database dump that includes prebuild courses, config settings, roles, and a set of test users.
    • Run the following commands to import the database dump:
    • This database dump includes the following user accounts (login/pass):
      • admin/test
      • instructor/test
      • student/test
    • The database dump includes the following items:
      • roles copied from our production server
      • turned off most of the password requirements so that simple passwords can be used for test accounts
      • pre-built courses
  4. Install dependancies via composer (run commands outside of VM):
  5. Behat
  6. On your host machine, go to http://localhost:8080/moodle and start using the CCLE Moodle codebase.
    • Make sure you upgraded the sample database to the newest version of the CCLE Moodle codebase. Login as admin/test and go to "Site administration >Notifications" and run through the upgrade process.

NOTES

  1. To shutdown the vagrant please run "vagrant suspend" (it is quicker than doing vagrant halt). To start up vagrant again run "vagrant up". To restart the VM, run "vagrant reload".
  2. phpMyAdmin is viewable at: http://localhost:8080/phpmyadmin
  3. Your code on the Vagrant VM is located at /vagrant/moodle
  4. You can gain root access by doing: sudo su -
  5. If you upgrade VirtualBox or your Vagrant VM might not be able to mount your directory, because you need to update your VirtualBox guest additions.
    • SSH into your Vagrant VM: vagrant ssh
    • Go to http://download.virtualbox.org/virtualbox/ and download the latest copy of VBoxGuestAdditions_X.iso for your version of VirtualBox onto /tmp
    • As root (sudo su -):
      • mount -o loop -t iso9660 /tmp/VBoxGuestAdditions_X.iso /mnt
      • sh /mnt/VBoxLinuxAdditions.run
  6. If you are having problems with not findng certain libraries or packages installed, be sure to run "vagrant provision" on your host computer.

Caveats for Windows users

  • Git Bash does not support symbolic links. After you do the step of “create a link to the dev configuration file” please realize that you are essentially copying the file. Any updates made to the development configuration file will need to be manually updated by you. Also, since the file is now a copy change the following line:

     $_dirroot_ = dirname(realpath(__FILE__)) . '/../../..'; into
     $_dirroot_ = dirname(realpath(__FILE__));
  • You will not be able to “vagrant ssh” into your Vagrant VM. You will need to use putty to ssh. But before you can do that you will need to convert the the vagrant ssh key into a putty ppk file. Please follow this link for more information:

puppet-lamp's People

Contributors

rlorenzo avatar jnewland avatar ipaulo avatar

Watchers

James Cloos avatar Eiz Eddin A. avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.