安装 postgresql + proj + geos + postgis
来源:互联网 发布:云计算技术与应用课程 编辑:程序博客网 时间:2024/05/20 05:56
环境 centos 5.4 / 5.5
安装包:
1)、postgresql-8.4.13.tar.gz
2)、proj-4.7.0.tar.gz
3)、geos-3.2.3.tar.bz2
4)、postgis-1.5.1.tar.gz
把这几个文件上传到/root目录下
1、 新建个用户组,及用户
# groupadd postgres
# useradd postgres
# passwd postgres //设置密码为postgres
2、 安装上面的几个安装包
1)安装postgresql包
#tar –zvxf postgresql-8.4.13.tar.gz
#cd postgresql-8.4.13
#./configure –prefix=/usr/local/pgsql
#make
#make install
这样在/usr/local就生成了个pgsql目录
继续
#mkdir /usr/local/pgsql/data
#cd /usr/local
把pgsql目录交给postgres
#chown -R postgres:postgres pgsql
postgressql初始化
#su postgres
#cd /usr/local/pgsql/bin
#./initdb –D /usr/local/pgsql/data
配置postgresql文件
#vi /usr/local/pgsql/data/pg_hba.conf
在最后面加上
host all all 192.168.10.1/24 md5 //加这个行表示192.168.10.*的用户必须以密码方式登录
#vi /usr/local/pgsql/data/postgresql.conf
找到#listen_address=’localhost’
修改为listen_address=’*’
修改#port=5432为port=5432
修改#password =on 为password =on
这样就Ok了
下面开始设置用service postgresql start启动(如果没有的话,必须跳到目录启动)
#cd /root/postgresql-8.4.13/contrib/start-scripts
#cp linux /etc/init.d/
#chmod a+x /etc/init.d/postgresql
#chown –R postgres:postgres /etc/init.d/postgresql
#vim /etc/profile
加入下面几句
export PGSQL_HOME =/usr/local/pgsql
export PATH=$PATH:$PGSQL_HOME/bin
export PROJ_HOME=/usr/local/proj
export GEOS_HOME=/usr/local/geos
export LD_LIBRARY_PATH = $PGSQL_HOME/bin:$PROJ_HOME/bin:$GEOS_HOME/bin
2)安装proj包
#tar -zvxf proj-4.7.0.tar.gz
#cd proj-4.7.0
#./configure –prefix=/usr/local/proj
#make
#make install
3)安装 geos包
#tar xvfj geos-3.2.3.tar.bz2
#cd geos-3.2.3
#./configure –prefix=/usr/local/geos
#make
#make install
*注意如果coufigure出现g++ not found
就必须安装g++
连网情况下可以yum install g++
如果没有连网,可以先查下系统gcc的版本
#rpm –qa | grep gcc
然后去下载gcc-c++安装包
4)、安装 postgis包
#tar -zvxf postgis-1.5.1.tar.gz
#cd postgis-1.5.1
#./configure --prefix=/usr/local/postgis --with-pgconfig=/usr/local/pgsql/bin/pg_config --with-projdir=/usr/local/proj --with-geosconfig=/usr/local/geos/bin/geos-config
*注意configure成功时会出现
Geos config : /usr/local/
Postgresql config
Proj4
Libxml2 config
等字样然后接着往下
(postgis编译过程中出错
configure: error: could not find xml2-config from libxml2 within the current path. You may need to try re-running configure with a --with-xml2config parameter)
就是缺少libxml2
rpm -ivh zlib-devel-1.2.3-25.el6.i686.rpm
rpm -ivh libxml2-devel-2.7.6-1.el6.i686.rpm
#make
#make install
成功之后在/usr/local/pgsql/share/contrib/postgis-1.5
重启电脑
#service iptables stop
#su postgres
#service postgresql start
start ok
#createdb postgis
#psql postgis
postgis#=alter user postgres with password ‘postgres’;
postgis#=\q
5)新建个模版
#createdb template_postgis
#createlang plpgsql template_postgis
#cd /usr/local/pgsql/share/contrib/postgis-1.5
#psql –d template_postgis –f postgis.sql
#psql –d template_postgis –f spatial_ref_sys.sql
- 安装 postgresql + proj + geos + postgis
- postgresql , postgis 安装
- PostgreSQL/PostGIS安装
- Mac安装PostgreSQL/PostGIS
- PostgreSql+PostGIS的安装
- GDAL+PROJ+GEOS编译说明
- postgreSQL和postGis安装笔记
- ubuntu安装postgresql与postgis
- linux + postgresql + postgis 源码 安装
- postgresql和postgis的安装
- ubuntu安装postgresql与postgis
- 安装postgresql+postgis记录,以及导入SHP到postgis中
- postgresql+postgis
- PostgreSQL 8.2.5 + PostGIS 1.3.1 安装
- postgreSQL和postGis安装和启动问题
- Win 7 安装 PostgreSQL postgis记录
- liunx环境下源码安装PostgreSQL+PostGIS
- Debian 7 安装postgresql 和 postGis
- 1040 凑表达式
- java 解析xml
- 对Java接口和抽象类的认识及分析
- 过滤select列表
- UIView的clipsToBounds属性
- 安装 postgresql + proj + geos + postgis
- jQuery实现可移动(draggable)和可缩放(sizable)网页元素
- 保护iPhone应用程序中的资源文件
- STL remove 和容器的成员函数erase
- linux inotify 研究7
- pyinstaller使用
- C/C++数组名与指针区别深入探索
- IIS/Apache/lighttpd设置内容过期方法(缓存)
- JVM内存溢出的方式