Can't write to moodle data directory

Can't write to moodle data directory

by William Mudge -
Number of replies: 3
Hey All.

I've installed Moodle 1.5.2 without issue on NT. I'm now instaling it on SuSE 10.0 and I'm having trouble.

I believe I've followed all steps. Database is up and running, I've checked php.ini and httpd.conf. I've created the config.php file but when I get to the GPL license page, I get these errors at the bottom of the page:-

Warning: Unknown(): open(/moodle_data_test/sessions/sess_9de912b0242bc22309d1a36ea737186d, O_RDWR) failed: Permission denied (13) in Unknown on line 0
 
 Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/moodle_data_test/sessions) in Unknown on line 0

The owner and permissions of the /moodle_data_test folder are fine (wwwrun:www, 777). If I pick a new folder and tighten permissions I get errors about creating the "sessions" sub-folder, so I don't think it's file system permissions causing the problems. I think it must be the setup of apache or php, but I don't know what to do next.

Any suggestions?

Moodle 1.5.2
apache 2.0.54
php 4.4.0
Average of ratings: -
In reply to William Mudge

Re: Can't write to moodle data directory

by Andrea Bicciolo -
Have you tried to change permissions with the -R flag, so every subfolder/file are recursively changed?
In reply to Andrea Bicciolo

Re: Can't write to moodle data directory

by William Mudge -
Sure have mate. Every file and folder is wide open to the world... 777
In reply to William Mudge

Re: Can't write to moodle data directory

by William Mudge -
All,

Just thought I'd let you know I've located the cause of the problem. Even if no one else has this issue at the moment, it should help those attempting random googlings to solve simmilar problems in the future.

There is an application called "AppArmor" that comes bundled with SuSE. I had turned it on, but not configured it. It acts as an extra layer of security, restricting applications access based on individual application "profiles". The profile that Apache was running with was preventing write access to my moodle_data folder.

So, if you have this app, either set it up properly or disable it in order to use Moodle. It has a fairly useful interface to fine tune the profiles, and now that I've configured this folder Moodle seems to happily co-exist with AppArmor.

I was on the right track originally, it was really just a matter of finding the right log file (the AppArmor log). Luckily I'd configured it to e-mail them to me.

Thanks to those that attemped to help.

Cheers.