0

I am having an issue with my Django Logger and after checking the Apache logs I can see that it is a permission error.

[Mon Dec 15 22:15:22 2014] [error] [client 134.226.38.233] ValueError: Unable to configure handler 'file': [Errno 13] Permission denied: '/var/www/bias_experiment/src/survey.log', referer: http://phaedrus.scss.tcd.ie/bias_experiment/surveyone/

I changed the owner and group of the file (from me) to www-data with sudo chown www-data:www-data survey.log but this had no effect. Setting the write permissions to 777 gets rid of the error but I understand this is bad practice.

This answer to this question "Permission Denied when writing log file" has been very usefull but I do not understand one thing.

"You must make sure that the owner of the file is the service that's trying to write something to it or that the file belongs to group of the service or you'll get a permission denied error."

What is the name of the service or group that writes the Django Log file?

Setup:

  • Server: Ubuntu 12.04
  • Apache 2.2.22
  • mod_wsgi Version: 3.3-4ubuntu0.1
  • Python 2.7.3
  • Django 1.6
Community
  • 1
  • 1
Deepend
  • 4,057
  • 17
  • 60
  • 101

1 Answers1

2

is the same user that run apache. it depends by the OS, common values are

  • www-data
  • httpd

you must grant write and execute privileges to the directory that 'contains' the file.

sax
  • 3,708
  • 19
  • 22