Compile and install PostgreSQL9.4.1 and phpPgAdmin in CentOS 6.6

Source: Internet
Author: User

Compile and install PostgreSQL9.4.1 and phpPgAdmin in CentOS 6.6

 

Preparations before installation

# Yum install readline-devel zlib-devel

Download, decompress, compile, and install the source code

# Wget https://ftp.postgresql.org/pub/source/v9.4.1/postgresql-9.4.1.tar.bz2
# Tar-xjvf postgresql-9.4.1.tar.bz2
# Cd postgresql-9.4.1
#./Configure
# Make
# Make install

--------------------------------------
Add a user (because the root account cannot be used when the following database cluster is created)
# Useradd S
# Passwd ipvs

Create the target folder of the database cluster
# Mkdir-p/mnt/data/pgsql

# Chown-R postgres/mnt/data/pgsql


Environment variable settings
# Su-postgres

$ Vi. bash_profile
# Postgres
PGDATA =/mnt/data/pgsql
PATH =/usr/local/pgsql/bin: $ PATH
Export PGDATA PATH

Make environment variables take effect
$ Source. bash_profile
--------------------------------------

Create a database cluster
$ Pg_ctl initdb
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_0000.conf or using the option-A, or
-- Auth-local and -- auth-host, the next time you run initdb.

Success. You can now start the database server using:

/Usr/local/pgsql/bin/postgres-D/mnt/data/pgsql
Or
/Usr/local/pgsql/bin/pg_ctl-D/mnt/data/pgsql-l logfile start

Start a database instance
After the PGDATA environment variable is set, the-D option is not included.
$ Pg_ctl start-l/mnt/data/pgsql. log

Shut down database instances

$ Pg_ctl stop

Enable remote connection
$ Cd/mnt/data/pgsql/
$ Vi pg_hba.conf
# IPv4 local connections:
Host all 0.0.0.0/0 trust

$ Vi postgresql. conf
Listen_addresses = '*'

Configure Firewall
$ Su-root
# Vi/etc/sysconfig/iptables
-A input-p tcp-m tcp -- dport 80-j ACCEPT-A INPUT-p tcp-m state -- state NEW-m tcp -- dport 5432-j ACCEPT # service iptables restart
Configure phppgadmin
Download version 5.1at http://phppgadmin.sourceforge.net/doku.php.
Decompress the package to the site directory and rename it pgadmin.
# Cd pgadmin
# Vim conf/config. inc. php
$ Conf ['servers'] [0] ['host'] = '2017. 0.0.1 ';
$ Conf ['servers'] [0] ['Port'] = 5432;
$ Conf ['servers'] [0] ['pg _ dump_path'] = '/usr/local/pgsql/bin/pg_dump ';
$ Conf ['servers'] [0] ['pg _ dumpall_path '] ='/usr/local/pgsql/bin/pg_dumpall ';
$ Conf ['extra _ login_security '] = false

After saving, access the path and enter the user name and password.

------------------------------------ Lili split line ------------------------------------

How to install PostgreSQL 7/6 and phpPgAdmin in CentOS 5/6. 4

Install PostgreSQL 6.3 on yum in CentOS 9.3

PostgreSQL cache details

Compiling PostgreSQL on Windows

Configuration and installation of LAPP (Linux + Apache + PostgreSQL + PHP) Environment in Ubuntu

Install and configure phppgAdmin on Ubuntu

Install PostgreSQL9.3 on CentOS

Configure a Streaming Replication cluster in PostgreSQL

------------------------------------ Lili split line ------------------------------------

PostgreSQL details: click here
PostgreSQL: click here

This article permanently updates the link address:

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.