Moodle, Plesk and a bizzare ownship/permissions problem

Moodle, Plesk and a bizzare ownship/permissions problem

by Chris Burbul -
Number of replies: 12
Hi,

I have been over and over both this and the backups forum to no avail. here is the situation.

I am installing Moodle 1.5.3 on a virtual server (Virtuozzo VPS) running Fedora and using Plesk 7.5.4 hosting management software. The moodle installer says that the "moodledata" folder is not writable (even when permissons are change to 777) when owned by apache ( as the install instructions state irt should be). It only works ( works meaning moodle does not return an error warning that the "moodledata" folder is not writeable) when the moodledata folder is owned by root.

Unfortunetly, with the "moodledata" folder owned by root,  none of the backup functions will work.

The backup function attempts to write a series of folders under "moodledata" - moodledata/temp/backup and then a numbered folder that is used to assemble the files to be xzipped into the backup. These folders are created as owned by apache.

When I try to make a backup (manual or scheduled) the backup process writes the temp folder to moodledata successfully, but stop the pprocess and returns an error. If I then go and change the owner of "moodledata/temp" to root, and run the backup again, the backup succsefully creates the folder "backup", but again with apache as the owner so the backup then stop dead.

I can see from running top on my server that some HTTP processes are owned by apache and some by root. This appers to be the issue. Also ,I find it strange that  the problem persists when folder permissions are set to 777.

Does anybody using moodle with plesk have any idea what is going on and how to fix it?

Thanks you kindly for any input you can offer.


Chris
Average of ratings: -
In reply to Chris Burbul

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Ray Lawrence -
Hi,

You should be able to change the owner and group by logging into the server using Putty - providing you have shell access.

If you're not comfortable with the command line you could try WinSCP to access the server. This assumes you are a Windows user, of course.
In reply to Ray Lawrence

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Chris Burbul -
Ray, thanks for your reply.

I am not on windows, but linux. I do know how to change the ownerhip and permissions of files and directories. That is not the problem.

The problem is that Moodle wites files and directories that are owned by apache. My hosting setup (Plesk) is requiring that they be owned by root in order for the "moodledata" folder to be writable (and for Moodle itself to function), andfor any of the subfolders/files that moodle needs writes to be written.


Chris
In reply to Chris Burbul

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Ray Lawrence -
Hi Chris,

Hmmm, I understand the issue better now, but I'm not sure how you resolve it - I'm sure someone who can will be along shortly. smile I have a Plesk control panel too but don't have that problem.

Best wishes

Ray
In reply to Ray Lawrence

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Norbert Berger -
Who are your hosts? A company I know wishes to put Moodle on their site and have just signed a virtual hosted server deal with Ipowerweb. So would you both be willing to share that information, Ray and Charles?

Norbert 
In reply to Norbert Berger

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Chris Burbul -
I'd be happy to recomend my host, www.wingsix.com. I have been with them for years and they have always beenn helpful and dependable. I cannot recommed them specifcally for moodle hosting however. They have no specific expertise with moodle.

Chris
In reply to Ray Lawrence

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Jean Meadows -

Hi,

Please help... I have this problem and shell access and have tried a .htaccess file which is not helping.... what is the command for putty or WinSCP and where do I do it?

I am on my 8th day and have had my dedicated server formatted and upgraded just so that we can run Moodle 1.9...

I am not creative ... I followed the book...?  but either I missed something or there is a huge problem.. I even went as far as backing down to 1.8 and tried 1.6 of Moodle and got the same problem...

It is on a server level... I think I just need the commands...?  I don't know..

Here is the .htaccess file... was I supposed to change something here and missed it?

# On some PHP servers it may help if this file is copied
# to the main moodle directory and renamed .htaccess
#
# As soon as you do this, check your web site.  Is it
# still working OK?  If you are getting a "configuration
# error" then you may need to enable overrides by editing
# the main httpd.conf for Apache and in the main server
# or virtual server area, adding something like:
#
# <Directory /web/data>
#     AllowOverride All
# </Directory>
#

### Firstly, if you are using Apache 2, you need the following
### three lines to allow Apache to pass a PATH_INFO variable
### correctly for URLs like http://server/file.php/arg1/arg2

<IfDefine APACHE2>
    AcceptPathInfo on
</IfDefine>

### Secondly, you can define the default files in the Moodle
### directories as follows:

DirectoryIndex index.php index.html index.htm

### Thirdly, set up some PHP variables that Moodle needs

php_flag magic_quotes_gpc        1
php_flag magic_quotes_runtime    0
php_flag register_globals        0
php_flag file_uploads            1
php_flag short_open_tag          1
php_flag session.auto_start      0
php_flag session.bug_compat_warn 0

### Fourthly, sometimes Apache limits the size of uploaded files
### (this is a separate limit to the one in PHP, see below).
### The setting here turns off this limitation

LimitRequestBody 0


### These are optional - you may not want to override php.ini
### To enable them, remove the leading hash (#)

#php_value upload_max_filesize 2M
#php_value post_max_size 2M
#php_value session.gc_maxlifetime 7200


### You can change the following line to point to the
### error/index.php file in your Moodle distribution. 
### It provides a form which emails you (the admin)
### about 404 errors (URL not found).

#ErrorDocument 404 http://example.org/moodle/error/index.php


### People have reported that these can help in some cases
### (unusual) when you see errors about undefined functions

#php_value auto_prepend_file none
#php_value include_path .


