webfaction python2.5 -> python2.6

98 views
Skip to first unread message

olivier

unread,
May 6, 2011, 10:24:02 AM5/6/11
to web2py-users
hi there,

I have an old installation of web2py on webfaction. It is using
mod_wsgi 2.5 and Python 2.5.4
How can I a upgrade to python 2.6? (I need it for some modules I plan
to use)
Should I start a new installation from scratch or is there a simpler
way to migrate to mod_wsgi 3.3 and Python 2.6?

Thanks in advance!

pbreit

unread,
May 6, 2011, 11:30:31 AM5/6/11
to web...@googlegroups.com
Is this what you want?

http://docs.webfaction.com/software/python.html

  1. Open an SSH session.
  2. Open ~/.bash_profile in a text editor.
  3. On a new line, add alias python=pythonX.Y where X.Y is the Python version number. For example, to use Python 2.6 by default, add a new line containing alias python=python2.6.
  4. Save and close the file.
  5. Reload ~/.bash_profile. Enter source ~/.bash_profile and press Enter

I always like to start from scratch if I can!


Vasile Ermicioi

unread,
May 6, 2011, 12:29:30 PM5/6/11
to web...@googlegroups.com
I also use webfaction : python2.7 + uwsgi + nginx

if you like and need help with that configuration...

robsan

unread,
May 6, 2011, 1:46:50 PM5/6/11
to web2py-users
I'd appreciate if you could share your insight on that configuration,
as I'm currently using Apache and would like to slim down the setup.

Vasile Ermicioi

unread,
May 6, 2011, 2:07:09 PM5/6/11
to web...@googlegroups.com
I guess you can use nginx 1.0.1, but I send you what I did and I know that it works

[nginx] 
tar xvxf nginx-0.8.54.tar.gz
cd nginx-0.8.54
./configure \
  --prefix=/home/yourusername/nginx \
  --sbin-path=/home/yourusername/nginx/sbin/nginx \
  --conf-path=/home/yourusername/nginx/nginx.conf \
  --error-log-path=/home/yourusername/nginx/log/nginx/error.log \
  --pid-path=/home/yourusername/nginx/run/nginx/nginx.pid  \
  --lock-path=/home/yourusername/nginx/lock/nginx.lock \
  --with-http_ssl_module \
  --with-http_flv_module \
  --with-http_gzip_static_module \
  --http-log-path=/home/yourusername/nginx/log/nginx/access.log \
  --http-client-body-temp-path=/home/yourusername/nginx/tmp/nginx/client/ \
  --http-proxy-temp-path=/home/yourusername/nginx/tmp/nginx/proxy/ \
  --http-fastcgi-temp-path=/home/yourusername/nginx/tmp/nginx/fcgi/

[web2py]
unzip web2py_src.zip  
python2.7 web2py.py #seems needed before using it
  
  
[uwsgi]
tar xvzf uwsgi-0.9.7.tar.gz
cd uwsgi-0.9.7
make -f Makefile.Py27
mv uwsgi /home/yourusername/bin

#start uwsgi
uwsgi -s /home/yourusername/tmp/uwsgi.sock --pythonpath /home/yourusername/web2py --module wsgihandler -d /home/yourusername/tmp/uwsgi.log -t 20 --async 51 --ugreen --limit-as 64 -r --no-orphans 

[memory usage]
ps -u yourusername -o rss,command
  
nginx_webfaction.conf

robsan

unread,
May 7, 2011, 9:52:06 AM5/7/11
to web2py-users
Thanks Vasile, I will give it a go.

jbrown

unread,
Jun 8, 2011, 9:05:09 PM6/8/11
to web2py-users
I used the same installation as olivier, which is causing my modules
(installed with easy_install-2.6) not to be located when I try to run
my application. I've tried changing my .bash_profile per the
webfaction instructions to change the default python version. Same
problem, modules aren't found and in the error ticket, the python
version shows as: Python 2.5.4: /usr/local/bin/python

I don't know how it's finding this version, though I do know that the
installer I used created the webfaction app as "mod_wsgi 2.5/Python
2.5". Any suggestions?
Reply all
Reply to author
Forward
0 new messages