Installing Postgresql - HOWTO

webJ

Active Member
Apr 9, 2003
25
0
151
I have WHM 8.5.1, Cpanel 8.5.3-S3 on RedHat 7.3

when I ran /scripts/installpostgres I got the following error

error: failed dependencies:
postgresql-libs = 7.2.4 is needed by postgresql-devel-7.2.4-5.73

I'm using WHM X SKIN in WHM, and have nothing for postgresql under Server Setup. Any help would be appreciated.

-- webJ
 

webJ

Active Member
Apr 9, 2003
25
0
151
I guess it installed the wrong rpms

How do I remove it and get the correct rpm's?
Where do I put them when I get them?

-- webJ
 

webJ

Active Member
Apr 9, 2003
25
0
151
Originally posted by webJ
I guess it installed the wrong rpms

How do I remove it and get the correct rpm's?
Where do I put them when I get them?

-- webJ
Anyone know theanswer?
 

diederik

Member
Feb 1, 2002
14
0
301
Re: Change password error

Originally posted by erwinfa
Hi

I'm using WHM 7.4.2 cPanel 7.4.2-S117, when I changed password from WHM I get error like this

Setting up Postgres Config...Done
Reloading Postgres...pg_ctl: cannot find /var/lib/pgsql/data/postmaster.pid
Is postmaster running?
Done
Changing Password....psql: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/tmp/.s.PGSQL.5432"?
Done
Reloading Postgres...pg_ctl: cannot find /var/lib/pgsql/data/postmaster.pid
Is postmaster running?
Done

The Postgres Password has been changed

How to fix this problem ?


Thanks

cPanel.net Support Ticket Number:
Does anybody know how to fix this ?
 

casey

Well-Known Member
Jan 17, 2003
2,303
0
191
1. Delete the postgre files in /tmp.
2. rm -rf /var/lib/pgsql/data
3. su - postgres
4. initdb
5. start postgre from ssh
6. Go back and try the WHM functions again.
 

Website Rob

Well-Known Member
Mar 23, 2002
1,504
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
Nice tip, Casey!

A question though. After doing #4 the msg. ends with:

Success. You can now start the database server using:

/usr/bin/postmaster -D /var/lib/pgsql/data
or
/usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start

Any comments on which is better or, which one is initated when using WHM to start postgres? I presume it would "postmaster" as that is the most common, but curious if starting with the "logfile" would be beneficial.
 

casey

Well-Known Member
Jan 17, 2003
2,303
0
191
Originally posted by Website Rob
Nice tip, Casey!

A question though. After doing #4 the msg. ends with:

Success. You can now start the database server using:

/usr/bin/postmaster -D /var/lib/pgsql/data
or
/usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start

Any comments on which is better or, which one is initated when using WHM to start postgres? I presume it would "postmaster" as that is the most common, but curious if starting with the "logfile" would be beneficial.
Those were the commands I was looking for. I had forgotten them, but I didn't want to run initdb again.:)

What has worked for me is to first run
/usr/bin/pg_ctl -D /var/lib/pgsql/data -l logfile start
It will keep going, so you will have to stop it by ctrl-c. Except that will stop the postgre server, so start it up again with
/usr/bin/postmaster -D /var/lib/pgsql/data

For some reason it would give me problems if I tried it the other way around. After following those steps, though, it hasn't given me any more problems.
 

Website Rob

Well-Known Member
Mar 23, 2002
1,504
1
318
Alberta, Canada
cPanel Access Level
Root Administrator
I went with the second option also. As I was still logged in to postgres though, I just did CTRL+D to log out and back to 'root'. Status showed postgres was running just fine -- no noticable CPU increase -- but still could not log into phpPgAdmin. Had to restart postgres in order to do so, so I guess the first option is the one to go with. :D
 

fishfreek

Well-Known Member
Jan 2, 2004
238
0
166
I need some help in trying to get postgres working on our RHE3 server. We have cpanel version 9.1.0-S73.

This is what I have done.

Verified that the following RPM's are installed.

rh-postgresql
rh-postgresql-contrib
rh-postgresql-devel

I have clicked on the WHM Postgres config and entered a password and then also clicked the Install Config.

Then I go into cpanel and go to the postgresl icon. I enter a name for a database and click Add database. I get the message that the database has been added successfuly. But the database never appears on the postgresl page in cpanel. I try to add a user and I get the same message about the user being created with the password XXXXX yet the user never appears.

I have looked thru a few pages of this howto but i get the feeling some of its outdated. On the first page it says run /scripts/postgreslinstall or someting simular but I dont have that script in the /scripts folder.

