Skip to content
Advertisement

UWSGI https configuration for ubuntu

I have django app that is running using the following uwsgi configuration in redhat 7.3:

[uwsgi]
project = helloworld
base = %d

chdir=%(base)
module=helloworld.wsgi:application

plugins = router_redirect
route-if = equal:${HTTPS};on addheader:Strict-Transport-Security: max-age=31536000

master = true
processes = 1

enable-threads = true
threads = 1

max-requests = 2000

shared-socket = 0.0.0.0:443
https =  =0,cert/hello.crt,cert/hello.key,HIGH

pidfile = hello_uwsgi.pid

vacuum = true

die-on-term = true

However, when I run it on Ubuntu 16.04.1 LTS, I got the following error:

your processes number limit is 31283
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)
Python version: 3.5.2 (default, Nov 17 2016, 17:05:23)  [GCC 5.4.0 20160609]
Python main interpreter initialized at 0x1dfabe0
python threads support enabled
The -s/--socket option is missing and stdin is not a socket.
VACUUM: pidfile removed.

Does the error means that uwsgi fail to bind the port? Is there a special way of using “shared-socket” in ubuntu? I need to have this running on both port 443 and 8443. I have tried the above configuration for both port 443 and 8443 without success.

Thanks in advance.

Advertisement

Answer

I got this to work in ubuntu by reinstalling the python 3.5.2 from source.

I am guessing that there is some issue/incompatibility installing python 3.5.2 using apt-get.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement