In what seemed to be a random occurrence, a site went down tonight and after taking a look at the Apache error logs it was this issue:
(13)Permission denied: mod_wsgi (pid=2751): Unable to connect to WSGI daemon process 'mysite.com-ssl' on '/var/run/apache2/wsgi.2579.0.2.sock' after multiple attempts.
Now I read the ConfigurationIssues wiki for mod_wsgi, and the fix seems reasonable. Couldn't write to that directory so an alternative must be specified with WSGISocketPrefix
So I set:
WSGISocketPrefix /var/run/wsgi
It fixes the issue, and the site can load up after an Apache restart.
However, I'm very curious - Why did this dirctory stop being available for write? Am I missing something? The /var/run/apache2
directory is owned by root:root
, but the new sockets that now run under /var/run/wsgi*.sock
are www-data:root
.. There was a server reboot, but that's it. Maybe something now takes over permissions on that directory on boot?
Any ideas? Thanks!