Here is an installation guide for PostgreSQL with the PostGIS extensions.
Like the related PostgreSQL Install Guide, you still need to create a new Custom Application (listening on port) in the control panel called "pgport" to reserve a port. Enter it as a shell variable:
You can run these commands individually, or you can paste them into a shell script and run it as
| bash build_psql.sh | tee build_psql.log
|
Either way, you may want to run it in a screen session.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80 | #!/bin/bash
mkdir -p $HOME/bin $HOME/lib $HOME/src $HOME/tmp
export TMPDIR=$HOME/tmp
export PATH="$HOME/bin:$PATH"
export C_INCLUDE_PATH="$HOME/include:$C_INCLUDE_PATH"
export LIBRARY_PATH="$HOME/lib:$LIBRARY_PATH"
export LD_LIBRARY_PATH="$HOME/lib:$LD_LIBRARY_PATH"
############################################################
# CARTODB COMPLETE INSTALL - DEPENDENCIES & INSTALL PRIORITY
############################################################
# PROGRAM: VERSION: NOTES:
# ----------------------------------------------------------
# GDAL (1.9.0) http://download.osgeo.org/gdal/gdal-1.9.0.tar.gz
# GEOS (3.3.1) http://download.osgeo.org/geos/geos-3.3.1.tar.bz2
# Postgres (9.1.x) http://www.postgresql.org/ftp/source/v9.1.3/
# PostGIS (2.0) http://postgis.refractions.net/download
############################################################
# GDAL (1.9.0)
# http://download.osgeo.org/gdal/gdal-1.9.0.tar.gz
############################################################
cd ~/src
wget http://download.osgeo.org/gdal/gdal-1.9.0.tar.gz
tar -xzf gdal-1.9.0.tar.gz
cd gdal-1.9.0
./configure --prefix=$HOME
make # 15m
#make check
make install
############################################################
# GEOS (3.3.1)
# http://download.osgeo.org/geos/geos-3.3.1.tar.bz2
############################################################
cd ~/src
wget http://download.osgeo.org/geos/geos-3.3.1.tar.bz2
tar -xjf geos-3.3.1.tar.bz2
cd geos-3.3.1
CFLAGS="-m64 $CFLAGS" CPPFLAGS="-m64 $CPPFLAGS" CXXFLAGS="-m64 $CXXFLAGS" \
FFLAGS="-m64 $FFLAGS" LDFLAGS="-m64 -L$HOME/lib -L/usr/lib64/ $LDFLAGS" \
./configure --prefix=$HOME
make # 4m 20s
#make check
make install
############################################################
# Postgres (9.1.3)
# http://www.postgresql.org/ftp/source/v9.1.3/
############################################################
cd ~/src
wget http://ftp.postgresql.org/pub/source/v9.1.3/postgresql-9.1.3.tar.gz
tar -xzf postgresql-9.1.3.tar.gz
cd postgresql-9.1.3
CPPFLAGS="-I$HOME/include $CPPFLAGS" LDFLAGS="-L$HOME/lib -L/usr/lib64/ $LDFLAGS" \
./configure PYTHON="${PYTHON}" --prefix=$HOME --with-pgport=$PGPORT --with-python --disable-thread-safety
make # 3m 30s
#make check
make install
############################################################
# PostGIS (1.5.3)
# http://postgis.refractions.net/download
############################################################
cd ~/src
wget http://postgis.refractions.net/download/postgis-1.5.3.tar.gz
tar -xzf postgis-1.5.3.tar.gz
cd postgis-1.5.3
CPPFLAGS="-I$HOME/include $CPPFLAGS" LDFLAGS="-L$HOME/lib -L/usr/lib64/ $LDFLAGS" \
./configure --prefix=$HOME \
--with-gdalconfig=$HOME/bin/gdal-config \
--with-geosconfig=$HOME/bin/geos-config \
--with-jsondir=$HOME \
--with-projdir=$HOME \
--with-pgconfig=$HOME/bin/pg_config
make # 50s
### make check # can't test PostGIS until you have a database with PostGIS installed up and running.
make install
|
Okay, PostgreSQL should now be installed. After installation, you have some manual post-install setup and configuration to do:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 | #####################
# Post Installation #
#####################
# First, make sure that we're using the correct "psql", "createuser", and "createdb" commands:
export PATH="$HOME/bin:$PATH"
hash -r
# Add it to $HOME/.bashrc to make this permanent
echo 'export PATH="$HOME/bin:$PATH"' >> $HOME/.bashrc
# Set up DB location
mkdir $HOME/pgsql
$HOME/bin/initdb -D $HOME/pgsql/data
# Start postgresql server
$HOME/bin/postgres -D $HOME/pgsql/data >> $HOME/pgsql/log 2>&1 &
# Create the 'postgres' superuser
createuser -s postgres -P
# Create a database 'mydb'
createdb 'mydb'
# Now, connect to it (Use Ctrl-D to exit)
psql -U postgres mydb
|
Hope that helps!
answered
Aug 16 '12 at 00:15
ryans ♦♦
2841●1●4●20
Hi, I do need proj4 in order to install GeoDjango. Is it possible to use Webfaction provided PostgreSQL + PostGIS and have my own proj4 installation,say, on $HOME/lib ? I really prefer to use yours managed server instead of mine :-)
Or is there other way to have GeoDjango installed?
Thanks,
Mário
PROJ is already installed on our servers, here are the current specs for the CentOS 6 machine using SELECT PostGIS_full_version();
If you need a different version of PROJ, you will need to install your own version PostgreSQL and PostGIS.
wow! I think this is enough! I'll open a ticket to get a postgis enabled database and start the tests.
Thanks Mário