Running web2py in cheap shared hosts

78 views
Skip to first unread message

mdipierro

unread,
Sep 22, 2010, 10:43:06 AM9/22/10
to web2py-users
A problem in running web2y on shared hosts is that most of them run
CentOS and CentOS ships with Python 2.4. Python 2.4 misses some
modules that are required by web2py and you need root access to
install them.

Another solution is using virtualenv. I seems it is possible to
download and run virtualenv without being root and it is possible to
use it to easy_intall the missing 2.4 modules thanks to a module
called distribute.

I wrote a simple script that does this automatically.

Please help me test it?

If you have an account on a cheap shared web-hosting provider that
only provides Python 2.4 just do the following:

wget http://web2py.googlecode.com/hg/scripts/setup-virtualenv-web2py.sh
chmod +x setup-virtualenv-web2py.sh
./setup-virtualenv-web2py.sh

It should download web2py, virtualenv, create the environment you need
and start web2py on localhost.

bally boy

unread,
Sep 22, 2010, 11:08:42 AM9/22/10
to web...@googlegroups.com
But Massimo, cant one just compile and install python 2.5 or 2.6 on it rather than relying on virtual env. I had once tried installing pylons on Dreamhost and had to do the same. It was a shared host as well. 

mdipierro

unread,
Sep 22, 2010, 11:20:19 AM9/22/10
to web2py-users
yes.

On Sep 22, 10:08 am, bally boy <ballybo...@gmail.com> wrote:
> But Massimo, cant one just compile and install python 2.5 or 2.6 on it
> rather than relying on virtual env. I had once tried installing pylons on
> Dreamhost and had to do the same. It was a shared host as well.http://vivek40.blogspot.com/2010/07/pylons-on-dreamhost.html
> <http://vivek40.blogspot.com/2010/07/pylons-on-dreamhost.html>
>
> On Wed, Sep 22, 2010 at 8:13 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:
> > A problem in running web2y on shared hosts is that most of them run
> > CentOS and CentOS ships with Python 2.4. Python 2.4 misses some
> > modules that are required by web2py and you need root access to
> > install them.
>
> > Another solution is using virtualenv. I seems it is possible to
> > download and run virtualenv without being root and it is possible to
> > use it to easy_intall the missing 2.4 modules thanks to a module
> > called distribute.
>
> > I wrote a simple script that does this automatically.
>
> > Please help me test it?
>
> > If you have an account on a cheap shared web-hosting provider that
> > only provides Python 2.4 just do the following:
>
> > wgethttp://web2py.googlecode.com/hg/scripts/setup-virtualenv-web2py.sh

Nathan Freeze

unread,
Sep 22, 2010, 11:26:23 AM9/22/10
to web...@googlegroups.com

Not if it is jailed shell. DreamHost has full shell.

On Sep 22, 2010 10:20 AM, "mdipierro" <mdip...@cs.depaul.edu> wrote:

yes.


On Sep 22, 10:08 am, bally boy <ballybo...@gmail.com> wrote:

> But Massimo, cant one just compile a...

> On Wed, Sep 22, 2010 at 8:13 PM, mdipierro <mdipie...@cs.depaul.edu> wrote:

> > A problem in runni...

> > wgethttp://web2py.googlecode.com/hg/scripts/setup-virtualenv-web2py.sh

> > chmod +x setup-virtualenv-web2py.sh
> > ./setup-virtualenv-web2py.sh
>
> > It should download we...

mdmcginn

unread,
Sep 22, 2010, 10:42:28 PM9/22/10
to web2py-users
Thanks, Massimo. It partially worked.

wget http://web2py.googlecode.com/hg/scripts/setup-virtualenv-web2py.sh
chmod +x setup-virtualenv-web2py.sh
./setup-virtualenv-web2py.sh
...
HTTP request sent, awaiting response... 200 OK
Length: 1424650 (1.4M) [application/x-gzip]
Saving to: `virtualenv-1.5.1.tar.gz'

100%[======================================>] 1,424,650 269K/s in
5.2s

2010-09-22 22:35:05 (269 KB/s) - `virtualenv-1.5.1.tar.gz' saved
[1424650/1424650]

