title: Unable to connect to WSGI daemon process mod_wsgi in Centos7 with Cpanel/WHM
body: <p>I'm with a problem while deploying <code>Django</code> in my VPS with <code>Centos 7.3</code> and WHM. It seems to work, except for a socket problem with <code>mod_wsgi</code>.</p>
  
  <pre><code>[Sun Jun 25 00:37:03.254774 2017] [wsgi:error] [pid 29756] (13)Permission denied: [client 66.249.83.220:35523] mod_wsgi (pid=29756): Unable to connect to WSGI daemon process 'brunamaiahair.com.br' on '/var/run/apache2/wsgi.721.27.1.sock' as user with uid=1004.
  </code></pre>
  
  <p>I read to insert <strong>WSGISocketPrefix</strong> as a directive, so I edited <code>httpd.conf</code> and put:</p>
  
  <pre><code>WSGISocketPrefix /var/run/apache2/wsgi
  </code></pre>
  
  <p>But I'm receiving the same error. Here is the log with the modified <code>httpd.conf</code> after an Apache restart:</p>
  
  <pre><code>[Sat Jun 24 21:10:56.084269 2017] [mpm_prefork:notice] [pid 721] AH00163: Apache/2.4.25 (cPanel) OpenSSL/1.0.2k mod_bwlimited/1.4 mod_wsgi/4.5.7 Python/2.7 configured -- resuming normal operations
  </code></pre>
  
  <p>Here is my <code>VirtualHost</code> configuration:</p>
  
  <pre><code>WSGIDaemonProcess brunamaiahair.com.br socket-user=#1004 python-path=/home/bmhair/public_html/django/framework:/home/bmhair/public_html/django/denv/lib/python2.7/site-packages
  
  WSGIProcessGroup brunamaiahair.com.br
  
  WSGIScriptAlias / /home/bmhair/public_html/django/framework/framework/wsgi.py
  </code></pre>