web2py uwsgi

66 views
Skip to first unread message

xaver

unread,
Mar 2, 2014, 6:55:12 AM3/2/14
to web...@googlegroups.com
Hi,

I'm on os x 10.6.8 machine and I'm trying to run web2py with uwsgi.
I'm following the tutorial on http://uwsgi-docs.readthedocs.org/en/latest/WSGIquickstart.html.
Downloaded and compiled uwsgi.
when I run uwsgi  with the ini file I'm not able to connect to the admin interface.
In the browser I give https://localhost:9090/admin/default/index

If I run ./uwsgi --http :9090 --wsgi-file /Users/xaver/web2py/web2py/src/wsgihandler.py  --master --process 4 --threads 2 --stats 127.0.0.1:9191
it generate an error ticket which last lines are:
S'Traceback (most recent call last):\n  File "/Users/xaver/web2py/web2py/src/gluon/restricted.py", line 217, in restricted\n    exec ccode in environment\n  File "/Users/saverioscavelli/web2py/web2py/src/applications/admin/models/access.py", line 29, in <module>\n    port = int(request.env.server_port or 0)\nValueError: invalid literal for int() with base 10: \'9090,foobar.crt,foobar.key\'\n'

Another problem I'm having is with the virtualenv. In the above cited tutorial it says that is enough to simple make an entry in the iniffile
eg. virtualenv=/path/to/the/virtualenv and uwsgi will find all the needed stuff, but that doesn't work for me:

uWSGI http bound on :9090,foobar.crt,foobar.key fd 4
uwsgi socket 0 bound to TCP address 127.0.0.1:56782 (port auto-assigned) fd 3
Python version: 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)  [GCC 4.2.1 (Apple Inc. build 5646)]
Set PythonHome to /Users/xaver/web2py/web2py/
'import site' failed; use -v for traceback


this is the output after running make:
pcre = True
kernel = Darwin
malloc = libc
execinfo = False
ifaddrs = True
ssl = True
zlib = True
locking = osx_spinlock
plugin_dir = .
timer = kqueue
yaml = embedded
json = False
filemonitor = kqueue
routing = True
debug = False
capabilities = False
xml = libxml2
event = kqueue

How you can see ssl is compiled with.

and this is my uwsgi ini file:

[uwsgi]
http = :9090,foobar.crt,foobar.key
chdir = /Users/xaver/web2py/web2py/src/
module = wsgihandler
master = true
processes = 8
enable-threads = true

any ideas?

thks.

xaver

Roberto De Ioris

unread,
Mar 2, 2014, 7:58:31 AM3/2/14
to web...@googlegroups.com
it is https not http. certificates on plain http have no meaning




--
Roberto De Ioris
http://unbit.it

xaver

unread,
Mar 2, 2014, 8:54:34 AM3/2/14
to
it is https not http. certificates on plain http have no meaning

Hi,

thks. for the answer. But please be a bit more verbose.
Not matter how I call it: over http or https I can't acces the admin interface of web2py
mybe the problem lays to the web2py security restriction.
Tkhs.

xaver 

Roberto De Ioris

unread,
Mar 2, 2014, 9:32:59 AM3/2/14
to web...@googlegroups.com
>> Hi,
>
>
> thks. for the answer. But please be a bit more verbose.
> Not matter how I call it: over http or https I can't acces the admin
> interface of web2py
> mybe the problem lays to the web2py security restriction.
> Tkhs.
>
>

I was referring to the uWSGI option:

NOT http = :9090,foobar.crt,foobar.key

BUT https = :9090,foobar.crt,foobar.key

"http =" does not take certificates as parameter so your SERVER_PORT will
be mapped to the string "9090,foobar.crt,foobar.key" that is the cause of
the first reported exception
Reply all
Reply to author
Forward
0 new messages