Tuesday, 14 December 2021

Apahce2 /var/log/apache2 is written by root user by default && /var/log/mysql is written by mysql user

 https://serverfault.com/questions/905170/does-root-write-the-logs-in-a-default-apache-installation

Apache2

In the default Apache installation, all log files in /var/log/apache2 are written by root user. This is a security measure as it protects anyone from writing or gain access to the directory. It is recommended to not change the owner to www-data.

The Apache process running as root is responsible for writing the logs.



https://dba.stackexchange.com/questions/121258/what-to-do-when-mysql-is-not-generating-any-logs-at-all-on-debian


Mysql


Thanks to commenters for their insights. The solutions was:

  1. Add "log_errors = /var/log/mysql/mysql.err" to my.cnf
  2. See permissions error in error log
  3. chmod log files to "mysql:root"

No comments:

Post a Comment