[Server-devel] PostgreSQL + Moodle

Tim Moody timmoody at sympatico.ca
Sun Jun 29 13:32:01 EDT 2008


Hi Myles,

There have been a number of misconceptions about the configuration of moodle 
created by yum install on XS.  Here's what I found.  If the concensus is 
that this is not how things should work, then perhaps whoever creates the 
moodle package for XS should modify this, though as yet I don't see a reason 
to.

Directories:

In the XS apache install theDocumentRoot is /var/www/html, so for another 
directory under /var/www to be public it must be explicitly made so.

The install creates /var/www/moodle/data owned by apache (for cache, 
session, temp, upgradelogs, users)
and /var/www/moodle/web owned by root, which has the moodle php scripts.
It creates /var/www/moodle/web/config.php which already points to this 
environment:

$CFG->dirroot   = '/var/www/moodle/web';
$CFG->dataroot  = '/var/www/moodle/data';

It also creates /etc/httpd/conf.d/moodle.conf which handles permissions with 
the following:

# Moodle public web pages - must be publically accessible
<Directory /var/www/moodle/web>
  Order allow,deny
  Allow from all
</Directory>

# Moodle private data - must NOT be publically accessible
<Directory /var/www/moodle/data>
  Order deny,allow
  Deny from all
</Directory>

Cron:

The install creates  /etc/cron.d/moodle which contains: */5 * * * * apache 
/usr/sbin/moodle-cron,
which runs [ -f /var/lock/subsys/httpd ] && /usr/bin/php 
/var/www/moodle/web/admin/cron.php

So the cron job works out of the box, but I can't see that it logs anything. 
There is no /var/log/moodle/ directory created.

To get logging I created /var/log/moodle/ owned by apache and appended > 
/var/log/moodle/cron.log 2>&1 to the script.

Since there was no logging, there was also no log rotation.

Tim
> ------------------------------
>
> Message: 4
> Date: Sun, 29 Jun 2008 17:58:49 +1000
> From: "Myles Carrick" <mylescarrick at gmail.com>
> Subject: Re: [Server-devel] PostgreSQL + Moodle
> To: server-devel at lists.laptop.org
> Message-ID:
> <69f11db60806290058j465fab57v7263fa0a9ca845cc at mail.gmail.com>
> Content-Type: text/plain; charset="windows-1252"
>
> hi Tim,
>
> Mate you posted in your setup of Moodle:
>
> "looks like the package already created /var/www/moodle/data with
> appropriate permissions so above was not necessary"
>
> It's really important for security that the moodledata directory NOT be in
> the webroot like this, otherwise Moodle's roles & permissions system 
> doesn't
> control access to any course files & materials - they all become public.
> Make sure you're using something like that folder you created earlier in
> your procedure (/var/moodledata).
>
> Myles C.
>
> Myles S Carrick
> Software Services
> Sydney Centre for Innovation in Learning (SCIL)
>



More information about the Server-devel mailing list