title: Python + Django run under a different user on apache2 (httpd), Redhat
body: <p>i' ve a django application binded to httpd (apache2) on Red hat, and it works well however i' d like to run it under a different username than apache, so if it writes to the filesystem the file' s owner should be newuser. I' m looking for a solution to achieve this.</p>
  
  <p>I tried to use httpd-itk (after this: <a href="http://www.webtatic.com/packages/httpd-itk/" rel="nofollow">http://www.webtatic.com/packages/httpd-itk/</a>), but it complains about:</p>
  
  <pre><code>permission denied: mod_wsgi (pid=31322): Unable to connect to WSGI daemon process
  'myapp.djangoserver' on '/var/run/wsgi.31085.0.1.sock' after multiple attempts.
  </code></pre>
  
  <p>After resolving this (by giving 777 permission for test for the file) i still have apache as the file' s owner.</p>
  
  <p>My conf file looks like this:</p>
  
  <pre><code>&lt;VirtualHost *:80&gt;
  
      ServerName myapp
      ServerAlias myapp 
      DocumentRoot /usr/share/myapp
  
      &lt;Directory /usr/share/myapp&gt;
          Order allow,deny
          Allow from all
      &lt;/Directory&gt;
  
      WSGIDaemonProcess syntyma.djangoserver processes=10 threads=20 display-name=%{GROUP}
      WSGIProcessGroup myapp.djangoserver
  
      WSGIScriptAlias / /usr/share/myapp/apache/django.wsgi
      CustomLog logs/myapp-access.log combined
      ErrorLog logs/myapp-error.log
  
      LogLevel debug
      AssignUserId newuser newuser
  
  &lt;/VirtualHost&gt;
  WSGISocketPrefix /var/run/wsgi
  </code></pre>
  
  <p>, and the created testfile:</p>
  
  <pre><code>ls -l /tmp/ggg
  -rw-r--r-- 1 apache apache 3 Sep  6 09:46 /tmp/ggg
  </code></pre>
  
  <p>.</p>
  
  <p>How could i reach my goal with htttpd-itk or any other solution, like some suEXEC, or similar?</p>
  
  <p>Thanks.</p>