51
Presented by Diana Clarke and Brian Dichter Behind the Scenes– Serving Moodle

Serving Moodle Presentation

Embed Size (px)

Citation preview

Page 1: Serving Moodle Presentation

Presented byDiana Clarke and Brian Dichter

Behind the Scenes–Serving Moodle

Page 2: Serving Moodle Presentation

Introduction

- Moodle is Open Source and relies on several key Open Source applications to do its magic.

- MySQL database.- PHP is server-side scripting language that works especially well with MySQL.

- Apache is the webserver software on Mac OS X.

Page 3: Serving Moodle Presentation

Assumptions

- You know that Moodle is a “software package for producing internet-based courses and web sites, supporting a social constructionist framework of education”.

- Brand new “vanilla” Mac OS X Server- Or, server without PHP/MySQL configured- Administrator access to Mac OS X Server- Use both GUI and Terminal

Page 4: Serving Moodle Presentation

Downloads

- Moodle-latest build (1.5.3+)- http://download.moodle.org/

- PHP (4.3.11 for Apache 1.3)- http://www.entropy.ch/software/macosx/php/

- MySQL (Standard 4.0.26)- http://dev.mysql.com/downloads/mysql/4.0.html

- Apache (1.33)Already installed on Mac OS X Server

Page 5: Serving Moodle Presentation

Downloads–Optional

- phpMyAdmin- http://www.phpmyadmin.net/home_page/index.php

- MyS QL Administrator- http://www.mysql.com/products/tools/administrator/

- MySQL Query Browser- http://dev.mysql.com/downloads/query-browser/1.1.html

Page 6: Serving Moodle Presentation

Configure Webserver

- Use Server Admin- Select the “Web” service to configure Settings

- Double-click the default site- Edit the Domain Name (use FQDN if possible)- Take note of the Web folder location- Make sure to edit the Default index files- Edit the Administrator email address- Select Options and uncheck everything (unless you have other sites running that need any of these)

- Start the Web service!

Page 7: Serving Moodle Presentation
Page 8: Serving Moodle Presentation
Page 9: Serving Moodle Presentation
Page 10: Serving Moodle Presentation

Configure Webserver

- Visit your site in a browser to test that it’s working (you should see the Apache manual)

- Clean up your Web folder (I usually delete all of the Apache files…actually, I usually delete everything except the error page)

Page 11: Serving Moodle Presentation

Install and Test PHP

- Install the PHP package

- Create a text file in your Web folder named “info.php” containing the following code:<?php>phpinfo();?>- Open this page in your browser to test PHPhttp://yoursite.org/info.php

- After successfully testing, delete the “info.php” file.

Page 12: Serving Moodle Presentation
Page 13: Serving Moodle Presentation
Page 14: Serving Moodle Presentation

Install and Test MySQL

- Install the MySQL package and the startup item package.

- User Terminal to start the MySQL server.$ sudo /Library/StartupItems/MySQL/MySQL start

- Use Terminal and the MySQL Monitor program to check that it’s running (most common error is forgetting to start the server).$ mysql -u root

- Set and secure the root password.mysql> set password for > root@localhost=password(‘------’);

Page 15: Serving Moodle Presentation
Page 16: Serving Moodle Presentation

Install and Test MySQL

- Delete anonymous accounts.

mysql> use mysql;

mysql> delete from user where User=‘’;

mysql> delete from db where User=‘’;

mysql> flush privileges;

Page 17: Serving Moodle Presentation
Page 18: Serving Moodle Presentation

Install and Test MySQL- Create Moodle database and account.

mysql> CREATE DATABASE moodle;mysql> GRANT SELECT,INSERT,DELETE,CREATE,DROP,INDEX,> ALTER ON moodle.* TO moodleuser@localhost > IDENTIFIED BY ‘somesecretpassword’;> quit

$ mysqladmin -u root -p reload

Page 19: Serving Moodle Presentation

Install and Test MySQL- Test your new account.

$ mysql -u moodleuser -p

Page 20: Serving Moodle Presentation

Prepare to Install Moodle

- Create a data directory.

$ sudo mkdir /Library/WebServer/moodle-data

- Change the owner and permissions on the data directory.

$ sudo chown www:www /Library/WebServer/moodle-data$ sudo chmod 700 /Library/WebServer/moodle-data

