Forums | Mahara Community

Support /
Data directory - Write Access Problems


anonymous profile picture
Account deleted
Posts: 6

09 July 2010, 2:36

I have a dedicated server with root access so am not on shared hosting.  I have followed the installation instructions fully and checked the troubleshooting guide but am still having this problem.

I am running Mahara from http://portfolio.mrastbury.co.uk/ on Centos 5 (with Plesk).  I have created the data directory outside the http root of the webserver and have used chmod 777 in an attempt to get this working but when I run the online install it still tells me that the directory is not writable by the webserver. 

Any thoughts on what could be wrong?

anonymous profile picture
Account deleted
Posts: 228

09 July 2010, 6:41

The only thing that comes readily to mind is the possibility that you have set up the data directory correctly, but told Mahara incorrectly where it is.

Have you double checked the value in config.php? Is there a symbolic link somewhere ?

anonymous profile picture
Account deleted
Posts: 6

09 July 2010, 7:51

Thanks for the reply Penny.  Have already considered that, double and tripple checked it.  Just checked again now, the config.php file lists the path correctly.

The data directory is in the same directory as httpdocs. 

httpdocs is at /var/www/vhosts/mrastbury.co.uk/subdomains/portfolio/httpdocs

data is at /var/www/vhosts/mrastbury.co.uk/subdomains/portfolio/data

Exerpt from config.php below:

$cfg->dataroot = '/var/www/vhosts/mrastbury.co.uk/subdomains/portfolio/data';

If I move the data folder to within httpdocs and update config.php as needed the install script correctly identifies that the dataroot is within the webroot and won't let me proceed for security reasons.

All I can think of is that Plesk is messing something up, but I can't see what :(  I'm fairly average as a linux admin, not sure I fancy trying to admin the server without plesk making my life that little bit simpler...

anonymous profile picture
Account deleted
Posts: 228

09 July 2010, 8:44

Can you try putting $cfg->insecuredataroot = true; in your config.php and see if that fixes it?

anonymous profile picture
Account deleted
Posts: 6

09 July 2010, 10:57

Sorry nope, same problem :(

Thanks for tryin though

Iñaki Arenaza's profile picture
Posts: 253

10 July 2010, 16:30

This "smells" like SELinux is doing its job: preventing the httpd user from writing outside the designated directories (even it you give it 777 permissions).

Could you check if your CentOS has SELinux enabled? (you can use 'getenforce' or 'sestatus' for this).

If it is, I *think* that the following magic incantation might do the trick (I'm not a SELinux expect, I've just read the doc at http://docs.fedoraproject.org/en-US/Fedora/13/html/Managing_Confined_Services/sect-Managing_Confined_Services-The_Apache_HTTP_Server-Booleans.htmlhttp://wiki.centos.org/HowTos/SELinux and  http://wiki.centos.org/TipsAndTricks/SelinuxBooleans):

semanage fcontext -a -t public_content_rw_t "/path/to/your/datadirectory(/.*)?"
setsebool -P allow_httpd_anon_write on

I haven't tested anything of this, as I don't use SELinux and don't have a SELinux box at hand Frown

Saludos.
Iñaki.

anonymous profile picture
Account deleted
Posts: 6

12 July 2010, 13:09

Thanks Iñaki but I already have SELinux disabled.  Although after reading your post I did a bit of reading up on SELinux so have learnt something :)

Iñaki Arenaza's profile picture
Posts: 253

12 July 2010, 15:18

You don't configure open_basedir in your PHP settings (in php.ini, apache config or .htaccess files), do you? (you can check this by creating a new .php file with just a call to phpinfo() and having a look at the output page when you request that new file).

Saludos.
Iñaki.

anonymous profile picture
Account deleted
Posts: 6

13 July 2010, 5:04

looking at http://mrastbury.co.uk/info.php I suspect that may be the problem.  Work's firewall stops me using ssh so will investigate further tonight and let you know - many thanks!

anonymous profile picture
Account deleted
Posts: 6

13 July 2010, 13:50

Problem solved - thanks!

10 results