Archive: virtualenv-1.5.1.tar.gz
End-of-central-directory signature not found. Either this file is
not
a zipfile, or it constitutes one disk of a multi-part archive. In
the
latter case the central directory and zipfile comment will be found
on
the last disk(s) of this archive.
unzip: cannot find zipfile directory in one of
virtualenv-1.5.1.tar.gz or
virtualenv-1.5.1.tar.gz.zip, and cannot find
virtualenv-1.5.1.tar.gz.ZIP, period.
virtualenv-1.5.1/
virtualenv-1.5.1/virtualenv.egg-info/
virtualenv-1.5.1/virtualenv.egg-info/not-zip-safe

...
installing compatibility modules
================================
install_dir /home/mdmcginn/web2py/virtualenv/lib/python2.4/site-
packages/
Searching for pysqlite
Reading http://pypi.python.org/simple/pysqlite/
Reading http://pysqlite.googlecode.com/
Reading http://code.google.com/p/pysqlite/downloads/list
Best match: pysqlite 2.6.0
Downloading http://pysqlite.googlecode.com/files/pysqlite-2.6.0.tar.gz
Processing pysqlite-2.6.0.tar.gz
Running pysqlite-2.6.0/setup.py -q bdist_egg --dist-dir /tmp/
easy_install-UmPbI6/pysqlite-2.6.0/egg-dist-tmp-gsXLY-
unable to execute gcc: Permission denied
error: Setup script exited with error: command 'gcc' failed with exit
status 1
starting web2py
===============
Traceback (most recent call last):
File "web2py.py", line 16, in ?
import gluon.import_all
File "/home/mdmcginn/web2py/gluon/import_all.py", line 110, in ?
raise ImportError, msg
ImportError: Missing dependency: hashlib
Try the following command: easy_install-2.4 -U hashlib
mdmc...@biographiks.com [~]# easy_install-2.4 -U hashlib
-jailshell: easy_install-2.4: command not found


On Sep 22, 9:43 am, mdipierro <mdipie...@cs.depaul.edu> wrote:
> A problem in running web2y on shared hosts is that most of them run
> CentOS and CentOS ships with Python 2.4. Python 2.4 misses some
> modules that are required by web2py and you need root access to
> install them.
>
> Another solution is using virtualenv. I seems it is possible to
> download and run virtualenv without being root and it is possible to
> use it to easy_intall the missing 2.4 modules thanks to a module
> called distribute.
>
> I wrote a simple script that does this automatically.
>
> Please help me test it?
>
> If you have an account on acheapshared web-hosting provider that
> only provides Python 2.4 just do the following:
>
> wgethttp://web2py.googlecode.com/hg/scripts/setup-virtualenv-web2py.sh

mdipierro

unread,
Sep 22, 2010, 11:35:18 PM9/22/10
to web2py-users
grrr. Installing pysqlite requires gcc, installing gcc requires root.

On Sep 22, 9:42 pm, mdmcginn <michael.d.mcgin...@gmail.com> wrote:
> Thanks, Massimo. It partially worked.
>
> wgethttp://web2py.googlecode.com/hg/scripts/setup-virtualenv-web2py.sh
> chmod +x setup-virtualenv-web2py.sh
> ./setup-virtualenv-web2py.sh
> Readinghttp://code.google.com/p/pysqlite/downloads/list
> Best match: pysqlite 2.6.0
> Downloadinghttp://pysqlite.googlecode.com/files/pysqlite-2.6.0.tar.gz
> Processing pysqlite-2.6.0.tar.gz
> Running pysqlite-2.6.0/setup.py -q bdist_egg --dist-dir /tmp/
> easy_install-UmPbI6/pysqlite-2.6.0/egg-dist-tmp-gsXLY-
> unable to execute gcc: Permission denied
> error: Setup script exited with error: command 'gcc' failed with exit
> status 1
> starting web2py
> ===============
> Traceback (most recent call last):
>   File "web2py.py", line 16, in ?
>     import gluon.import_all
>   File "/home/mdmcginn/web2py/gluon/import_all.py", line 110, in ?
>     raise ImportError, msg
> ImportError: Missing dependency: hashlib
> Try the following command: easy_install-2.4 -U hashlib
> mdmcg...@biographiks.com [~]# easy_install-2.4 -U hashlib
Reply all
Reply to author
Forward
0 new messages