`

Linux centos6.3 安装postgres9.2.4 postgis2.0.3

 
阅读更多
1. 安装postgres + postgis:


[pgsql安装]
tar xvzf postgresql-9.2.4.tar.gz

cd postgresql-9.2.4

#./configure --prefix=/mapbar/app/pgsql

make
make install

groupadd postgres
useradd postgres  -g postgres
mkdir -p /mapbar/app/pgsql/data
chown -R postgres /mapbar/app/pgsql/

su  postgres #都需要使用这个登陆执行语句
# 初始化pgsql数据库
出现:
Encoding "GB18030" is not allowed as a server-side encoding


/mapbar/app/pgsql/bin/initdb -D /mapbar/app/pgsql/data  --local=zh_CN.UTF8 

vi /mapbar/app/pgsql/data/pg_hba.conf 
host    all         all         0.0.0.0/0      trust

vi /mapbar/app/pgsql/data/postgresql.conf
listen_addresses = '*'  

手动启动:
( /mapbar/app/pgsql/bin/postgres -D /mapbar/app/pgsql/data)
/mapbar/app/pgsql/bin/pg_ctl  start -D /mapbar/app/pgsql/data/


root下:
1. 先安装Proj4和GEOS

1.1. 安装Proj-4.6.0
# tar zvxf proj-4.6.0.tar.gz
# cd proj-4.6.0
# ./configure --prefix=/mapbar/app/proj4  
# make
# make install


1.2. 安装geos-3.4.2.tar.bz2
# tar jxvf geos-3.4.2.tar.bz2
# cd geos-3.4.2
# ./configure --prefix=/mapbar/app/geos3   
# make
# make install



1.3  
tar xvzf gdal-1.9.2.tar.gz
cd gdal-1.9.2
 ./configure --prefix=/mapbar/app/gdal
make 
make install


1.4
tar xvzf  json-c-0.9.tar.gz
cd json-c-0.9
./configure --prefix=/mapbar/app/jsonc
make 
make install


1.5
postgis-2.0.3

2. 安装ppostgis-2.0.3.tar.gz

# tar xvzf postgis-2.0.3.tar.gz
# cd postgis-2.0.3
# ./configure --prefix=/mapbar/app/postgis --with-pgconfig=/mapbar/app/pgsql/bin/pg_config --with-projdir=/mapbar/app/proj4 --with-geosconfig=/mapbar/app/geos3/bin/geos-config --with-gdalconfig=/mapbar/app/gdal/bin/gdal-config --with-jsondir=/mapbar/app/jsonc 
(设置安装位置为/opt/postgis,并且使用Proj4与GEOS3)

# make
# make install


root 下:
增加动态链接库:
 vi /etc/ld.so.conf

/mapbar/app/lib
/mapbar/app/proj4/lib
/mapbar/app/geos3/lib
/mapbar/app/pgsql/lib
然后运行ldconfig使刚加入的库路径生效:
# /sbin/ldconfig

su postgres:
/mapbar/app/pgsql/bin/createdb template_postgis_20

******************************
createdb: could not connect to database postgres: could not connect to server: 没有那个文件或目录
        Is the server running locally and accepting
        connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
没启动服务的错
******************************

/mapbar/app/pgsql/bin/createlang plpgsql template_postgis_20


su root:
    
ln -sn /mapbar/app/geos3/lib/libgeos_c.so.1.8.2    /usr/lib64/libgeos_c.so.1
ln -sn /mapbar/app/jsonc/lib/libjson.so.0.0.1      /usr/lib64/libjson.so.0
ln -sn /mapbar/app/gdal/lib/libgdal.so.1.16.2     /usr/lib64/libgdal.so.1
ln -sn /mapbar/app/proj4/lib/libproj.so.0.5.4      /usr/lib64/libproj.so.0

su postgres:

/mapbar/app/pgsql/bin/psql -d template_postgis_20 -f /mapbar/app/pgsql/share/contrib/postgis-2.0/postgis.sql
/mapbar/app/pgsql/bin/psql -d template_postgis_20 -f /mapbar/app/pgsql/share/contrib/postgis-2.0/spatial_ref_sys.sql
/mapbar/app/pgsql/bin/psql -d template_postgis_20 -f /mapbar/app/pgsql/share/contrib/postgis-2.0/postgis_upgrade_20_minor.sql

设置用户的密码:

vi /mapbar/app/pgsql/data/pg_hba.conf 
host    all         all         0.0.0.0/0      password

/mapbar/app/pgsql/bin/psql postgres  

alter user postgres with password '123456';


 

分享到:
评论

相关推荐

    centos7离线安装postgres10和postgis

    在Linux环境中,CentOS 7是一个广泛使用的操作系统,而PostgreSQL 10是一个强大的开源关系数据库管理系统,PostGIS则是其扩展,提供了空间和地理数据的支持。对于无法连接到互联网的环境,离线安装这些组件是必要的...

    CentOS 6.3 安装VMTools

    ### CentOS 6.3 中安装 VMTools 的详细步骤与注意事项 #### 一、VMTools简介 VMTools 是由 VMware 公司开发的一款增强工具包,主要用于改善 VMware 虚拟机内的性能,并加强宿主机与虚拟机之间的交互能力。通过安装 ...

    CentOS 6.3安装(超级详细图解教程

    CentOS 6.3安装(超级详细图解教程) 相当齐全

    CentOS6.3安装nginx操作指南

    **CentOS 6.3 安装 Nginx 操作指南** 在 CentOS 6.3 上安装 Nginx 是一项常见的任务,Nginx 是一个高性能的 Web 和反向代理服务器,以其轻量级、高效的特性深受开发者和系统管理员的喜爱。本指南将详细解释如何在 ...

    CentOS6.3安装(超级详细图解教程)

    CentOS6.3安装(超级详细图解教程)。具体软件安装步骤与方法。

    硬盘安装linux centos6.3 构成电脑双系统

    在本教程中,我们将探讨如何在已有Windows 7操作系统的基础上,通过硬盘安装Linux CentOS 6.3来构建一个双系统环境。这个过程涉及到磁盘分区、制作U盘启动盘以及配置引导加载器等多个步骤。 首先,我们需要在...

    CentOS6.3 Linux操作系统安装教程

    【CentOS6.3 Linux操作系统安装教程】 CentOS是一款基于Red Hat Enterprise Linux(RHEL)源代码重新编译而成的免费Linux发行版,以其稳定性和兼容性受到广大用户的青睐,尤其适合构建LAMP(Linux、Apache、MySQL、...

    Centos6.3 yum安装lamp架构

    Centos6.3 yum安装lamp架构

    linux之centos6.3 安装 qq2012笔记

    还不错的,很实用。希望大家能够喜欢,以后多多交流。

    CentOS 6.3安装文档

    在本文中,我们将深入探讨如何安装 CentOS 6.3,这是一个基于 Linux 的操作系统,尤其适合初学者和那些熟悉 6.x 系列版本的用户。虽然 CentOS 6.3 已经不再支持,但了解其安装过程对理解 Linux 安装原理仍有价值。 ...

    centos 6.3 64位下载

    标题中的“CentOS 6.3 64位下载”涉及到的是Linux操作系统的一个特定版本——CentOS 6.3的64位安装镜像。CentOS(Community ENTerprise Operating System)是基于Red Hat Enterprise Linux(RHEL)的开源免费操作...

    linux CentOS6.3版本详细安装过程

    NULL 博文链接:https://hermosa-young.iteye.com/blog/1776184

    CentOS7下PostgreSQL与PostGIS插件离线部署指南 用于centos7的x86-64 包括postgis3.3

    本文详细介绍了如何在CentOS7环境中离线安装PostgreSQL及其配套PostGIS插件的方法。提供了完整的离线仓库配置步骤,并演示不同版本之间的兼容性和具体的安装命令流程。 适合人群:从事地理信息系统(GIS)工作的...

    安装CentOS6.3系统

    ### 安装CentOS 6.3系统的详细指南 #### 一、准备工作 在开始安装CentOS 6.3之前,我们需要确保已经准备好了必要的工具和资源。首先,需要从官方镜像站点下载CentOS 6.3的ISO镜像文件。根据提供的链接: - **下载...

    CentOS 6.3 安装详细教程

    ### CentOS 6.3 安装教程知识点解析 #### 一、CentOS 6.3 系统概述 - **CentOS**:一种基于Linux内核的开源操作系统,旨在提供一个稳定、高预测性且免费的企业级计算平台。CentOS 6.3作为其6.x系列的一个版本,在...

    centos6.3版本的安装于配置

    主要是针对配置centos6.3版本的安装、python26的安装、python26模块的安装、nginx服务的安装、hg安装、解决乱码问题及ftp问题,centos6.3版本的安装与配置,安装过程中的配置,安装包选择

    centos6.3安装图解,包含相关程序下载地址

    本文将详细介绍如何在VirtualBox中安装CentOS 6.3,这是一个适合初学者的图解教程,涵盖了从下载到安装的整个过程。首先,选择CentOS 6.3作为Linux发行版的原因是它免费且稳定,适合课程设计等入门级使用。X86-64...

    远程安装CentOS6.3

    远程安装 CentOS 6.3 并进行硬 RAID 配置 本文将指导用户如何远程安装 CentOS 6.3 操作系统,并在不同服务商的服务器上进行硬 RAID 配置。同时,本文还将详细介绍 CentOS 6.3 的安装过程和需求。 远程安装 CentOS ...

    CentOS 6.3安装(超级详细图解教程)

    - **CentOS 6.3** 是一个基于 Red Hat Enterprise Linux (RHEL) 的开源操作系统版本。它提供了一个稳定、可靠且免费的企业级计算平台,特别适用于服务器环境。 #### 二、CentOS 6.3 镜像下载与准备 - **下载地址**...

Global site tag (gtag.js) - Google Analytics