1.系统环境: CentOS5.0 2.需要的软件包: postgresql-8.3.7.tar.gz geos-3.1.0.tar.bz2 proj-4.6.1.tar.gz postgis-1.3.5.tar.gz 3.编译安装源码: PostgreSQL 的安装 #tar zxvf postgresql-8.3.7.tar.gz #cd postgresql-8.3.7 #./configure --prefix=/usr/local/pgsql #gmake #su #gmake install #adduser postgres #mkdir /usr/local/pgsql/data #chown postgres /usr/local/pgsql/data #su - postgres #/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data #/usr/local/pgsql/bin/postgres -D /usr/local/pgsql/data >logfile 2>&1 & Proj 的安装 #tar zxvf proj-4.6.1.tar.gz #cd proj-4.6.1 #./configure --prefix=/usr/local/proj #make && make install geos的安装 #tar jxvf geos-3.1.0.tar.bz2 #cd geos-3.1.0 #./configure --prefix=/usr/local/geos #make && make install postgis的安装 #tar zxvf postgis-1.3.5.tar.gz #cd postgis-1.3.5 #LDFLAGS=-lstdc++ ./configure --prefix=/usr/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 4.配置环境变量: # su - postgres $vim .bash_profile
引用
PATH=$PATH:/usr/local/pgsql/bin 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 |