0

I am trying to setup my django project with uwsgi and nginx on EC2. I have already had my uwsgi.ini file in place.

However, when I ran: sudo uwsgi --ini uwsgi.ini

I got the following Error:

FAILED to start flash policy server: [Errno 13] Permission denied: ('0.0.0.0', 843)

my wsgi.py file looks like: PORT = 9000

import os

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "night.settings")

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

from socketio import SocketIOServer

print 'Listening on port %s and on port 843 (flash policy server)' % PORT
SocketIOServer(('', PORT), application, resource="socket.io").serve_forever()

And my uwsgi.ini file looks like: [uwsgi]

socket=/tmp/uwsgi.sock
chmod-socket=644
uid = www-data
gid = www-data

chdir=/home/ubuntu/project
module=project.wsgi:application
pidfile=/home/ubuntu/project.pid
vacuum=true

Could someone help?

Thanks in advance

user2002692
  • 971
  • 2
  • 17
  • 34
  • 2
    https://github.com/stephenmcd/django-socketio/issues/8 . Whats' in your uwsgi file? It sounds like you aren't launching the socket server with root – Timmy O'Mahony Feb 18 '14 at 19:39
  • You mean what is in my wsgi.py file, or what is in my uwsgi.ini file? – user2002692 Feb 18 '14 at 19:43
  • Why are you using _SocketIOServer_ if you want to serve with uWSGI? – jwalker Feb 18 '14 at 23:46
  • I am new to uWsgi and Nginx world, not sure what is the right thing to use. More directions will be appreciated. – user2002692 Feb 19 '14 at 00:32
  • @user2002692 uWSGI looks for a callable named _application_ in the module you specify, then it forwards all requests to it. Since uWSGI is the HTTP server, you don't need to serve otherwise, so you need to remove last three lines of code. BUT there must be a reason you have that code there, especially considering it is async. Also I have no idea whether you need that policy server or not. And finally, latest version of SocketIOServer serves on port 10843 which doesn't need root permissions. So, too many things here. – jwalker Feb 19 '14 at 17:35

0 Answers0