Wechat: yu389741| Email: gisdqy@163.com

Shop:https://www.giserdqy.com/shop

postgreSQL和postGis安装笔记


1.PostgreSQL安装配置

    1)所需安装包:

PostgreSQL-8.2.6.tar.gz

Proj-4.6.0.tar.gz

Geos-3.0.0.tar.bz2

Postgis-1.3.2.tar.gz

    2)首先安装PostgreSQL

#tar zxvf postgresql-8.2.6.tar.gz

#cd postgresql-8.2.6

#./configure –prefix=/usr/local/pgsql

#make

#make intal

    3)Proj的安装:

#tar zxvf proj-4.6.0.tar.gz

#cd proj-4.6.0

#./configure –prefix=/usr/local/proj

#make;make install

    4)Geos的安装

#tar zxvf geos-3.0.0.tar.bz2

#cd geos-3.0.0

#./configure –prefix=/usr/local/geos

#make;make install

    5)Postgis的安装

#tar zxvf postgis-1.3.2.tar.gz

#cd postgis-1.3.2

#LDFLAGS=-lstdc++ ./configure –prefix=/user/local/postgis –with-pgsql=/usr/local/pgsql/bin/pg_config –with-proj=/usr/local/proj –with-proj-libdir=/usr/local/proj/lib –with-geos=/usr/local/geos/bin/geos-config –with-geos-libdir=/usr/local/geos/lib

#make;make install


  2.环境变量配置

    1)#vi ~/.bash_profile

    2)增加环境变量:

PGLIB=/usr/local/pgsql/lib
PGDATA
=$HOME/pgsql_data
PGSQL_HOME
=/usr/local/pgsql
PROJ_HOME
=/usr/local/proj
GEOS_HOME
=/usr/local/geos
POSTGIS_HOME
=/usr/local/postgis
LD_LIBRARY_PATH
=$PGSQL_HOME/lib:$PROJ_HOME/lib:$GEOS_HOME/lib:$POSTGIS_HOME/lib
MANPATH
=$MANPATHH.GBK
export PGLIB PGDATA PGSQL_HOME PROJ_HOME GEOS_HOME POSTGIS_HOME LD_LIBRARY_PATH

 

转载自:https://blog.csdn.net/sinboy/article/details/2482661