I would like to make apache access log file readable by www-data (the user running the webserver) so I can serve it over HTTPS, to save me the trouble of SSHing to the server every time I want to check it.
I tried chmod o+r access.log
, but it seems that the permissions are automatically reset to -rw-r----- 1 root adm
.
Best Answer
In case you'r running a logrotate, which also sets the permissions of the new log files, that might be a good place to make the change. For example, this is a default apache2 logrotate on an Ubuntu server.
As you see there is a setting called create? Feel free to change it to whatever mode and ownership you want new log files to have. Also, here is how the create option is described in the logrotate(8) man file.