Search code examples
digital-oceanuwsgi

How can I get uwsgi quickstart 'Hello World' to work on Digital Ocean?


The reason I asked this question is that every other question regarding the subject that I have seen on Stack Overflow is more complicated than mine. I am not trying to get uwsgi to work with anything else. I am simply trying to get the most basic implementation of it to actually do something.

I am following these instructions:

https://uwsgi-docs.readthedocs.io/en/latest/WSGIquickstart.html

My domain is called "prosaurus.com" and It's registered on Godaddy. I have hosting through Digital Ocean which has provided me with the following IP address: 143.198.142.59

In Digital Ocean I have set up two A records to point to the associated droplet/IP address. One is for "prosuaurus.com" the other is for "*.prosuarus.com"

I have followed the instructions exactly, opting for PIP to install uwsgi (as opposed to using wget and make).

I have created a file called 'foobar.py' as suggested and entered the suggested contents.

I have started the server as suggested on port 9090. This is the output I get:

uwsgi --http :9090 --wsgi-file foobar.py
*** Starting uWSGI 2.0.20 (64bit) on [Wed Sep  7 16:45:00 2022] ***
compiled with version: 11.2.0 on 02 September 2022 19:04:11
os: Linux-5.15.0-47-generic #51-Ubuntu SMP Thu Aug 11 07:51:15 UTC 2022
nodename: ubuntu-s-1vcpu-1gb-intel-sfo3-01
machine: x86_64
clock source: unix
detected number of CPU cores: 1
current working directory: /home/deployer
detected binary path: /home/deployer/.local/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 3721
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 http bound on :9090 fd 4
spawned uWSGI http 1 (pid: 59211)
uwsgi socket 0 bound to TCP address 127.0.0.1:46629 (port auto-assigned) fd 3
Python version: 3.10.4 (main, Jun 29 2022, 12:14:53) [GCC 11.2.0]
*** Python threads support is disabled. You can enable it with --enable-threads ***
Python main interpreter initialized at 0x55b300c4fb30
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 72920 bytes (71 KB) for 1 cores
*** Operational MODE: single process ***
WSGI app 0 (mountpoint='') ready in 0 seconds on interpreter 0x55b300c4fb30 pid: 59210 (default app)
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI worker 1 (and the only) (pid: 59210, cores: 1)
oba

Everything appears to have worked correctly. I saw no error messages in any of the above steps (There was one warning suggesting I should use a virtual environment but this was just a warning right?)

yet, I do not see my hello world page. I don't see it on http://prosaurus.com:9090 or http://www.prosaurus.com:9090 or http://143.198.142.59:9090

What could I have possibly missed?

Side note: This server does have nginx installed on it, however I specifically turned it off before this test.


Solution

  • Firewall...

    sudo ufw allow 9090

    It would have been nice if they had mentioned this possibility in the docs.