Page 21: Serving Moodle Presentation

Prepare to Install Moodle

- Move your Moodle download into your Web folder.- Use the Terminal to extract the files (there are

a lot of files!).

$ tar xvf moodle-latest-15.tar

- Change the owner of the Moodle directory (or you may get an error).

$ sudo chown www:www /Library/WebServer/Documents/moodle

Page 22: Serving Moodle Presentation

Install Moodle- Open the install.php file in your web browser.

- Follow the instructions on each page until you’re done!

Page 23: Serving Moodle Presentation
Page 24: Serving Moodle Presentation
Page 25: Serving Moodle Presentation
Page 26: Serving Moodle Presentation
Page 27: Serving Moodle Presentation
Page 28: Serving Moodle Presentation
Page 29: Serving Moodle Presentation
Page 30: Serving Moodle Presentation
Page 31: Serving Moodle Presentation
Page 32: Serving Moodle Presentation
Page 33: Serving Moodle Presentation
Page 34: Serving Moodle Presentation
Page 35: Serving Moodle Presentation
Page 36: Serving Moodle Presentation
Page 37: Serving Moodle Presentation
Page 38: Serving Moodle Presentation
Page 39: Serving Moodle Presentation
Page 40: Serving Moodle Presentation
Page 41: Serving Moodle Presentation
Page 42: Serving Moodle Presentation
Page 43: Serving Moodle Presentation

Moodle Database Backup- Create a simple backup script to backup your database.

- Create a folder where you will store your database backups (for example: /Library/WebServer/db)

- Create a text file (plain text, not rtf!) named “dbBot” containing the following code:

#!/bin/bashcd /Library/WebServer/dbmysqldump -u root -psecretpassword

moodle > moodle-backup.sql.`date +%m%d%Y`

Page 44: Serving Moodle Presentation

Moodle Database Backup

- Change the permissions of this file so root owns, noone can read.

$ sudo chown root dbBot$ sudo chmod 700 dbBot

- Test the script.$ sudo sh dbBot

- A test should produce something like this in /Library/WebServer/db:

moodle-backup.sql.02282006

moodle-backup.sql.03012006

Page 45: Serving Moodle Presentation

Moodle Database Backup

- Restoring a database is fairly easy.

mysqldump -u root -psecretpassword moodle < moodle-backup.sql.03012006

Page 46: Serving Moodle Presentation

Automate Backup and Tasks

- We use Cron to automate backups and Moodle tasks. Use Terminal!$ sudo pico /etc/crontab

- You will see this:# /etc/crontabSHELL=/bin/shPATH=/etc:/bin:/sbin:/usr/bin:/usr/sbinHOME=/var/log##minute hour mday month wday who command##*/5 * * * * root /usr/libexec/atrun## Run daily/weekly/monthly jobs.15 3 * * * root periodic daily30 4 * * 6 root periodic weekly30 5 1 * * root periodic monthly

Page 47: Serving Moodle Presentation

Automate Backup and Tasks

- Add the following sections with comments at the end and exit pico (control-x) and save the file (y to save, hit enter):# run Moodle cron script*/5 * * * * wget -q -O /dev/null http://yoursite.org/moodle/admin/cron.php

# run dbBot to backup Moodle database in MySQL every day at 6:15am15 6 * * * root /System/bin/dbBot

Page 48: Serving Moodle Presentation

Summary

- Download the Open Source applications.- Configure the webserver.- Install and test PHP.- Install and test MySQL.- Create a Moodle database and user.- Create a data folder.- Install and test Moodle.- Create a custom MySQL database backup script.- Automate backup and Moodle tasks with Cron.

Page 49: Serving Moodle Presentation

Configure Themes/Courses

- Configure Themes

- Add Courses

Page 50: Serving Moodle Presentation

Resources- Moodle Documentation

http://docs.moodle.org/

- Moodle Support (Free Community Support)http://moodle.org/course/view.php?id=5

- Moodle Philosophyhttp://docs.moodle.org/en/Philosophy

- Presentation files and other docshttp://helpdesk.d214.org/projects/ice06/

Diana Clarke [email protected] Dichter [email protected]

Page 51: Serving Moodle Presentation

Q & A