Problems with the 'How To Set Up uWSGI and Nginx to Serve Python Apps' tutorial

October 2, 2016 78 views
Python Django Nginx Ubuntu

I'm going this tutorial

Im up to the part where this command needs to be run

uwsgi --socket --protocol=http -w wsgi

and then I should be able to see the 'Hello there' message at my server ip + :8080 (its btw)

however nothing seems to happen, in Chrome it appears to be loading something very slowly and eventually I get a message

'This site can’t be reached took too long to respond.'

uwsgi appears to be running ok in my terminal with no error messages, here it the output:

*** Starting uWSGI (64bit) on [Sun Oct  2 15:44:11 2016] ***
compiled with version: 4.8.4 on 01 October 2016 16:15:02
os: Linux-4.4.0-38-generic #57~14.04.1-Ubuntu SMP Tue Sep 6 17:20:43 UTC 2016
nodename: ubuntu-512mb-sgp1-01
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/david/myapp
detected binary path: /home/david/myappenv/bin/uwsgi
!!! no internal routing support, rebuild with pcre support !!!
*** WARNING: you are running uWSGI without its master process manager ***
your processes number limit is 1824
your memory page size is 4096 bytes
detected max file descriptor number: 1024
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to TCP address fd 3
Python version: 2.7.6 (default, Jun 22 2015, 18:01:27)  [GCC 4.8.2]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x16e99b0
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72760 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x16e99b0 pid: 11596 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 11596, cores: 1)

Ive checked the file and everything is the same as in the tutorial. No .ini file has been set up yet though as I have not reached that part yet.

If anyone can advise that would be great thanks

1 Answer
easycompany80 October 2, 2016
Accepted Answer

I think I have found the solution, I had followed the DO server firewall tutorial and only had ports 22 and 80 allowed with ufw so just added 8080 and now works.

Have another answer? Share your knowledge.