# install python dependencies
yum -y update
yum groupinstall -y 'development tools'
yum install -y zlib-devel bzip2-devel openssl-devel xz-libs wget

# download python
wget http://www.python.org/ftp/python/2.7.6/Python-2.7.6.tar.xz
xz -d Python-2.7.6.tar.xz
tar -xvf Python-2.7.6.tar

# Enter the directory:
cd Python-2.7.6

# Run the configure:
./configure --prefix=/usr/local

# compile and install it:
make
make altinstall

# Checking Python version:
[root@nicetry ~]# python2.7 -V
Python 2.7.6



#General Notes
# had to modify the following line in install.py
# INSTALL THE VIRTUAL ENV
# os.system("python%s.%s %s %s" % (sys.version_info[0], sys.version_info[1], os.path.join(virtualenv_dir, 'virtualenv.py'), virtualenv_working_dir))

# had to add location to pg_config to the path like so
PATH = $PATH:/path/to/pg_config  # on CentOs I fount it here /usr/pgsql-9.1/bin/

after setting the path I could run this:
python2.7 install.py  <-- need to call python2.7 explicitly because 2.6 is the default in CentOS




sudo -u postgres psql -d template_postgis_20 -f /usr/pgsql-9.1/share/contrib/postgis-2.0/postgis.sql
sudo -u postgres psql -d template_postgis_20 -f /usr/pgsql-9.1/share/contrib/postgis-2.0/spatial_ref_sys.sql
sudo -u postgres psql -d template_postgis_20 -f /usr/pgsql-9.1/share/contrib/postgis-2.0/rtpostgis.sql


# running ES
# from the bin directory call this:
EX_INCLUDE=elasticsearch.in.sh ./elasticsearch -p pidfile.txt