mkdir -p ~/bin ~/lib/python2.6/site-packages
Configure the environment by putting something like this in your
.bashrc
and sourcing it:export CFLAGS=-I/usr/local/pgsql/include export LDFLAGS=-L/usr/local/pgsql/lib export LD_LIBRARY_PATH=$HOME/lib:$LD_LIBRARY_PATH export PATH=/usr/local/pgsql/bin:$PATH export PYTHONPATH=$HOME/lib/python2.6/:$HOME/lib/python2.6/site-packages/ source ~/bin/virtualenvwrapper_bashrc source ~/share/git-core/git-completion.bash
Install Git:
curl -O http://kernel.org/pub/software/scm/git/git-1.6.5.3.tar.bz2 tar -jxf git-1.6.5.3.tar.bz2 cd git-1.6.5.3 ./configure && make install mv contrib/completion/git-completion.bash ~/share/git-core/ source ~/share/git-core/git-completion.bash
Configure a local Python 2.6 environment:
easy_install-2.6 --prefix=$HOME distribute easy_install-2.6 --prefix=$HOME pip pip install --install-option="--prefix $HOME/" virtualenv virtualenvwrapper
mkvirtualenv --no-site-packages my_project
Assuming your environment is configured correctly (see above) normal commands like
pip install psycopg2
will work at this point.TODO: Install mod_wsgi for the WebFaction apache using their compilation flags - need to test docs on this but it avoids custom building Apache just to bump the Python version from 2.5 to 2.6.
pip install python-memcached
Create a local app following the well-hidden instructions
Create a script like this, taking care to replace
<PORT_NUMBER_FROM_APP_PANEL>
with the actual number:#!/bin/bash PID_FILE=/home/acdha/webapps/memcached/memcached.pid if [ -f "$PID_FILE" ]; then cat $PID_FILE | xargs --no-run-if-empty kill -0 && exit fi memcached -d -P "$PID_FILE" -l 127.0.0.1 -m 32 -p <PORT_NUMBER_FROM_APP_PANEL> echo "Started memcached as `cat $PID_FILE`"
Create a cron job like this (e.g. using
crontab -e
) to restart memcached if it crashes or something kills it:*/5 * * * * /home/acdha/webapps/memcached/memcached_autostart.sh