title: uwsgi service is not starting
body: <p>I have a python application (concrete Django) running on my server. Before yesterday, it was successfully running under apache with mod-wsgi with almost no problem. I had two main reason to switch to nginx:</p>
  
  <ul>
  <li>performance - under nginx, I have almost half time for each request</li>
  <li>two applications together was not running successfully under apache - solved by nginx</li>
  <li>third reason is better configuration for me</li>
  </ul>
  
  <p>I have a problem with the uwsgi service. First, I will include the app's wsgi file:</p>
  
  <pre><code>import os
  import sys 
  
  path = os.path.abspath(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
  
  if path not in sys.path:
  sys.path.append(path)
  
  os.environ.setdefault("DJANGO_SETTINGS_MODULE", "usporion.settings")
  
  from django.core.wsgi import get_wsgi_application
  application = get_wsgi_application()
  </code></pre>
  
  <p>Then I have uwsgi.ini file for init app, located under <code>/etc/uwsgi/apps-enabled/usporion.ini</code>:</p>
  
  <pre><code>[uwsgi]
  plugins = python
  uid = www-data
  gid = www-data
  uwsgi-socket = /srv/sockets/usporion.sock
  chmod-socket = 664
  chdir = /srv/www/usporion
  pythonpath = /srv/www/usporion
  module = usporion.wsgi
  env = DJANGO_SETTINGS_MODULE=usporion.settings
  logdate = True
  logto = /var/log/uwsgi/usporion.log
  #daemonize = /var/log/uwsgi/usporion.log
  vacuum = True
  max-requests = 1000
  processes = 5
  threads = 10
  workers = 5
  vhost = True
  </code></pre>
  
  <p>Note: I have tried to have daemonize uncommented (but this is not working with current usage).</p>
  
  <p>Lastly, I have this nginx config:</p>
  
  <pre><code>upstream django {
      server 95.168.193.219:80;
  }
  
  server {
      listen          95.168.193.219:80;
      server_name     usporion.cz;
      return      301 $scheme://www.usporion.cz$request_uri;
  }
  
  server {
      listen          95.168.193.219:80;
      server_name     www.usporion.cz;
      charset         utf-8;
  
      client_max_body_size 100M;
  
      location /media {
          alias       /srv/www/usporion/media;
          expires     1d;
      }
  
      location /static {
          alias       /srv/www/usporion/static;
          expires     1d;
      }
  
      location / {
          root        /srv/www/usporion;
          include     uwsgi_params;
          uwsgi_pass  unix:///srv/sockets/usporion.sock;
      }
  }
  </code></pre>
  
  <p>Running the command <code>uwsgi --ini /etc/uwsgi/apps-enabled/usporion.ini</code> is working fine and I'm able to see app working on the web. However, if I do <code>service uwsgi start</code>, service is not started (FAIL) with no message and I cannot find anything in the logs. Running this service without <code>usporion.ini</code> in apps-enabled is working fine.</p>
  
  <p>I would be pleased for any help which with I can avoid running uwsgi "service" under screen but run as normal service.</p>
  
  <p>Here is the dist info:</p>
  
  <pre><code>root@[name]:/etc/nginx/sites-enabled# uname -a
  Linux [name] 2.6.32-5-amd64 #1 SMP Sun Sep 23 10:07:46 UTC 2012 x86_64 GNU/Linux
  root@[name]:/etc/nginx/sites-enabled# cat /etc/debian_version 
  6.0.7
  root@[name]:/etc/nginx/sites-enabled# nginx -v
  nginx version: nginx/1.2.6
  root@[name]:/etc/nginx/sites-enabled# uwsgi --version
  1.2.3-debian
  root@[name]:/etc/nginx/sites-enabled# python --version
  Python 2.7.3
  </code></pre>
  
  <p>Lastly, if someone would like to give me some advice to configure (I'm new to nginx and it's welcome), this is 8-core Xeon server 2.4GHz with 16GB of RAM, half of that is reserved for this app.</p>