Installing or Updating PostgreSQL on Your cPanel & WHM Server

For cPanel & WHM version 11.28

Installing and updating PostgreSQL is not a difficult process, but you should follow the steps below in order to ensure that everything is properly configured.

note Note: cPanel & WHM works with PostgreSQL 7.3.x or later. Earlier versions will not work with cPanel & WHM.

  1. Using the command line interface, log into your server as root.
  2. If you have PostgreSQL 7.2.x installed, back up your databases using pg_dumpall or some other method.
  3. If you have databases you wish to keep, move your existing PostgreSQL data directory somewhere else by, for example, typing the following command:
    • mv /var/lib/pgsql /var/lib/pgsql.old
  4. To begin the installation process:
    • On a CentOS or RedHat system, use the following script: /scripts/installpostgres. This script executes yum install postgresql (and related RPMs).
    • On a FreeBSD system, you can use ports to install PostgreSQL.
    • You may also execute the following commands to install PostgreSQL on a FreeBSD system:
      /scripts/installpkg postgresql74-server
      /scripts/installpkg postgresql74-client
      /scripts/installpkg postgresql-server postgresql-client
      echo postgresql_enable="YES" >> /etc/rc.conf
      /usr/local/etc/rc.d/postgresql initdb
      /usr/local/etc/rc.d/postgresql start
      /scripts/makecpphp (freebsd 5.x+ only)
  5. In your web browser, log into WHM.
  6. Select Postgres Config in the SQL Services section of WHM.
  7. Type a new PostgreSQL password in the text box and click Change Password.
    • ALERT! Warning: Only use letters and numbers. Non-alphanumeric characters cause problems.
  8. If you are installing PostgreSQL for the first time, click the Install Config button.
    • ALERT! Warning: If you have an existing PostgreSQL configuration, this will overwrite your configuration authentication file ( pg_hba.conf).
  9. If you are upgrading from PostgreSQL 7.2.x or earlier, restore the SQL dump you created in step 3 by using psql or some other method.
  10. PostgreSQL is now accessible from your cPanel interface.

note Note: For more information about PostgreSQL, visit the PostgreSQL website.

PICK Important: cPanel, Inc. does not supply PostgreSQL, nor do we not provide RPMs to update PostgreSQL to the latest version.

Topic revision: r13 - 31 Jan 2011 - 12:53:06 - MelanieSeibert