[PYTHON] When you stumble on uWSGI's quick start

Note that I stumbled when I was building the environment with uWSGI + NGINX + python + centOS7.

Inaccessible with uWSGI quickstart

First of all, I tried the quick start described in uWSGI head family site. The procedure is as follows

Installation

$pip install uwsgi

Create sample file

Create in your home directory for the time being

/home/vagrant/foovar.py


def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return [b"Hello World"]

Start uWSGI

$uwsgi --http :9090 --wsgi-file foovar.py

access

http://192.168.33.10:9090

I should be able to go with this ...

I can't access it.

"I can't access this site."

Why.

The connection is rejected.

You can't fail with a quick start. .. ..

If you skip the ping without specifying the port, it will be returned.

After all, it was solved as follows.

$sudo /sbin/iptables -I INPUT 5 -p tcp --dport 9090 -j ACCEPT

The 9090 port wasn't open (laughs)

I couldn't find anyone who was in the same event even if I googled. This wasted a whole day w

that's all! !! !!

Recommended Posts

When you stumble on uWSGI's quick start
Python quick start
If you get stuck when building pycocoapi on Windows
Solution if you crash when using selenium on heroku
Things to do when you start developing with Django
When you want to use python2.x on modern Gentoo Linux
When you want to hit a UNIX command on Python