I see no way to start postgreql from /etc/rc.d/init.d/

When i try the su - postgres command it asks for the password yet it does not accept the root password for the server?

IM fully at a loss.
 

fishfreek

Well-Known Member
Jan 2, 2004
238
0
166
please someone? I got a client waiting to move onto one of our servers and they need a postgres database.
 

fishfreek

Well-Known Member
Jan 2, 2004
238
0
166
Which RPM should I reinstall?

I didnt see the script mentioned on the first page about installpostgres.

I rebuilt apache to include postgres support since I didnt know if it had been built initally with that support and I still get the same behavor out of cpanel. No errors just no datbase being created nor any postgres users.
 

marius

Well-Known Member
PartnerNOC
Jun 10, 2002
157
0
316
Bucharest
Originally posted by bdraco
===========================================
Step 5
===========================================
Login to cPanel and click on Postgres .. Enjoy!
===========================================

is not working. trying to add databases or users from the cpanel returns "database created / added database name" same thing for user but in postgresql administration page shows nothing.. is like there are no users or databases.

trying to acces pgadmin returns "login failed"

how can we have this posgres, pgadmin working ?!
 

fishfreek

Well-Known Member
Jan 2, 2004
238
0
166
marius, I had the same problem. I finally got fed up of not being able to figure it out and submitted a cpanel support ticket.

The person whom looked at my server said the postgres config file was wrong and they said they corrected it.

Of course when I asked what was wrong with it or how I could correct this myself on other box's should I have the same problem I was never given a response.

The apparent solution to my other problems with php not getting configured with pgsql support was solved by upgrading php to version 4.3.4.
 

marius

Well-Known Member
PartnerNOC
Jun 10, 2002
157
0
316
Bucharest
i allready have php 4.3.4 :( i'm now trying to remove all packages related to postgresql and trying to install postgres 7.4.1 from postgresql.org..will see
 

marius

Well-Known Member
PartnerNOC
Jun 10, 2002
157
0
316
Bucharest
so, first i removed all related to postgresql with rpm -e etc..

downloaded postgresql 7.4.1 installed the packages, except postgresql-perl that is not there :) after all that, runed /scripts/installpostgresql... and works like a charm now..

add/delete users/databases, phppgadmin works fine...

before, when i was trying only the /scripts/installpostgresql, the rpm -qa | grep postgres command returned this:

postgresql-perl-7.2.3-5.80
postgresql-7.2.3-5.80
postgresql-tcl-7.2.3-5.80
postgresql-perl-7.2.2-1
postgresql-server-7.2.3-5.80
postgresql-contrib-7.3.4-1PGDG
postgresql-odbc-7.2.4-5.80
postgresql-7.3.4-1PGDG
postgresql-python-7.3.4-1PGDG
postgresql-libs-7.3.4-1PGDG
postgresql-devel-7.3.4-1PGDG
postgresql-libs-7.2.3-5.80
postgresql-jdbc-7.3.4-1PGDG
postgresql-tcl-7.3.4-1PGDG


now, the rpm -qa | grep postgres command returns this:

postgresql-libs-7.4.1-1PGDG
postgresql-test-7.4.1-1PGDG
postgresql-docs-7.4.1-1PGDG
postgresql-devel-7.4.1-1PGDG
postgresql-server-7.4.1-1PGDG
postgresql-7.4.1-1PGDG
postgresql-python-7.4.1-1PGDG
postgresql-pl-7.4.1-1PGDG
postgresql-jdbc-7.4.1-1PGDG
postgresql-tcl-7.4.1-1PGDG


so.. good luck all
 

marius

Well-Known Member
PartnerNOC
Jun 10, 2002
157
0
316
Bucharest
but...

even if i can add users and databases, i CANNOT add user to a database...

opening phppgadmin, selecting the database i have created, when I try to acces "privileges" it gives me

Warning: Invalid argument supplied for foreach() in /usr/local/cpanel/base/3rdparty/phpPgAdmin/privileges.php on line 158 where you find "foreach ($privileges as $v) {"

if i try to acces "alter privileges" in phppgadmin, it shows me all users there, not only those added by the curent user in cp.. it shows postgres and other users postgres usernames.

even so, trying to select one from the list and setting "all privileges" .. nothing changed.

can someone help me here pls?
 

fmalekpour

Well-Known Member
PartnerNOC
Dec 4, 2002
85
1
158
Try to set a password, then create the config file (all in WHM) and then do this process again one more time.

Works for us! Funny, isn't it?
:p