- Set the owner & group of file & folder to apache user (www-data)
sudo chown -R www-data:www-data /path/to/your/root/directory
sudo chown -R www-data:www-data /path/to/your/root/directory
- Add user to the webserver user group
sudo usermod -a -G www-data ubuntu