Unable to connect to WSGI daemon process

July 17, 2013

I got the following error on trying to access a Django site hosted though mod_wsgi on Apache, RHEL.

[Wed Jul 17 15:15:54 2013] [error] [client 192.168.0.1] (13)Permission denied: mod_wsgi
(pid=28961): Unable to connect to WSGI daemon process 'dashboard' on '/etc/httpd
/logs/wsgi.28849.0.1.sock' after multiple attempts.

This problem is due to the way Apache is structured on RHEL system. We need to change where the socket is located on disk. This socket is used for conversations between Apache and the WSGI process.

It was fixed by adding the following to the Apache config, outside the mod_wsgi virtual host.

WSGISocketPrefix /var/run/wsgi