PostgreSQL is a open source object-relational database system. In addition to that, PostgreSQL is highly extensible like we can define our own data types, build out custom functions etc. By integrating PostGIS with PostgreSQL we will get geographical capabilities to a database created in PostgreSQL and it can used for local based services or applications. for example an application which is used to find out nearby ATMs.
In cPanel based server, we can install PostgreSQL using cPanel scripts. But cPanel script install the version of PostgreSQL that ships with your operating system or available in the default Centos repository. So suppose you need an latest upgraded version of PostgreSQL in a cPanel server, follow below steps. I have tested it on Centos7.
Below the system environment we tested the working, feel free to test it on newer cPanel versions.
System Environment
Install PostgreSQL
Use below cPanel script for PostgreSQL install.
Below are the rpm packages installed in the server. In your case the rpm package version may vary.
Now log in the WHM panel and go the section Home » SQL Services » Configure PostgreSQL
Click buttons like “install config”, “Create users” and set a Password for the default “postgres” system user password. This is the user created automatically during install of PostgreSQL . The password we set needed at the time of login in to the pgsql terminal.
Test the installed pgsql.
Upgrade current Pgsql version in to the latest version available. Going to install PostgreSQL 12.
At this moment we can see the newly installed postgresql running in the default port number 5432
Now we need to setup the symlinks for upgraded Postgres to work with cPanel/WHM.
Now log in the WHM panel and go the section Home » SQL Services » Configure PostgreSQL and run “Create users” “install config” and set a Password for “postgres” user.
For testing from cPanel. Log in the cPanel of a website and click the “PostgreSQL Databases” icon and create a test database. After that click the “phpPgAdmin” icon a new tab will open and it will show the newly created pgsql database, table and an option to run query. Its like the phpmyadmin used for MySQL.
Now install PostGIS.
Below are packages and their dependencies installed in the server.
Now we are going to enable and test the PostGIS extension in a newly created test database.
This concludes the installation, Upgrade of PostgreSQL database in a cPanel based server. After that we also installed PostGIS and verified it. Leave your thoughts at the below comment box.
After doing this, after I click on “Install Config” I get this:
Failed to determine postgresql version: psql (PostgreSQL) 11.9
The PostgreSQL options on the user panel have disappeared as well
Same problem of André Luiz =(
So I get psql installed and AFTER completing
/scripts/upcp –force
I check back into WHM and the “Configure PostgreSQL”
I see Error: PostgreSQL is not running.
back in terminal systemctl status postgresql-12 : active (running).
What am I missing here?
Only Cpanel support defaul installpostgres script only mention their offical site, so default is postgres version:9 Only, if version update not a problem but you can’t access via cpanel default PHPpgadmin, other than that you can use pgadmin from your side, and enable remote host access in server.
Okay, I have successfully implemented the integration of updated postgres version to cPanel provided PHPpgadmin on a older version cPanel servers using the steps mentioned in the blog article. It may possible that its no longer working on newer version cPanels and I haven’t tried it on new servers yet.