Menu

phpPgAdmin on CentOS & RHEL


phpPgAdmin is web-based client written in php for accessing and managing PostgreSQL databases. It provides very efficient way to work with databases on PostgreSQL like, create database, table, alter database, export/import database etc.
This article will help you to install phpPgAdmin on CentOS and RedHat Systems. Before installing it make sure you have Apache and PostgreSQL installed on server. 

Step 1: Add PostgreSQL Repository

Install postgres repository in your system, Download repository rpm using one of below urls. 
CentOS/RHEL 5, 32-Bit:
# wget http://yum.postgresql.org/9.1/redhat/rhel-5-i386/pgdg-centos91-9.1-4.noarch.rpm

CentOS/RHEL 6, 32-Bit:
# wget http://yum.postgresql.org/9.1/redhat/rhel-6-i386/pgdg-centos91-9.1-4.noarch.rpm

CentOS/RHEL 5, 64-Bit:
# wget http://yum.postgresql.org/9.1/redhat/rhel-5.0-x86_64//pgdg-centos91-9.1-4.noarch.rpm

CentOS/RHEL 6, 64-Bit:
# wget http://yum.postgresql.org/9.1/redhat/rhel-6.3-x86_64/pgdg-centos91-9.1-4.noarch.rpm
Step 2: Install phpPgAdmin using Yum
Install phpPgAdmin package using yum command line tool.
yum install phpPgAdmin httpd
Step 3: Configure phpPgAdmin to Access Remotly.

Note: phpPgAdmin is case sensitive. Use upper and lower cases properly as shown in the above command.
By default, you can access phppgadmin using http://localhost/phpPgAdmin from your local system only. To access remote systems, do the following.
Edit file /etc/httpd/conf.d/phpPgAdmin.conf:
vi /etc/httpd/conf.d/phpPgAdmin.conf 
[...]
Alias /phpPgAdmin /usr/share/phpPgAdmin
<Location /phpPgAdmin>
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all granted
        #Require host example.com
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order deny,allow
        Allow from all
        # Allow from .example.com
    </IfModule>
</Location>
Step 4: Restart Apache Service
Restart Apache service to reload new settings.
# service httpd restart

Step 5 : Configure phpPgAdmin

Edit file /etc/phpPgAdmin/config.inc.php, and do the following changes. Most of these options are self-explanatory. Read them carefully to know why do you change these values.

vi /etc/phpPgAdmin/config.inc.php
Find the following line:
$conf['servers'][0]['host'] = '';
Change it as shown below:
$conf['servers'][0]['host'] = 'localhost';
And find the line:
$conf['extra_login_security'] = true;
Change the value to false:
$conf['extra_login_security'] = false;
Find the line:
$conf['owned_only'] = false;
Set the value as true.ru
$conf['owned_only'] = true;
Save and close the file. Restart postgresql service and Apache services.
On CentOS 6.x systems:
service postgresql-9.5 restart
service httpd restart
On CentOS 7 systems:
systemctl restart postgresql-9.5
systemctl restart httpd
Now open your browser and navigate to http://ip-address/phpPgAdmin

About Author:


I am a Linux Administrator and Security Expert with this site i can help lot's of people about linux knowladge and as per security expert i also intersted about hacking related news.TwitterFacebook

Next
Newer Post
Previous
Older Post

0 comments:

Post a comment

 
Top