Moodle tips

来自Ubuntu中文
Oneleaf留言 | 贡献2010年6月25日 (五) 10:11的版本 (以内容'== Prepare your server == *Moodle is meant to be run on a server. It requires Apache2, the PHP scripting language, and a database (either MySQL or po…'创建新页面)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航跳到搜索

Prepare your server

  • Moodle is meant to be run on a server. It requires Apache2, the PHP scripting language, and a database (either MySQL or postgreSQL). While many users feel postgreSQL is a better database, MySQL is more widely used and is easier for first time users (since there are many integrated packages that use it). A LAMP server (Linux, Apache2, MySQL, PHP) can easily be installed:
sudo tasksel install lamp-server

When installing the LAMP server, note the MySQL root password carefully. This will be required during Moodle installation.

  • Moodle must know where the server is located. (You must also have a way for other users to reach it.) The FQDN (Fully Qualified Domain Name) refers to the location of the server on which the Moodle database is located. In general, there are two options: localhost (meaning the database will be located on the same computer on which Moodle will be installed) or a URL. (Of course, the URL could still refer to the same computer).

Don't worry, whichever option you choose can be changed later. For initial installation, it is easiest to use localhost as the FQDN (and also wherever it is available as an installation option).

Installation

Moodle is a free open source platform for hosting online learning courses. It can be integrated with webinar software. A LAMP server installation is required (sudo tasksel install lamp-server). Also find free Moodle themes here. Install:

sudo apt-get moodle
  • Database server software for Moodle: mysql-server -> follow remainder of instructions. Assuming the database is hosted on the same computer as the one Moodle is being installed upon, accept localhost for the options when prompted.
  • Edit Moodle configuration options (if needed):
sudo gedit /etc/moodle/config.php
  • Edit Moodle apache2 configuration file (if needed):
sudo gedit /etc/moodle/apache.conf
  • Finish installation through the browser. (I recommend the "unattended" installation.)
http://localhost/moodle/admin

Set up a virtual server

The whole point of Moodle is that users can access it over a network. The easiest way is to set up a URL for your server so that users can reach Moodle using the URL. Several steps are necessary.

  • If you have a router on your network, forward incoming traffic on ports 80 and 443 (http and https) from the router to the (static) LAN IP address of the server hosting Moodle.
  • The firewall on the Moodle server should allow all incoming traffic on ports 80 and 443.
  • A URL for your Moodle site should have been established with a DNS name server on the Internet. It is possible to use a Dynamic DNS server, as well. An example URL is mymoodleserver.dyndns.org.
  • A virtual host file in /etc/apache2/sites-available must be created for Moodle.
cd /etc/apache2/sites-available
sudo cp default moodlevirtualhost
It should be edited (sudo gedit /etc/apache2/sites-available/moodlevirtualhost) to look like
<VirtualHost *:80>
ServerAdmin webmaster@mymoodleserver.dyndns.org
#
DocumentRoot /usr/share/moodle/
ServerName mymoodleserver.dyndns.org
ServerAlias www.mymoodleserver.dyndns.org mymoodleserver.dyndns.org
#RewriteEngine On
#RewriteOptions inherit
</VirtualHost>

Notes: The Rewrite options are listed here only for forward compatibility with Apache rewrite rules. They are only used for multi-site installations and can, in general, remain commented out (with the #).

  • The virtual host file should be linked to /etc/apache2/sites-enabled and apache2 restarted (sudo etc/init.d/apache2 restart).
sudo ln -s /etc/apache2/sites-available/moodlevirtualhost /etc/apache2/sites-enabled
  • Edit the /etc/moodle/config.php file (sudo gedit /etc/moodle/config.php) so that the FQDN (in this case the URL) is correctly noted.
$CFG->wwwroot = 'http://mymoodleserver.dyndns.org/moodle';
  • Login to the Moodle server:
http://mymoodleserver.dyndns.org

Add a custom theme to Moodle

  • Download one. Extract the zip file (by clicking on the filename in Nautilus, for example).
  • Copy the extracted folder to /usr/share/moodle/theme
  • From Moodle, install the new theme:
Moodle -> Appearance -> Themes -> Theme Selector
  • Copy a custom footer logo (ideal size 55px x 55px) to /etc/moodle and name it moodlelogo55.png. Link this file to the Moodle pix folder:
sudo ln -s /etc/moodle/moodlelogo55.png /usr/share/moodle/pix
  • The front page footer logo can then be changed by editing:
sudo nano /usr/share/moodle/lib/weblib.php

and editing the $homelink values from

$homelink  = '<div class="sitelink">'.
               '<a title="Moodle '. $CFG->release .'" href="http://moodle.org/">'.
               '<img style="width:100px;height:30px" src="pix/moodlelogo.gif" alt="moodlelogo" /></a></div>';
to
 $homelink  = '<div class="sitelink">'.
               '<a title="My Home Page" href="http://myhomepage.org/">'.
               '<img style="width:55px;height:55px" src="pix/moodlelogo55.png" alt="mylogoname" /></a></div>';

where My Home Page, http://myhomepage.org, moodlelogo55.png, and mylogoname are examples, of course.

Upgrading Moodle

  • Copy the Moodle software directory as a backup:
sudo cp -r /usr/share/moodle /usr/share/moodle_bak
  • Copy the Moodle data directory as a backup:
sudo cp -r /var/lib/moodle /var/lib/moodle_bak
  • Copy the local Moodle configuration directory as a backup:
sudo cp -r /etc/moodle /etc/moodle_bak
  • Dump your MySQL database content:
mysqldump -u username -p -C -Q -e --create-options moodle > moodle-backup-2010-04-01.sql

where username is the database MySQL user account name used to create the Moodle database during Moodle installation. The corresponding Moodle database password will be requested. (If you have forgotten these, they are recorded in the /etc/moodle/config.php file as $CFG->$dbuser and $CFG->$dbpass).

  • Download and unzip the current Moodle package:
sudo wget http://download.moodle.org/download.php/direct/stable19/moodle-weekly-19.zip
sudo unzip moodle-weekly-19.zip
sudo rm moodle-weekly-19.zip
  • Copy the new, extracted /moodle folder contents into the original /usr/share/moodle folder, overwriting the files there.
yes | sudo cp -r moodle/* /usr/share/moodle

Note: This method ensures that any files you have previously added, but for which no updates are available, remain in the /usr/share/moodle folder.

  • Make sure there is a symbolic link from your original config.php file in /etc/moodle to /usr/share/moodle. If not, create one:
sudo ln -s /etc/moodle/config.php /usr/share/moodle
  • There is a minor error in the version.php module numbering scheme from one version to the next. Edit the version.php file:
sudo nano /etc/moodle/version.php 
Change the line
$version = 2007101571.04;
to
$version = 2007101597.04;

Note: The new version number specified in $version must at least be greater than the $version number found in the version.php file located in the backup folder for the previous moodle installation (now presumably at /user/share/moodle_bak/version.php).

  • Login to your Moodle site (as an administrator) and load the new system:
Moodle -> Site Administration -> Notifications (Make sure to click on Notifications)

Site Building

Using BigBlueButton with Moodle

Using Skype with Moodle

Add Skype Block

Adding quotations to a block

Add a Quotation of the Day block