The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Installing Postgresql - HOWTO

Discussion in 'Database Discussions' started by cPanelNick, Aug 13, 2003.

  1. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    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:
     
  2. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    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:
     
  3. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    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:
     
    #3 sexy_guy, Aug 13, 2003
    Last edited: Aug 13, 2003
  4. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    cPanel Access Level:
    DataCenter Provider
    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:
     
  5. mmkassem

    mmkassem Well-Known Member

    Joined:
    Oct 21, 2002
    Messages:
    390
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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 :( ]
     
    #5 mmkassem, Aug 13, 2003
    Last edited: Aug 13, 2003
  6. BaDBoY_2000

    BaDBoY_2000 Active Member

    Joined:
    May 20, 2003
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Tomcat

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

    cPanel.net Support Ticket Number:
     
  7. ricu5

    ricu5 Member

    Joined:
    Mar 14, 2003
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    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:
     
  8. dxer

    dxer Well-Known Member

    Joined:
    Sep 9, 2002
    Messages:
    295
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    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:
     
  9. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    It works great now except I cannot delete databases in client control panels.

    cPanel.net Support Ticket Number:
     
  10. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    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:
     
  11. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    cd /usr/local/cpanel/base/3rdparty/phpPgAdmin/conf/
    mv config.inc.php-dist config.inc.php

    cPanel.net Support Ticket Number:
     
    #11 casey, Aug 14, 2003
    Last edited: Aug 14, 2003
  12. dxer

    dxer Well-Known Member

    Joined:
    Sep 9, 2002
    Messages:
    295
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Europe
    Thanks !

    cPanel.net Support Ticket Number:
     
  13. chrisbond

    chrisbond Well-Known Member

    Joined:
    Apr 12, 2003
    Messages:
    59
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    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:
     
  14. sexy_guy

    sexy_guy Well-Known Member

    Joined:
    Mar 19, 2003
    Messages:
    848
    Likes Received:
    0
    Trophy Points:
    16
    Re: Counting Pgsql databases

    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:
     
  15. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Re: Re: Counting Pgsql databases

    True. If I just had more control over the number, I'd be happy.

    cPanel.net Support Ticket Number:
     
  16. purplepaws

    purplepaws Well-Known Member

    Joined:
    Jan 15, 2002
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    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:
     
  17. casey

    casey Well-Known Member

    Joined:
    Jan 17, 2003
    Messages:
    2,303
    Likes Received:
    0
    Trophy Points:
    36
    Location:
    If there is trouble, it will find me
    Did you:
    I had 7.2 on my system from the rpms via whm. Running /scripts/installpostgres installed 7.3.3.

    cPanel.net Support Ticket Number:
     
  18. purplepaws

    purplepaws Well-Known Member

    Joined:
    Jan 15, 2002
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    WHM 7.4.0 cPanel 7.4.0-S61

    cPanel.net Support Ticket Number:
     
  19. cPanelNick

    cPanelNick Administrator
    Staff Member

    Joined:
    Mar 9, 2015
    Messages:
    3,426
    Likes Received:
    2
    Trophy Points:
    38
    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:
     
  20. purplepaws

    purplepaws Well-Known Member

    Joined:
    Jan 15, 2002
    Messages:
    153
    Likes Received:
    0
    Trophy Points:
    16
    Version 7.0.3!

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

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page