To setup a nginx+uwsgi web2py, I found this script -
setup-web2py-nginx-uwsgi-ubuntu.sh - to be the most useful:
https://raw.githubusercontent.com/web2py/web2py/master/scripts/setup-web2py-nginx-uwsgi-ubuntu.sh
This sets up uwsgi-emperor to manage the uwsgi process. Also the
process' web2py specific configuration (/etc/uwsgi/web2py.ini) is:
[uwsgi]
socket = /tmp/web2py.socket
pythonpath = /home/www-data/web2py/
mount = /=wsgihandler:application
processes = 4
master = true
harakiri = 60
reload-mercy = 8
cpu-affinity = 1
stats = /tmp/stats.socket
max-requests = 2000
limit-as = 512
reload-on-as = 256
reload-on-rss = 192
uid = www-data
gid = www-data
touch-reload = /home/www-data/web2py/routes.py
cron = 0 0 -1 -1 -1 python /home/www-data/web2py/web2py.py -Q -S welcome
-M -R scripts/sessions2trash.py -A -o
no-orphans = true
Also, I notice that your python is at Python version: 2.4.3. Possible
for you to upgrade to Python 2.7.x?
________________________________________
Kiran Subbaraman
http://subbaraman.wordpress.com/about/
On Wed, 01-06-2016 9:40 PM, Jose wrote:
As mentioned in a previous post [1] after updating web2py they stopped
working my webfation applications.
Following this, I installed nginx+uwsgi instead apache+mod_wsgi.
Nginx works fine, the problem I have aparantemente uwsgi.
uwsgi configuration (/home/myuser/local/etc/uwsgi.conf) is:
|
[uwsgi]
pythonpath =/home/myuser/web2py/
module=wsgihandler:application
socket =/home/myuser/tmp/uwsgi.sock
#socket = 127.0.0.1:9001
master =true
chmod-socket =660
vacuum =true
#enable-threads = true
processes =5
threads =7
socket-timeout =180
post-buffering =8192
max-requests =1000
buffer-size =32768
|
when start uwsgi
/home/myuser/local/uwsgi/uwsgi -T --ini /home/myuser/local/etc/uwsgi.conf
the output is as follows:
[uWSGI] getting INI configuration from /home/myuser/local/etc/uwsgi.conf
*** Starting uWSGI 2.0.13.1 (32bit) on [Wed Jun 1 16:00:43 2016] ***
compiled with version: 4.1.2 20080704 (Red Hat 4.1.2-55) on 01 June
2016 10:50:09
os: Linux-2.6.18-400.1.1.el5PAE #1 SMP Thu Dec 18 01:38:34 EST 2014
nodename: web34.webfaction.com
machine: i686
clock source: unix
pcre jit disabled
detected number of CPU cores: 8
current working directory: /home/myuser
detected binary path: /home/myuser/local/uwsgi/uwsgi
your processes number limit is 300
your memory page size is 4096 bytes
detected max file descriptor number: 4096
lock engine: pthread robust mutexes
thunder lock: disabled (you can enable it with --thunder-lock)
uwsgi socket 0 bound to UNIX address /home/myuser/tmp/uwsgi.sock fd 3
Python version: 2.4.3 (#1, Jan 9 2013, 06:49:54) [GCC 4.1.2 20080704
(Red Hat 4.1.2-54)]
Python main interpreter initialized at 0xa0fc908
python threads support enabled
your server socket listen backlog is limited to 100 connections
your mercy for graceful operations on workers is 60 seconds
mapped 2199048 bytes (2147 KB) for 35 cores
*** Operational MODE: preforking+threaded ***
added /home/myuser/web2py/ to pythonpath.
Traceback (most recent call last):
File "/home/myuser/web2py/wsgihandler.py", line 37, in ?
import gluon.main
File "/home/myuser/web2py/gluon/__init__.py", line 21, in ?
import pydal
File "/home/myuser/web2py/gluon/packages/dal/pydal/__init__.py", line 3
from .base import DAL
^
SyntaxError: invalid syntax
unable to load app 0 (mountpoint='') (callable not found or import error)
*** no app loaded. going in full dynamic mode ***
*** uWSGI is running in multiple interpreter mode ***
spawned uWSGI master process (pid: 27009)
spawned uWSGI worker 1 (pid: 27010, cores: 7)
spawned uWSGI worker 2 (pid: 27011, cores: 7)
spawned uWSGI worker 3 (pid: 27012, cores: 7)
spawned uWSGI worker 4 (pid: 27025, cores: 7)
spawned uWSGI worker 5 (pid: 27026, cores: 7)
Any idea how to fix it
Best regards
Jose
[1] https://groups.google.com/forum/#!topic/web2py/7mTex8ufUOo
--
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 the Google
Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to web2py+unsubscr...@googlegroups.com
<mailto:web2py+unsubscr...@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
--
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 the Google Groups "web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.