Help - Search - Members - Calendar
Full Version: HOWTO: Install PGSQL
The Planet Forums > Control Panels > cPanel/WHM > Cpanel/WHM HOWTOs
soma
Taken from cpanel forums....


Installing Postgresql - HOWTO
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!
===========================================

Thanx to the cpanel guys again here is a link to the post


http://forums.cpanel.net/showthread.php?s=...15&pagenumber=1
mark1hos
We have just followed your installation and it has not worked.

When we click on postgreSQL in cPanel and click add user it works but when we add the database it says it has but when we go back its not there and does not get added.
mark1hos
Also when we go to use pg_dumpall in Shell it asks for a password, we enter the one we associated with in WHM and it just says:

pg_dumpall: could not connect to database template1: FATAL: Password authentication failed for user "root"


Any help please :-)
Water
Works great. I just can't create any DB and I can't login to phpPgAdmin because of the username and password. How do I make it so my clients can login with their username and password?
aussie
QUOTE
Originally posted by Water
Works great. I just can't create any DB and I can't login to phpPgAdmin because of the username and password. How do I make it so my clients can login with their username and password?


What version of Cpanel are you running? I know that this was fixed in the Edge release. Dont know if this was fixed in R or S versions. You may want to consider upgrading to an Edge release.
GetWired
Didn't work for me either.

I got this:

root@secure [~]# /scripts/installpostgres
This script will install Postgres 7.3.x or later
If you have an older version installed you wil need to
Dump your databases to a file and then restore them
after the install as 7.3.x is not backwards compatible.
If you do not have any databases, you can just run:
mv /var/lib/pgsql /var/lib/pgsql.old
/sbin/service postgresql stop
/sbin/service postgresql start
to force creating a 7.3.x style setup. Do not do this if
you have databases that you wish to keep!

Are you sure you wish to proceed? y
Fetching rpm updates list...Done
Fetching rpm provides list...Done
Fetching rpm requires list...Done
Building local rpm provides list...Done
postgresql-server: installed version 7.3.3-1PGDG is up to date, no action needed.
postgresql: installed version 7.3.3-1PGDG is up to date, no action needed.
postgresql-devel: installed version 7.3.3-1PGDG is up to date, no action needed.
[FAILED]
postmaster: no process killed
postmaster: no process killed
Initializing database: [FAILED]
Starting postgresql service: [FAILED]
root@secure [~]#

What happened?
DGS
Everything seemed to install correctly for me. I set the password in WHM and the config and seemed OK. In Cpanel, I can create and delete databases.

Problem is I can't connect to the database? What could the reason for this be?
I-WebSolutions
same prob here...

I can connect to the DB via phppgadmin but not with any actual software installs.... i.e. phpBB
soma
getwired try uninstalling those packeges then running the script

also make sure u delete or rename te pgsql db's
soma
is phpbb2 compatible with pgsql ?
GetWired
QUOTE
Originally posted by soma
getwired try uninstalling those packeges then running the script

also make sure u delete or rename te pgsql db's


How would I do that mate? icon_smile.gif
soma
do this
mv /var/lib/pgsql /var/lib/pgsql.old

then run the script
GetWired
Thanks!
Hornet
Can anyone please help me icon_razz.gif

I did everything said in the setup however I keep getting these errors with all of the scripts:

Fatal error: Call to undefined function: pg_connect() in /home/alliance/public_html/helpdesk/system/opendb.php on line 34

any ideas?
hendricknet
I followed the directions, and it worked great, However I now have another problem. It appears that when the server reboots (or for some other reason unbenounced to me) cpanel is no longer linked to postgresql db's in. Users can't create or view databases or users. I know I can fix this by doing a dump, renaming /var/lib/pgsql/data and reinstalling using /scripts/installpostgres. However this is really going to get old and inconvenient to customers if this is always the work around.

Anyone have ideas?
hendricknet
Anyone?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.