web2py with Cherokee via uWSGI: a simple, easy guide
(written specifically for Ubuntu, but applicable to all systems)
By: Evan Gray - GrayMatterComputing
I) web2py
___A) Download web2py (found at web2py.com)
______1) Install python, if not present:
sudo apt-get install python
___B) Unzip (to /var/web2py)
___C) Run:
sudo python /var/web2py/web2py.py -a desiredpassword
___D) Verify that it functions properly (by visiting localhost:8000), then close the server (Ctrl+C in terminal)
___E) Allow server permission to web2py:
sudo chown -hR www-data\: /var/web2py
______1) Where "www-data" is Cherokee's effective user (www-data is the default)
II) uWSGI
___A) Download uWSGI (found at projects.unbit.it/uwsgi/)
___B) Unpackage wherever and cd into folder
______1) Install dependencies for make, if not present:
sudo apt-get install python-dev libxml2-dev
___C) Make uwsgi:
sudo make -f Makefile.Py26
___D) Install:
sudo cp uwsgi26 /usr/local/bin/uwsgi
___E) Create config.xml:
sudo cat > /var/web2py/config.xml
<uwsgi>
<pythonpath>/var/web2py/</pythonpath>
<app mountpoint="/">
<script>wsgihandler</script>
</app>
</uwsgi>
[PRESS ENTER]
[PRESS CTRL+D]
III) Cherokee
___A) Install Cherokee (follow the instructions at cherokee-project.org)
______1) Note: I highly recommend using the PPA method so you can be sure to have the latest version and no issues!
___B) Run cherokee-admin:
sudo cherokee-admin
___C) Visit admin console (via browser, password is shown in terminal): localhost:9090
___D) Go to Virtual Servers, click Wizards, click Platforms, click uWSGI
______1) New Host Name: web2py
______2) Document Root: /var/web2py
______3) Configuration File: /var/web2py/config.xml
______4) Same logs as vserver: default(combined)
______5) Submit
___E) Go to Virtual Servers, click default
______1) Under "Basics", Virtual Server Nickname: original
___F) Go to Virtual Servers, click web2py
______1) Under "Basics", Virtual Server Nickname: default
______2) Under "Logging", verify all logging is correct (matches original)
___G) Go to Virtual Servers
______1) Set original Active to OFF
IV) Visit localhost (or your.ip.add.ress from another computer) to view your web2py site! :D
Comments (5)
0
sojin 14 years ago
0
salbefe 14 years ago
0
dragonfyre13 14 years ago
0
dragonfyre13 14 years ago
0
mrfreeze 14 years ago