Posts made by Visvanath Ratnaweera

Picture of Particularly helpful Moodlers Picture of Translators
Hi

You wrote:
> I'm trying to install Moodle.
> > The instructions state

What instructions exactly? Moodle Docs are quite big.

> to copy the moodle folder to web server (in this instance /var/www).

Sure. A web application needs to be run from the DocumentRoot of the web server.

> However, I get permission errors.

Generally, when you get an error, you have to show it to the helpers. It is like a symptom, you have to describe it accurately. Specifically, permission errors are a Unix file permissions thing. That is the basis of doing anything on Linux. moodle.org is the wrong place, although many helpers here go out of the way to explain many unrelated things.

> I am running Ubuntu 23.10.

Ubuntu is a distribution, a collection of programs around the Linux kernel. So you are running the Ubuntu flavour of Linux (although Mark Shuttleworth likes to hear it differently).

> How do I change permissions so I can copy or cut the folder to the directory /var/www ?

As said above, copying files and setting their permissions is a pre-condition to anything on a Unixode.

> (I've noticed with Ubuntu there are a lot of instructions that aren't clearly stated and require searching on the web for solutions -

Yes, if you don't have them ready, then you have to search.

> and when you find something, there appears to be multiple ways to achieve the task.

If a question doesn't have three answers, it is not a Unix question.
wink

> I'm not that familiar with Ubuntu, and commands I'd previously used (eg nautilus back in 2016) are now no longer available.

I don't know what nauillus is, but the Unix file ownership is at least 50 years old and haven't changed.

> A lot of threads on how to do x, y etc are dating back to 2011-2016. its very frustrating.

When you say "threads" you mean different people talking on the same or related topics. Then that is the nature of a forum, right? Look at those discussions from the perspective of the helpers!

> Comprehensive instructions should be in one place).

Sure! That place is unfortunately not still digitized - may be soon with the dawn of AI.
big grin
Picture of Particularly helpful Moodlers Picture of Translators
The recommended way is always to a test upgrade to find these hickups. And the recommended "downgrade" is to restore the backup you made before the upgrade.

If you've left the recommended paths, you can try your luck by moving the plug-in directory away from the Moodle code tree.
Picture of Particularly helpful Moodlers Picture of Translators
Hi Leon

You wrote:
> I'm not aware of any changes between versions that might cause this.

Thanks for that pointer. Then I will have a second look. I know that my 3.9 LTS setup worked, because it still does. I recovered that VM.

Here are the ownerships and permissions of its moodledata:
$ ls -l
total 24
drwxrwx---   2 user008  www-data    6 Sep 22 00:45 antivirus_quarantine
drwxrwx---   3 www-data www-data   55 Sep 21 03:07 cache
drwxrwx---   2 www-data www-data   24 Aug 15 16:04 diag
drwxrwx--- 258 user008  www-data 8192 Nov  1 14:26 filedir
drwxrwx---   2 user008  www-data    6 Sep 21 04:45 lang
drwxrwx---   7 www-data www-data  101 Sep 21 03:10 localcache
drwxrwx---   6 user008  www-data   42 Sep 21 19:00 models
drwxrwx---   3 user008  www-data   40 Aug 11 11:11 moodle008data
drwxrwx---   2 www-data www-data   24 Sep 21 03:06 muc
drwxr-x---   3 www-data users      27 Feb  8  2023 repository
drwxrwx---   2 www-data www-data 4096 Nov 26 02:35 sessions
drwxrwx---   5 www-data www-data   73 Nov 30 06:55 temp
drwxrwx---  94 user008  www-data 4096 Dec  1 14:25 trashdir
-rw-rw----   1 user008  www-data  168 Aug  5  2022 warning.txt
They look messed up but through the write permissions for the group www-data both the shell user and the web-server can write and delete files.

$ id user008
uid=1008(user008) gid=33(www-data) groups=33(www-data)

$CFG->directorypermissions = 0770;
Note that there are no "777".

So the only possibility is a difference between the two LEMP installations - both are Nginx, php-fpm with fastcgi. The old (working) one is Debian 11, the newer (not working) one is Ubuntu 22.04.

> If I remember correctly this is the symptom, i.e. that a task did not complete correctly, the A lock was created… message is not the actual error to be resolved. So one needs to identify the task that was running and see if there are any errors reported.

But every shell user who owns a Moodle instance gets this. In this setup any shell user can install a single Moodle instance under a subdirectory mysite/siteXYZ. So all sites can't get one fine day, when I rebooted the machine after a minor apt upgrade!

So on to Nginx and/or PHP pecularities.

Picture of Particularly helpful Moodlers Picture of Translators
My specific question is whether Moodle will allow a shell user other than the owner of the web server to run its Cron? I can provide the Unix side of file permissions - the usual things with groups and the more obscure guid, suid, sticky bit or whatever. What I don't know is the Moodle  side, whether Moodle, specifically starting from 4.0, won't allow that.