Here we are installing PostgreSQL on an Oracle  VirtualBox RH 7 to demonstrate the process.

You should have :

  • Installed RedHat 7
  • The VBox host should have two network connects.
  • The first should be a “Bridged Adapter”, the second a “Hosts-only Adapter”.

I set both up with Promiscuous Mode = “Allow All”

N.B. all the security disabling etc is because this is a test installation.

 

Helpful PostgreSQL wiki https://wiki.postgresql.org/wiki/Main_Page

 

Prepare RedHat

Stop redhat from resolving PostgreSQL dependencies to the base repository rather than the version we want to use.

# vi /etc/yum/pluginconf.d/rhnplugin.conf

exclude=postgresql*

List the installed postgresql software

# yum list installed | grep stgre

Remove the default installation

# yum remove postgresql.x86_64

 

Install PostgreSQL

Install the 9.6 postgresql software

# yum install https://yum.postgresql.org/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm

# yum install postgresql96-server postgresql96-contrib

 

Initialise the postgresql installation

# /usr/pgsql-9.6/bin/postgresql96-setup initdb

Enable postgresql startup on reboot

# systemctl enable postgresql-9.6

Start postgresql
# systemctl start postgresql-9.6

Ensure SELINUX is disabled

# vi /etc/selinux/config
set to disabled

For this testing on an Oracle  VirtualBox RH 7  we will disable the firewall as well

# systemctl disable firewalld

# systemctl stop firewalld

 

Remove the installation

yum erase postgresql96*

 

Next: http://moluccan.co.uk/configure-postgresql/

 

Can’t find the yum packages ?

Browse https://yum.postgresql.org/repopackages.php to get the version of PostgreSQL you want.

We will stick with pgdg-redhat96-9.6-3.noarch.rpm so we don’t run into any new version issues.

yum install https://download.postgresql.org/pub/repos/yum/9.6/redhat/rhel-7-x86_64/pgdg-redhat96-9.6-3.noarch.rpm

OR

download an install via rpm -Upv pgdg-redhat96-9.6-3.noarch.rpm

Install PostgreSQL Server

[root@RH72 Downloads]# yum list postgresql*
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Installed Packages
postgresql.x86_64 9.2.18-1.el7 @anaconda/7.3
postgresql-docs.x86_64 9.2.18-1.el7 @anaconda/7.3
postgresql-libs.x86_64 9.2.18-1.el7 @anaconda/7.3
postgresql-server.x86_64 9.2.18-1.el7 @anaconda/7.3
Available Packages
postgresql-jdbc.noarch 42.1.4-1.rhel7 pgdg96
postgresql-jdbc-javadoc.noarch 42.1.4-1.rhel7 pgdg96
postgresql-pgpool-II.x86_64 3.4.6-1.el7 epel
postgresql-pgpool-II-devel.x86_64 3.4.6-1.el7 epel
postgresql-pgpool-II-extensions.x86_64 3.4.6-1.el7 epel
postgresql-plruby.x86_64 0.5.3-13.el7 epel
postgresql-plruby-doc.x86_64 0.5.3-13.el7 epel
postgresql-unit96.x86_64 3.1-1.rhel7 pgdg96
postgresql-unit96-debuginfo.x86_64 3.1-1.rhel7 pgdg96
postgresql96.x86_64 9.6.4-1PGDG.rhel7 pgdg96
postgresql96-contrib.x86_64 9.6.4-1PGDG.rhel7 pgdg96
postgresql96-debuginfo.x86_64 9.6.4-1PGDG.rhel7 pgdg96
postgresql96-devel.x86_64 9.6.4-1PGDG.rhel7 pgdg96
postgresql96-docs.x86_64 9.6.4-1PGDG.rhel7 pgdg96
postgresql96-libs.x86_64 9.6.4-1PGDG.rhel7 pgdg96
postgresql96-odbc.x86_64 09.06.0410-1PGDG.rhel7 pgdg96
postgresql96-plperl.x86_64 9.6.4-1PGDG.rhel7 pgdg96
postgresql96-plpython.x86_64 9.6.4-1PGDG.rhel7 pgdg96
postgresql96-pltcl.x86_64 9.6.4-1PGDG.rhel7 pgdg96
postgresql96-server.x86_64 9.6.4-1PGDG.rhel7 pgdg96
postgresql96-tcl.x86_64 2.3.1-1.rhel7 pgdg96
postgresql96-tcl-debuginfo.x86_64 2.3.1-1.rhel7 pgdg96
postgresql96-test.x86_64 9.6.4-1PGDG.rhel7 pgdg96
[root@RH72 Downloads]#

yum install postgresql96-server

 

 

https://www.mojowill.com/geek/howto-install-php-5-4-5-5-or-5-6-on-centos-6-and-centos-7/
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
rpm -Uvh remi-release-7*.rpm epel-release-7*.rpm
yum install php php-gd php-mysql php-mcrypt