how to upgrade web2py on turnkey linux

94 views
Skip to first unread message

xmarx

unread,
Feb 4, 2016, 3:19:58 PM2/4/16
to web2py-users
i install web2py on hub.turnkeylinux.org. web2py version is 2.12.3. when i upgrade web2py application admin gives an error but i can't see error page. from then, i can't do anything with web2py admin interface. i message to turnkeylinux support center but they haven't reply yet. so i have few questions. some of them are not about web2py, but if you help, i will be glad you.

1. how can access server via ftp. so able to install up to date web2py by hand.
2. how can i display turnkey servers on my amazon aws account.


Willoughby

unread,
Feb 5, 2016, 8:07:06 AM2/5/16
to web2py-users
You might try their support forum: https://www.turnkeylinux.org/forum/support

Stuart Rolinson

unread,
Feb 5, 2016, 8:11:08 PM2/5/16
to web2py-users
The issue is due to a conflict with turnkey server and the git.py module.  This needs to be disabled once the upgrade has been done, you may have a script called upgrade-web2py in the root users home folder which should fix this, but if not I have included the contents of the script below.


#!/bin/sh -ex


dl() {

    [ "$FAB_HTTP_PROXY" ] && PROXY="--proxy $FAB_HTTP_PROXY"

    cd $2; curl -L -f -O $PROXY $1; cd -

}


SRC=/usr/local/src

W2PPASS=turnkey

W2PROOT=/var/www/web2py


# download and unpack web2py

dl http://www.web2py.com/examples/static/web2py_src.zip $SRC

unzip $SRC/web2py_src.zip -d $(dirname $W2PROOT)

rm $SRC/web2py_src.zip

chown -R www-data:www-data $W2PROOT


# copy wsgihandler to web2py root

cp $W2PROOT/handlers/wsgihandler.py $W2PROOT/wsgihandler.py


# workaround turnkey-pylib git.py conflict

CONF=$W2PROOT/applications/admin/controllers/default.py

ERR="disabled git import due to turnkey-pylib conflict"

sed -i "s|import git|# import git\n    raise ImportError('$ERR')|" $CONF


# create web2py admin interface password

/usr/lib/inithooks/bin/web2py.py --pass=$W2PPASS


# configure apache

a2dissite 000-default

a2ensite web2py

a2enmod rewrite

Jeremy Davis

unread,
Feb 22, 2016, 9:07:56 AM2/22/16
to web2py-users
Hi Stuart,

FYI I'm a TurnKey dev.

That script is awesome. I just tested it on our v14.0 appliance and it works a treat! :) It doesn't currently exist in the TurnKey web2py appliance but IMO it should! Do you mind if I add it to the appliance?

Is this script is only relevant to a new install (with no custom program/data/etc)? Or could it be used to update an existing web2py site?

I ask because I'm not very familiar with web2py and would like to include your script but I need to know what sort of warning message I might need to add to it!?

Regards,
Jeremy Davis
TurnKey Linux
Reply all
Reply to author
Forward
0 new messages