Site Permissions

Hi all, I have a Kirby 5 site hosted on a DigitalOcean droplet, using a domain I bought from NameCheap, and uses Cloudflare nameservers. I created multiple pages in my local env which were uploaded fine to the hosted site, and then I created more pages after I installed the panel on the hosted site. But now I’m unable to edit the existing content on the hosted site panel even as an admin (I can edit it manually in the files, or locally and then upload to host), and I’ve rerun all the chmod permissions for files and directories many times now.

I’m able to create new pages, but once a page has been created, I get an error along the lines of:

The file “/var/www/…/site/cache/…/changes/….cache” is not writable

I feel like this might be because of a change I made to the .gitignore file to ignore the /content and /media folders, and I moved those folders on the hosted site outside of the git repo when I was pulling just in case they got deleted, and moved them back after. But I reran all the same permissions commands, so I’m not sure where it’s going wrong here and would like a little guidance. Thanks!

The first step would be to check not only file/folder permissions (and make sure these are applied recursively), but also file/folder ownership

This is what I get from the check:

total 32

-rw-r--r--  1 root www-data 2056 Dec 30 04:24 README.md

-rw-r--r--  1 root www-data    0 Dec 30 04:24 TODO.md

drwxrwxr-x  4 root www-data 4096 Dec 30 04:24 assets

drwxrwxr-x 22 root www-data 4096 Jan  7 22:11 content

-rw-r--r--  1 root www-data 2545 Dec 30 04:24 favicon.ico

-rw-r--r--  1 root www-data   67 Dec 30 04:24 index.php

drwxrwxr-x 10 root www-data 4096 Dec 30 04:24 kirby

drwxrwxr-x  4 root www-data 4096 Jan  7 21:32 media

drwxrwxr-x  9 root www-data 4096 Dec 30 04:24 site

and inside the /site/cache/[domain]/changes folder, if that helps:

total 12

drwxrwxr-x 2 root www-data 4096 Jan  9 17:50 changes

drwxrwxr-x 2 root www-data 4096 Jan  5 22:54 updates

drwxrwxr-x 4 root www-data 4096 Jan  6 13:52 uuid

What about the files in /site/cache/[domain]/changes folder?

inside the /changes/ folder:

total 16
-rw-r--r-- 1 root www-data  45 Jan  9 17:32 files.cache
-rw-r--r-- 1 root www-data 212 Jan  7 21:56 pages.cache
-rw-r--r-- 1 root www-data  56 Jan  9 17:32 sites.cache
-rw-r--r-- 1 root www-data  53 Jan  7 21:56 updated_9690f84687f60097e3e043301f53cdb3607d3226.cache

Ok, here we see that the www-data group has no write rights to the files, you either need to give the www-data group write access or make the www-data user the owner

Because of the “-rw-r–r–” rule on the .cache files?

okay, i’ll try that thanks!

Yes

www-data should ideally own the files

Awesome, I ran chown -R www-data:www-data /var/www/[domain] and that fixed it! Thank you :slight_smile: