Installing Postgresql - HOWTO

cPanelNick

Administrator
Staff member
Mar 9, 2015
3,481
35
208
cPanel Access Level
DataCenter Provider
cPanel requires Postgresql 7.3.x or later. 7.2.x will not work.

===========================================
Step 1
===========================================
Upgrade to cPanel 7.4.0 build 45 or later
===========================================

===========================================
Step 1a (If you do not have 7.2.x or earlier installed skip this step)
===========================================
Login to a root shell via ssh or the console.

If you have Postgres 7.2.x installed, backup your databases using pg_dumpall or some other method.

Move the postgres data directory somewhere else. ie

mv /var/lib/pgsql /var/lib/pgsql.old
===========================================


===========================================
Step 2
===========================================
Login to a root shell via ssh or the console and run

/scripts/installpostgres
===========================================

===========================================
Step 2a (skip this step if you are not upgrading from postgres 7.2 or earlier
===========================================
Restore your sql dump created with pg_dumpall or by some other method using psql or some other method
===========================================


===========================================
Step 3
===========================================
Login to Web Host Manager and choose "Postgres Config" under Server Setup.

Set a postgres password to anything of your choosing. You should avoid using any non-alpha numeric charaters as these cause problems.
===========================================


===========================================
Step 4
===========================================
Use the "Postgres Config" option in WHM to install a postgres pg_hba.conf file. You can skip this step if you would like to setup your pg_hba.conf file manually. cPanel should work fine with md5 passwords or plaintext passwords
===========================================


===========================================
Step 5
===========================================
Login to cPanel and click on Postgres .. Enjoy!
===========================================

cPanel.net Support Ticket Number:
 

sexy_guy

Well-Known Member
Mar 19, 2003
847
0
166
Ok got it working! IM IMPRESSED!

The only thing is the installer is installing 7.2.3 not 7.3.2.

Visit this page

http://opensource.nederland.net/PostgreSQL/

Get the following for your version of RH

postgresql
postgresql-libs
postgresql-server

Do a Uvh * to install 4.3.2

Select the OPTION from WHM to POSTGRES CONFIG. Set you password. Restart postgresql.

Test!

cPanel.net Support Ticket Number:
 

sexy_guy

Well-Known Member
Mar 19, 2003
847
0
166
Ok problem, the only problem im having is that you cannot delete the database from the control panel. Can you look at this? But if the user logs into phpPgAdmin then he has the opton to drop the db, which works. Maybe this should be allowed to work from the control panel rather then from phpPgadmin.

cPanel.net Support Ticket Number:
 
Last edited:

cPanelNick

Administrator
Staff member
Mar 9, 2015
3,481
35
208
cPanel Access Level
DataCenter Provider
Originally posted by sexy_guy
Ok got it working! IM IMPRESSED!

The only thing is the installer is installing 7.2.3 not 7.3.2.

Visit this page

http://opensource.nederland.net/PostgreSQL/

Get the following for your version of RH

postgresql
postgresql-libs
postgresql-server

Do a Uvh * to install 4.3.2

Select the OPTION from WHM to POSTGRES CONFIG. Set you password. Restart postgresql.

Test!

cPanel.net Support Ticket Number:
Just might need to wipe /root/.cpupdates/* before running /scripts/postgresinstall. /scripts/postgresinstall should install the 7.3.x rpms.

PS. I tested droping a database and it worked fine on our rh 7.3 and rh 9 test machines.
cPanel.net Support Ticket Number:
 

mmkassem

Well-Known Member
Oct 21, 2002
390
0
166
Egypt
This script goes in a loop forever here.
It also tries to install apache and php rpms too
[edit : used /scripts/upcp .. loop finished. Databases can be created but not deleted :( ]
 
Last edited:

BaDBoY_2000

Active Member
May 20, 2003
37
0
156
Tomcat

nice work, works fine here!... now only if you could write up somthing like this for TOMCAT!!!!!!!!! thanks

cPanel.net Support Ticket Number:
 

ricu5

Member
Mar 14, 2003
11
0
151
postgres conf

Hello..
running stable 52
postgres is working..both whm/cp and phppgadmin

database and user creation working...

you can however see all databases from pgphpadmin
you can create tables to other users databases
you can not access/alter/drop tables owned by other users
dont particularly like the fact you can add tables to another users data base..

But
I changed this in pgphp conf to this..I feel a little better anyway..not more secure just better

// Only show owned databases?
// Note: This will simply hide other databases in the list - this does not
// in any way prevent your users from seeing other database by other means.
// (eg. Run 'SELECT * FROM pg_database' in the SQL area.)
$conf['owned_only'] = false; to true


// Only show owned reports?
// Note: This does not prevent people from accessing other reports by other
// means.
$conf['owned_reports_only'] = false; to true

when I click on the reports link it asks you to login again..it does not work.

now I realize this does not keep others from accessing "by
other means"

But what they cant see doesnt hurt...sure they could upload their own copy to the server and see everything,why would you do this when pgphpadmin is available from cp.. I would believe there intentions to be less than honorable if they do.You do not need to see anyone elses databases or for that matter want to create tables within someone elses database.I also believe that clients even though you assure them that no one else can access the data base will have a problem with this especially if another client decides they would like to play and adds a couple of tables totheir database.I did not think this change would work because I was under the assumption when you create the database(s) from c-panel they are created by postgres su....in which case they would be owned by postgres and this config would keep any other users other than owner from seeing the databases..I dont get this...

I created 3 databases on one site and three on another site...I logged into each site control panel and could only see the databases that were created for each site..so it works for now..tomorrow is another day we shall see...

as I am not sure about any of this...please correct me if I am going in the wrong direction..

My 2 cents

Rich

:D

cPanel.net Support Ticket Number:
 

dxer

Well-Known Member
Sep 9, 2002
308
0
166
Europe
When I hit phpPgAdmin I get this error and Admin is not opening:

Configuration error: Copy conf/config.inc.php-dist to conf/config.inc.php and edit appropriately.


_____
What this mean to copy file to a file and what to edit ?

cPanel.net Support Ticket Number:
 

Marty

Well-Known Member
Oct 10, 2001
629
1
318
It works great now except I cannot delete databases in client control panels.

cPanel.net Support Ticket Number:
 

casey

Well-Known Member
Jan 17, 2003
2,288
0
191
Counting Pgsql databases

Everything is working great except deleting databases and the numbering of postgres databases. If I set the number of sql databases to 4, a customer can create 4 mysql databases AND 4 postgres databases. If possible, I would like to set the number to 4 (or whatever) and let that be the total number of databases period.

cPanel.net Support Ticket Number:
 

casey

Well-Known Member
Jan 17, 2003
2,288
0
191
Originally posted by dxer
When I hit phpPgAdmin I get this error and Admin is not opening:

Configuration error: Copy conf/config.inc.php-dist to conf/config.inc.php and edit appropriately.


_____
What this mean to copy file to a file and what to edit ?

cPanel.net Support Ticket Number:
cd /usr/local/cpanel/base/3rdparty/phpPgAdmin/conf/
mv config.inc.php-dist config.inc.php

cPanel.net Support Ticket Number:
 
Last edited:

dxer

Well-Known Member
Sep 9, 2002
308
0
166
Europe
Originally posted by casey
cd /usr/local/cpanel/base/3rdparty/phpPgAdmin/conf/
mv config.inc.php-dist config.inc.php

cPanel.net Support Ticket Number:
Thanks !

cPanel.net Support Ticket Number:
 

chrisbond

Well-Known Member
Apr 12, 2003
59
0
156
Hereford, United Kingdom
Great work it all works apart from you cannot delete a database after creating it in cpanel. You can delete the users just not the database itself - no errors just doesnt work.

cPanel.net Support Ticket Number:
 

sexy_guy

Well-Known Member
Mar 19, 2003
847
0
166
Re: Counting Pgsql databases

Originally posted by casey
Everything is working great except deleting databases and the numbering of postgres databases. If I set the number of sql databases to 4, a customer can create 4 mysql databases AND 4 postgres databases. If possible, I would like to set the number to 4 (or whatever) and let that be the total number of databases period.

cPanel.net Support Ticket Number:
I would rather see an option that lets the admin give

Mysql db's 5
Postgresql db's 5

In any create a new account for regular as well as for resellers.

Some people might want to charge for Postgresql db's separate from mysql db rather then bunching them together.

cPanel.net Support Ticket Number:
 

casey

Well-Known Member
Jan 17, 2003
2,288
0
191
Re: Re: Counting Pgsql databases

Originally posted by sexy_guy
I would rather see an option that lets the admin give

Mysql db's 5
Postgresql db's 5

In any create a new account for regular as well as for resellers.

Some people might want to charge for Postgresql db's separate from mysql db rather then bunching them together.

cPanel.net Support Ticket Number:
True. If I just had more control over the number, I'd be happy.

cPanel.net Support Ticket Number:
 

purplepaws

Well-Known Member
Jan 15, 2002
153
0
316
Hi,

We followed ths instructions and did not have an old verison installed, however, we are getting these errors when trying to install the config file or change the password....

You are running an old unsupported postgresql version.
cPanel only supports postgres 7.3.x or better.

Anyone?

cPanel.net Support Ticket Number:
 

casey

Well-Known Member
Jan 17, 2003
2,288
0
191
Originally posted by purplepaws
Hi,

We followed ths instructions and did not have an old verison installed, however, we are getting these errors when trying to install the config file or change the password....

You are running an old unsupported postgresql version.
cPanel only supports postgres 7.3.x or better.

Anyone?

cPanel.net Support Ticket Number:
Did you:
Upgrade to cPanel 7.4.0 build 45 or later
I had 7.2 on my system from the rpms via whm. Running /scripts/installpostgres installed 7.3.3.

cPanel.net Support Ticket Number:
 

cPanelNick

Administrator
Staff member
Mar 9, 2015
3,481
35
208
cPanel Access Level
DataCenter Provider
You might have an old version still lingering

try

psql --version

to find out what version you have.

cPanel.net Support Ticket Number:
 

purplepaws

Well-Known Member
Jan 15, 2002
153
0
316
Version 7.0.3!

Never had this on this server before...confused.

cPanel.net Support Ticket Number: