Thumb folder permissions

Hey all,

I have a Digitalocean server setup running Ubuntu 16.04 with basically a LAMP setup.

I am running into issues however with the folder permissions. Thumbs will only be written when the folder permissions are set as 777. When setting them to 755 no thumbs will be generated.

Can anyone point my in the right direction?

All directories and files should be owned (chown) by the group that’s used by Apache. You can leave the user set to your login user so that you are still able to edit the files.

I have run sudo chown -R $USER:$USER /var/www/example.co.nz/public_html/thumbs with no luck.

How do I find the group used by Apache?

Thanks for your help.

The group is normally “www-data”. So the command would be:

sudo chown -R $USER:www-data /var/www/example.co.nz/public_html/thumbs
sudo chmod -R 775 /var/www/example.co.nz/public_html/thumbs
sudo chown -R www-data:www-data /var/www/example.co.nz/public_html/thumbs
sudo chmod -R 775 /var/www/example.co.nz/public_html/thumbs

Was the winner for me, does this have any security concerns at all?

Not as far as I can tell. If you only set the permissions to directories that need write permissions, it should be pretty safe. Just make sure not to allow Apache access to your home directory etc., otherwise hackers will have access too if there is a bug in Apache/Kirby/your code.

A post was merged into an existing topic: Apache writing within doc root a security issue?