Changes between Initial Version and Version 1 of UsersWikiPostGIS20CentOS6pgdg


Ignore:
Timestamp:
07/16/12 04:55:22 (12 years ago)
Author:
mwtoews
Comment:

start page

Legend:

Unmodified
Added
Removed
Modified
  • UsersWikiPostGIS20CentOS6pgdg

    v1 v1  
     1= How to install PostGIS 2.0 on CentOS 6 from packages =
     2
     3This installation method uses YUM packages maintained by Devrim GUNDUZ of the PostgreSQL Global Develompent Group (PGDG). For an overview of installing PostgreSQL using this method, see other details at http://wiki.postgresql.org/wiki/YUM_Installation.
     4
     5As of July 2012, additional packages from [http://fedoraproject.org/wiki/EPEL EPEL] 6 (Extra Packages for Enterprise Linux) are required to fulfill requirements for GDAL. These packages may be included as part of PGDG in future relese.
     6
     7== Configure YUM ==
     8
     9Log into the system with root access. These instructions assume that you are using a command-line editor `vi`, however use whatever text utility you are comfortable with.
     10
     11Open the first file for editing:
     12{{{
     13vi /etc/yum.repos.d/CentoOS-Base.repo
     14}}}
     15
     16On line 19, at the end of the `[base]` section, insert:
     17{{{
     18exclude=postgresql*
     19}}}
     20
     21and near line 28 at the end of the `[updates]` section, insert again:
     22{{{
     23exclude=postgresql*
     24}}}
     25
     26Save and close the file (with `vi`, press "esc" to go to command-mode, then type `:wq`).
     27
     28== Download and install PGDG RPM file ==
     29
     30A PGDG RPM file needs to be downloaded for your platform and your PostgreSQL version requirements (you can choose the later). Find the correct RPM file for your system from here: http://yum.postgresql.org/repopackages.php
     31
     32For example, if you have a 64-bit OS and want to install PostgreSQL 9.1:
     33{{{
     34curl -O http://yum.postgresql.org/9.1/redhat/rhel-6-x86_64/pgdg-centos91-9.1-4.noarch.rpm
     35rpm -ivh pgdg-centos91-9.1-4.noarch.rpm
     36}}}
     37
     38Currently, as second repository EPEL 6, is required for additional packages for GDAL. For all platforms, download the `epel-release-6-7.noarch` file from http://download.fedoraproject.org/pub/epel/6/i386/repoview/epel-release.html which will select your local mirror. Install the RPM:
     39{{{
     40rpm -ivh epel-release-6-7.noarch
     41}}}
     42
     43== Install PostGIS ==
     44
     45Install everything with:
     46{{{
     47yum install postgresql91-server postgis2_91
     48}}}
     49
     50Now perform a few post-installation setup commands, in the order: (1) Initialize the database cluster (required), (2) start database (recommended, if you want to use it straight away), (3) allow it to start-up automatically on reboot (recommended):
     51{{{
     52service postgresql-9.1 initdb
     53service postgresql-9.1 start
     54chkconfig postgresql-9.1 on
     55}}}
     56
     57== Spatially enabling a database ==
     58Spatially enabling a database using extensions is a new feature of PostgreSQL 9.1.
     59
     60Connect to your database using pgAdmin or psql, and run the following commands. To add postgis with raster support:
     61{{{
     62CREATE EXTENSION postgis;
     63}}}
     64
     65To add topology support, a second extension can be created on the database:
     66{{{
     67CREATE EXTENSION postgis_topology;
     68}}}