TKLPatch for web2py framework

I've attached my fresh patch to create a web2py appliance from TKL's LAPP stack 11.0. I will follow this post for feedback eagerly.

I'm lucky to have a friend mentoring me in packaging for Debian and Ubuntu; with review of the debian fs hierarchy and Liraz's helpful feedback re: another patch, I chose to put web2py in /usr/share/. I look forward to your feedback about this decision.

I relied on 2 lines of Massimo's (the developer) Ubuntu configuration script to create a firstboot hook (right word?) to prompt the user for an admin password for web2py -- that's another new first for me.

I also relied on Massimo for the new default apache2 configuration. I'm waiting for feedback and input from Massimo, based on which I may revise this patch.

In the meantime, I'll post build notes here and at our site along with the patched ISO and virtual machines for VirtualBox and VMware.

While working on the patch for Sahana Eden, the idea for a web2py patch came up at around this point.

Below, please find the build notes used to create the web2py TKLPatch.

Install and configure  LAPP

Start with TKL LAPP 11.0 Lucid.

Install to a system.

Follow prompts for credentials:

  • Set password for user root:  root
  • Set password for postgres: postgres

Indicate approval when prompted to get security updates.

Install Relevant Packages

apt-get update
apt-get install ipython python-dev libapache2-mod-wsgi python-psycopg2 python-matplotlib python-reportlab bzr -y

Get and Place web2py Source

unzip -d /usr/share/

Change Owner for web2py

chown -R www-data:www-data /usr/share/web2py

Enable Modules

a2enmod ssl #unnecessary

a2enmod proxy #unnecessary

a2enmod proxy_http

service apache2 restart

Disable Default Site

a2dissite default

Place and Enable New Default Configuration

New default config can be extracted from roughly  lines 80-151 of /usr/share/web2py/scripts/

Use setup-web2py-ubuntu-sh to create default and place in  /etc/apache2/sites-available.

a2ensite default
service apache2 restart

Set web2py Admin Password

tail /usr/share/web2py/scripts/

Enter the code in the final stanza:

cd /usr/share/web2py
python -c "from gluon.widget import console; console();"
python -c "from gluon.main import save_password; save_password(raw_input('admin password: '),443)

Post new comment