How to install Moodle on FreeBSD

This article was written for Moodle 2.1.2+ (aka MOODLE_21_STABLE) and FreeBSD 8.2

Pre-Requisites

 * Basic FreeBSD server with configured PHP web application stack. See How to build a FreeBSD server, the following references may also be useful:
 * The FreeBSD Handbook by the FreeBSD Project ("The Handbook"),
 * Bulding a Server with FreeBSD 7 by Bryan Hong ("Hong"),
 * Absolute FreeBSD by Michael Lucas ("Lucas"),

Install Procedure

 * Login to the Maestro Server as user maestro
 * Download Moodle 2.1.2+ from http://downloads.moodle.org/ and extract to /usr/home/maestro/www/moodle-2.1.2/
 * Review /usr/home/maestro/www/moodle-2.1/README
 * Set permissions


 * Create /usr/local/etc/apache22/Includes/moodle.conf

Alias /moodle /usr/local/www/moodle/ AcceptPathInfo On  AllowOverride None Order Allow,Deny Allow from all 


 * Restart Apache


 * 1) /usr/local/etc/rc.d/apache22 restart


 * Edit /usr/local/www/moodle/config.inc.php and edit configuration parameters

$CFG->dbname   = 'moodle'; $CFG->dbuser   = 'moodle'; $CFG->dbpass   = 'MoodlePassword'; $CFG->wwwroot  = 'http://www.scc.com/moodle'; $CFG->dirroot  = '/usr/local/www/moodle'; $CFG->dataroot = '/usr/local/www/moodledata'; $CFG->admin    = 'admin';


 * Create SCC Moodle Database

Updating
Backup previous version of Moodle Edit Moodle Apache config file so Apache serves new version (e.g. # vi /usr/local/etc/apache22/Includes/moodle.conf) Re-start Apache (e.g., # /usr/local/etc/rc.d/apache22 restart) May need to change user's password after login.
 * 1) cd /usr/ports
 * 2) portmaster www/moodle