0.1 Web2py
# cd /home
# fetch http://www.web2py.com/ examples/static/web2py_src.zip
# unzip web2py_src.zip
# cp /home/web2py/handlers/ wsgihandler.py /home/web2py/
# chown -Rh www:www web2py
0.2 uWSGI
# cd /usr/ports/www/uwsgi
# make install clean
Create the file /usr/local/etc/uwsgi.ini
[uwsgi]
pythonpath = /home/web2py/
module = wsgihandler
socket = 127.0.0.1:9001
master = true
chmod-socket = 664
uid = www
gid = www
#enable-threads = true
processes = 4
socket-timeout = 180
post-buffering = 8192
max-requests = 1000
buffer-size = 32768
0.3 Nginx
# cd /usr/ports/www/nginx
# make install clean
Add to /usr/local/etc/nginx/nginx.
location ~ /welcome {
uwsgi_pass 127.0.0.1:9001;
include uwsgi_params;
}
0.4 Start Services
edit /etc/rc.conf:
nginx_enable="YES"
nginx_enable="YES"
uwsgi_enable="YES"
uwsgi_flags="-T –ini /usr/local/etc/uwsgi.ini"
# service uwsgi start
# service nginx start
Comments (0)