Für die Installation wurde die Postgres-Datenbank und folgende Dateistruktur verwendet:
/etc/moodle//usr/share/moodle//var/lib/moodledata/Download von moodle.org oder als root direkt an der Konsole:
# wget http://..../moodle-2.4.1.tgz # cd /usr/share # tar -xf /root/moodle-2.4.1.tgz
Datenbankverwaltung starten (da wir root sind erfolgt keine Passwortabfrage):
# psql -U postgres
In der Datenbankverwaltung die Tabellen für Moodle anlegen (Passwort ersetzen):
postgres=# CREATE USER moodleuser WITH PASSWORD '12345678'; postgres=# CREATE DATABASE moodle WITH OWNER moodleuser; postgres=# \l postgres=# \q
# mkdir /var/lib/moodledata # chown www-data:www-data /var/lib/moodledata # chmod 0755 /var/lib/moodledata
# mkdir /etc/moodle # touch /etc/moodle/apache.conf /etc/moodle/config.php
Konfigurationsdatei apache.conf:
Alias /moodle /usr/share/moodle/
<DirectoryMatch /usr/share/moodle/>
Options +FollowSymLinks
AllowOverride None
order deny,allow
deny from all
allow from 127.0.0.0/255.0.0.0
allow from localhost
allow from all
<IfModule mod_php5.c>
php_flag magic_quotes_gpc Off
php_flag magic_quotes_runtime Off
php_flag file_uploads On
php_flag short_open_tag On
php_flag session.auto_start Off
php_flag session.bug_compat_warn Off
php_value upload_max_filesize 2M
php_value post_max_size 2M
</IfModule>
<IfModule mod_dir.c>
DirectoryIndex index.php
</IfModule>
</DirectoryMatch>
Konfigurationsdatei config.php (bei dbpass das Passwort setzen und bei wwwroot die URL des Servers anpassen):
<?php
unset($CFG);
$CFG = new stdClass();
$CFG->dbtype = 'postgres7';
$CFG->dbhost = 'localhost';
$CFG->dbname = 'moodle';
$CFG->dbuser = 'moodleuser';
$CFG->dbpass = '12345678';
$CFG->prefix = 'mdl_';
$CFG->wwwroot = 'http://linuxmuster-net.lokal/moodle';
$CFG->dirroot = '/usr/share/moodle';
$CFG->dataroot = '/var/lib/moodledata';
$CFG->directorypermissions = 0750;
$CFG->admin = 'admin';
$CFG->pathtodu = '/usr/bin/du';
$CFG->unzip = '/usr/bin/unzip';
$CFG->zip = '/usr/bin/zip';
$CFG->respectsessionsettings = true;
# For improved security, make sure html purifier is used.
$CFG->enablehtmlpurifier = true;
if (file_exists("$CFG->dirroot/lib/setup.php")) { // Do not edit
include_once("$CFG->dirroot/lib/setup.php");
} else {
if ($CFG->dirroot == dirname(__FILE__)) {
echo "<p>Could not find this file: $CFG->dirroot/lib/setup.php</p>";
echo "<p>Are you sure all your files have been uploaded?</p>";
} else {
echo "<p>Error detected in config.php</p>";
echo "<p>Error in: \$CFG->dirroot = '$CFG->dirroot';</p>";
echo "<p>Try this: \$CFG->dirroot = '".dirname(__FILE__)."';</p>";
}
die;
}
// MAKE SURE WHEN YOU EDIT THIS FILE THAT THERE ARE NO SPACES, BLANK LINES,
// RETURNS, OR ANYTHING ELSE AFTER THE TWO CHARACTERS ON THE NEXT LINE.
?>
Dateien verlinken, php-extensions installieren und Apache neustarten:
# ln -s /etc/moodle/apache.conf /etc/apache2/sites-enabled/moodle.conf # ln -s /etc/moodle/config.php /usr/share/moodle/config.php # aptitude install php5-curl php5-intl php5-xmlrpc # /etc/init.d/apache2 restart
Nun im Browser Moodle aufrufen „http://linuxmuster-net.lokal/moodle„, die Datenbank-Einrichtung durchlaufen lassen und einen Namen für das Moodle vergeben.
Dabei das Profil des Admin-User ergänzen und ggf. dem Moodle-Admin einen neuen Namen geben.
Dann bei Moodle als Admin-User anmelden und es konfigurieren: