Monday, August 22, 2011

Spatial Wiki 6 - Install PostGIS

With PostgreSQL installed and setup it's time to add spatial capabilities by installing PostGIS.  This is easily accomplished by running:
sudo apt-get install postgresql-8.4-postgis

Once installed you need to modify the PostgreSQL file that controls how a user logs in. See more information here:

http://www.depesz.com/index.php/2007/10/04/ident/

At the end of the file you need to change "ident" login types to md5 login types.
sudo vi /etc/postgresql/8.4/main/pg_hba.conf

For example this is before:
# Database administrative login by UNIX sockets
local   all         postgres                          ident

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               ident

# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5

And this is what it should look like after:
# Database administrative login by UNIX sockets
local   all         postgres                          md5

# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               md5

# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5

When the changes are complete restart PostgreSQL with:
sudo /etc/init.d/postgresql-8.4 restart

See the next article on Setting up the Spatial Database.


0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home