My apache server run with www-data user :
In file : /etc/apache2/envvars
export APACHE_RUN_USER=www-data
export APACHE_RUN_GROUP=www-data
I Have a process who run with root :
Maybi that’s why I have file who are create by root user and not www-data user, and www-data user can’t write into this file and generate error 500 in my glpi application.
What can I do ?
Regard
2
Answers
You can chown it. Stop apache if you can’t do it while running.
It may not be relevant to the OP’s original problem, but another common scenario for this issue is the use of cron to run a PHP script that is also run by the website.
Website frameworks such as symfony or codeignitor create their own log files. If you setup the cron under root to execute a script using one of these frameworks, the logs would more than likely be created as the root user especially if executed at midnight.
This means, for the rest of the day, the webserver running under apache/nginx will fail to update the log, because the permission are for root user, not apache/nginx’s user.