webfaction nginx uwsgi install

47 views
Skip to first unread message

Richard Penman

unread,
Jan 11, 2015, 5:17:36 AM1/11/15
to web...@googlegroups.com
Hello,

I used the recipe here for installing web2py on webfaction with nginx and uwsgi:
https://community.webfaction.com/questions/7193/install-web2py-with-nginx-and-uwsgi

It worked great for me before but now have some problems.
I copied uwsgihandler.py from handlers/ directory but get this error when try to access the app:

uWSGI Error
Python application not found

This is the uwsgi.xml file used:
<uwsgi>
 
<socket>127.0.0.1:port</socket>
 
<workers>4</workers>
 
<no-orphans/>
 
<pythonpath>app/web2py</pythonpath>
 
<pidfile>/app/uwsgi/uwsgi.pid</pidfile>
 
<daemonize>/app/uwsgi/uwsgi.log</daemonize>
 
<app mountpoint="/">
 
<script>wsgihandler</script>
 
</app>
</uwsgi>

Should this be changed for current version of web2py?

Richard

Paolo Valleri

unread,
Jan 11, 2015, 10:29:34 AM1/11/15
to web...@googlegroups.com
According to the script you mention, the uwsgi.xml should be much different because it doesn't referee to any specific app.
it should be something like
<uwsgi>
   
<socket>127.0.0.1:${nginx_uwsgi_port}</socket>
   
<workers>4</workers>
   
<no-orphans/>
   
<pythonpath>/home/${USER}/webapps/${webfaction_app_name}/web2py</pythonpath>
   
<pidfile>/home/${USER}/webapps/${webfaction_app_name}/uwsgi/uwsgi.pid</pidfile>
   
<daemonize>/home/${USER}/webapps/${webfaction_app_name}/uwsgi/uwsgi.log</daemonize>

   
<app mountpoint=\"/\">
       
<script>wsgihandler</script>
   
</app>
</uwsgi>

Paolo

Richard Baron Penman

unread,
Jan 11, 2015, 9:10:00 PM1/11/15
to web...@googlegroups.com
When the script is run it converts this template into what I posted.
So how has web2py changed since that would break this?
> --
> Resources:
> - http://web2py.com
> - http://web2py.com/book (Documentation)
> - http://github.com/web2py/web2py (Source code)
> - https://code.google.com/p/web2py/issues/list (Report Issues)
> ---
> You received this message because you are subscribed to a topic in the
> Google Groups "web2py-users" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/web2py/pAv_2_lKqqk/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> web2py+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Paolo Valleri

unread,
Jan 12, 2015, 3:37:31 AM1/12/15
to web...@googlegroups.com
I haven't run that script but as far as I can get your are referring to the wrong file. 
The correct file should be placed in ~/webapps/${webfaction_app_name}/uwsgi/uwsgi.xml . Check there, otherwise it would be better to re-run the script to double check that everything has been installed/configured correctly.

 Paolo

Richard Baron Penman

unread,
Jan 12, 2015, 8:23:16 AM1/12/15
to web...@googlegroups.com
it's the correct file, run it and you would see.
As mentioned this worked fine for me with previous versions of web2py!

Anyone else?

Willoughby

unread,
Jan 12, 2015, 9:55:46 AM1/12/15
to web...@googlegroups.com
If you read the discussion on the webfaction community link in your first post, you'll see someone else is having same issue with uwsgi.
One of the other users said he created a new script - you might want to look into that.
Reply all
Reply to author
Forward
0 new messages