These are my errors

1) A server error that affects your login session was detected. Please login again or restart your browser.

2) Your session has timed out. Please login again.

I have deleted cookies, sessions in the data folder and rebooted the computer, the server, reinstalled moodle, had the server formated and reinstalled with Fedora and the latest PHP, MySQL... when I install Moodle it appears to be fine but it never lets me set the admin info and when I try to login the 2 errors above are what I get.

Please help.. I don't want to change my hosting company... they have been solid for over 6 years and this is a wierd problem!

We are running it wide open on it's own domain and didn't hide it in a folder...

ASP Test

Name Value
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE en-us
HTTP_CONNECTION Keep-Alive
HTTP_COOKIE MOODLEID_=%25E2%25C8%2513E%25BD; MoodleSession=sj8iqp969jpih223avnfpbs612; MoodleSessionTest=dXlyPpD7Of
HTTP_HOST edu.xxxxxxx.com
HTTP_REFERER http://edu.xxxxxxx.com/index.html
HTTP_UA_CPU x86
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727)
REQUEST_METHOD GET
REQUEST_URI /test/apacheasp/test.asp

SSI Test

Name Value
HTTP_ACCEPT_CHARSET (none)
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_ACCEPT_LANGUAGE en-us
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
HTTP_CONNECTION Keep-Alive
HTTP_COOKIE MOODLEID_=%25E2%25C8%2513E%25BD; MoodleSession=sj8iqp969jpih223avnfpbs612; MoodleSessionTest=dXlyPpD7Of; session-id=045e43c001f1bf4c9e29768d4c77d070
HTTP_HOST edu.xxxxxx.com
HTTP_KEEP_ALIVE (none)
HTTP_REFERER http://edu.xxxxxxx.com/index.html
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727)
REQUEST_METHOD GET
REQUEST_URI /test/ssi/test.shtml

PHP Test

Name Value
PHP_VERSION 5.2.6
HTTP_ACCEPT image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, */*
HTTP_REFERER http://edu.xxxxxx.com/index.html
HTTP_ACCEPT_LANGUAGE en-us
HTTP_UA_CPU x86
HTTP_ACCEPT_ENCODING gzip, deflate
HTTP_USER_AGENT Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727)
HTTP_HOST edu.xxxx.com
HTTP_CONNECTION Keep-Alive
HTTP_COOKIE MOODLEID_=%25E2%25C8%2513E%25BD; MoodleSession=sj8iqp969jpih223avnfpbs612; MoodleSessionTest=dXlyPpD7Of; session-id=045e43c001f1bf4c9e29768d4c77d070
REQUEST_METHOD GET
REQUEST_URI /test/php/test.php
REQUEST_TIME 1216920632

 

Thank you...

Jeannie 2 Tickets

In reply to Jean Meadows

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Jean Meadows -

Disregard it...

I had to change the config-dist.php file... I too changed rights to 777 on everything from soup to nutz... i had to use a .htaccess file to solve the security problem... then i had to do the following that fixed the problem...

 1.)  Open the config-dist.php file
 2.)  Go to line 57 and change it from:

       $CFG->dbpersist = false;

                   to

        $CFG->dbpersist = 'true';

Notice the marks that wrap the word true (') these are needed in order for the script to run!

It worked for me... good luck to everyone else!!

 

In reply to Chris Burbul

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Chris Burbul -
Problem solved. It was PHP safe mode being turned on. There is a lot of infor if you search this forum on that.

Hope this saves someone the 10 days of hell this caused me.
In reply to Chris Burbul

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Ray Lawrence -
Hi Chris,

Excellent news! Glad you go this sorted.

Ray
In reply to Chris Burbul

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Norbert Berger -
HI Chris

I have run into a setup problem along similar lines, I fear: Installation does not start. php safe mode is off.
The server error logs show the following three lines:
[client 144.173.6.74] PHP Warning:  main() [<a href='function.main'>function.main</a>]: open_basedir restriction in effect. File(/typo3/class.t3lib_cs.php) is not within the allowed path(s): (/var/www/vhosts/businessenglishdirect.net/httpdocs:/tmp) in /var/www/vhosts/businessenglishdirect.net/httpdocs/vle/lib/textlib.class.php on line 28
[client 144.173.6.74] PHP Warning:  main(typo3/class.t3lib_cs.php) [<a href='function.main'>function.main</a>]: failed to open stream: Operation not permitted in /var/www/vhosts/businessenglishdirect.net/httpdocs/vle/lib/textlib.class.php on line 28
[client 144.173.6.74] PHP Fatal error:  main() [<a href='function.require'>function.require</a>]: Failed opening required 'typo3/class.t3lib_cs.php' (include_path='.:') in /var/www/vhosts/businessenglishdirect.net/httpdocs/vle/lib/textlib.class.php on line 28

I have no experience with this sort of code, so I am looking for help. I feel it is to do with the basedirectory where write permissions may not be set. Currently, all the directories created during the upload of moodle are owned by a specific user rather than root. If I create the modle directory as a root user, then the upload won't let me write those file sinto the directory.

Silly me!

Norbert
In reply to Norbert Berger

Re: Moodle, Plesk and a bizzare ownship/permissions problem

by Norbert Berger -
Hi CHris

Permissions are OK now, but the messages still show up: I amtrying to install moodle 1.6 beta as a second database. Could this be anything to do with the version of MySQL on the server?

1.5.3+ installed OK.

Still learning ....
Norbert