I have multiple websites hosted on my server. The default user for apache is www-data.
For the different websites I have used different folders. Use for example user gary. When I try to write log files to gary unless I change the ownership of the log file directory (chown) to www-data (home/gary/public_html/logs), the files will not be written to. I have tried
chown -R www-data:gary /home/gary/public_html/logs
with no luck. I have to use
chown -R www-data /home/gary/public_html/logs
What am I doing wrong?