Previous: http://moluccan.co.uk/installing-postgresql/

Install software

# yum install phpPgAdmin

 

Configure phpPgAdmin

# cd /etc/httpd/conf.d
# vi phpPgAdmin.conf
Comment out “Require local” and add “Require all granted”
Change “Deny from all” to “Allow from all”
Comment out “Allow from 127.0.0.1” and “Allow from ::1″

The file should now look like

Alias /phpPgAdmin /usr/share/phpPgAdmin

<Location /phpPgAdmin>
<IfModule mod_authz_core.c>
# Apache 2.4
#Require local
Require all granted
#Require host example.com
</IfModule>
<IfModule !mod_authz_core.c>
# Apache 2.2
Order allow,deny
Allow from all
#Allow from 127.0.0.1
#Allow from ::1
# Allow from .example.com
</IfModule>
</Location>

 

# cd /etc/phpPgAdmin
# vi config.inc.php
Change
$conf[‘servers’][0][‘host’] = ”;
$conf[‘extra_login_security’] = true;
$conf[‘owned_only’] = false;
TO
$conf[‘servers’][0][‘host’] = ‘localhost’;
$conf[‘extra_login_security’] = false;
$conf[‘owned_only’] = true;

Restart the services

# systemctl restart httpd
# systemctl restart postgresql-9.6

# vi /var/lib/pgsql/9.6/data/postgresql.conf
Change
# listen_addresses = ‘localhost’ # what IP address(es) to listen on;

TO

listen_addresses = ‘*’ # what IP address(es) to listen on;

Uncomment the line

port = 5432 # (change requires restart)

Restart the services

# systemctl restart postgresql-9.6
# systemctl restart httpd

 

Assuming the “Bridged Adapter” is on enp0s3 and the “Host-only Adapter” is on  enp0s8
use “ifconfig” to get the ip addressess assigned to the adapters:

Then put those addesses in teh /etc/hosts file.

n.b. my host is called phhrh72 which will be the name/address associated with the Host-only adapter.

n.b. phhrh722 will be allocated to the bridged adapter.

 

# vi /etc/hosts
10.33.2.164 phhrh722 phhrh722.localdomain
192.168.56.101 phhrh72 phhrh72.localdomain

# systemctl disable firewalld
# systemctl stop firewalld

 

Now attach from the server AND from the host running VBox

e.g.

http://phhrh72/

http://phhrh72/phpPgAdmin