Centos6.3 下安装postgresql9.1.5和postgis1.5.5(左脑版)
来源:互联网 发布:云米净水器怎么样 知乎 编辑:程序博客网 时间:2024/05/17 08:36
2012年9.9日整理一下最新版本的安装,希望可以在此记录下来,以后可以看看,
左脑:山西农业大学
1、安装centos6.3 desktop
2、卸载自带的openjdk
java -vsesion
rpm -qa | grep java
rpm -e --nodeps ..........
3、创建用户 postgres
# groupadd postgres
# useradd -g postgres postgres
///////////////////////////
yum install gcc 从软件仓库下载gcc,然后安装,这个是编译器
yum install make 安装make,这个是自动编译源码的工具,写好makefile就可以方便编译
yum install kernel-headers 安装内核头文件,编译内核,驱动必要的头文件
yum install kernel-devel 同上
//////////////////////////////
4、安装proj包
#tar -zvxf proj-4.8.0.tar.gz
#cd proj-4.8.0
#./configure –prefix=/usr/local/proj
#make
#make install
5、安装geos包
#tar xvfj geos-3.2.3.tar.bz2
#cd geos-3.2.3
#./configure –prefix=/usr/local/geos(这里不需要再加其他参数,配置结果出现3个false,也不要紧)
#make
#make install
6、安装postgresql 包
#tar –zvxf postgresql-9.1.5.tar.gz
#cd postgresql-9.1.5
#./configure –prefix=/usr/local/pgsql
#make
#make install
这样在/usr/local就生成了个pgsql目录
7、添加环境变量
编辑 vi /etc/profile
PATH=$PATH:$HOME/bin
export PATH
PATH=$PATH:$HOME/bin
PGSQL_HOME=/usr/local/pgsql
PATH=$PATH:$PGSQL_HOME/bin
PROJ_HOME=/usr/local/proj
GEOS_HOME=/usr/local/geos
PATH=$PATH:$PROJ_HOME/bin:$GEOS_HOME/bin
LD_LIBRARY_PATH=$PGSQL_HOME/lib:$PROJ_HOME/lib:$GEOS_HOME/lib
export PATH
export PGSQL_HOME
export PROJ_HOME
export GEOS_HOME
export LD_LIBRARY_PATH
8、#mkdir /usr/local/pgsql/data
#cd /usr/local
把pgsql目录交给postgres
#chown -R postgres:postgres pgsql
su - postgres
#initdb –D /usr/local/pgsql/data
9、配置pg_hba.conf、postgresql.conf
在pg_hba.conf 后面加 host all all 192.168.56.0/24 trust
将postgresql.conf文件中的#listen_address=’localhost’改为listen_address=’*’
将postgresql.conf文件中的#port=5432改为port=5432
10、设置postgresql启动
拷贝安装包下面的
..../contrib/start-scripts/linux 到/etc/init.d/ 目录下
如: cp linux /etc/init.d/postgis
chmod a+x /etc/init.d/postgis
chown –R postgres:postgres /etc/init.d/postgis
这里也可以编辑这个启动文件,如配置各种路径。
最后将该项加入到系统启动里chkconfig --add postis
11、运行setup 在系统服务里确保postgis开机启动
12、安装postgis包
#tar -zvxf postgis-1.5.5.tar.gz
#cd postgis-1.5.5
#LDFLAGS=-lstdc++
#./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
#make
#make install
13、拷贝pgsql/share/contrib/postgis-1.5 到/home/postgres/下
14、重新启动系统
15、登陆系统
16、su - postgres
17、createdb demogis
18、psql -d demogis -f postgis-1.5/postgis.sql
19、psql -d demogis -f postgis-1.5/spatial_ref_sys.sql
20、修改数据库用户密码
- Centos6.3 下安装postgresql9.1.5和postgis1.5.5(左脑版)
- 在Ubuntu12.04上安装postgresql9.1和postgis1.5
- 在Ubuntu12.04上安装postgresql9.1和postgis1.5
- Centos6.x安装postgresql9.3
- CentOS7下安装postgresql9.3+
- Postgresql9.3安装和使用
- centos6.6下编译安装PostgreSQL9.4.1、配置phppgadmin
- centos6.5下postgresql9.4.3安装与配置
- centos6.6下编译安装PostgreSQL9.4.1、配置phppgadmin
- Centos6.5下用postgresql9.4.3源码安装
- centos6.5 安装postgresql9.4
- CentOS6.x安装Postgresql9.6
- centos6.5 安装postgresql9.4
- CentOS6.5+PostgreSQL9.5安装参考
- CentOS6使用YUM安装Postgresql9.4
- centos6.5下postgresql9.4.3同步流复制的standby安装与配置
- centos7下postgresql9.6安装
- postgresql9.5 安装配置和使用(on centos7)
- hudson自动构建时 undeploy tomcat 报错
- 回答离职原因时的六大忌
- C++编程规范(101条规则、准则与最佳实践)
- 12 Interesting C Interview Questions and Answers
- DOM、SAX解析xml文档
- Centos6.3 下安装postgresql9.1.5和postgis1.5.5(左脑版)
- 音乐播放器 c语言版
- 使用CDI规范中的@Named标注jsf bean时,引发null问题的解决
- Android实现任务管理器
- hdu 4287 Intelligent IME
- Windows Server 2008 R2无线网卡不可用解决办法
- Android gallery回收可见区之外的图内存 outofmemery 内存溢出 回收
- 程序猿们!放松一下
- [android]浅谈android的selector,背景选择器