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?
www-data
own the logs and have write permissions, an intruder can overwrite the logs and cover its tracks. The log files are opened byhttpd
as the root user. If I remember correctly, at least.... – Tommiie Jun 17 '19 at 15:14