Featured Posts

Using DKIM with Exim and cPanel Similar to the intentions of SPF records and DomainKeys, DKIM is intended to authenticate a sender by using a public/private key pair to digitally sign email, therefore increasing deliverability. At this...

Readmore

Copy Outgoing Email on a cPanel Server with Exim A common request we get is how a user can automatically BCC outgoing email to another address. This is most often requested by law firms that need to be able to retain copies of communication. Forwarding...

Readmore

Do You Care About Your Customers' Data? I was working a case last week for a new client that's been hosting local business websites for over three years. As with all of my case studies, I did a short survey of the client's infrastructure, processes,...

Readmore

Tips to Reduce Your Customer Support Costs When hosting websites, whether as a mainstream hosting provider, a hobby, or to supplement another service, it's your job to make sure your customers have access to technical support in case they need...

Readmore

Roundcube: MySQL or SQLite? cPanel 11.25 introduces a new feature: The ability to have RoundCube use SQLite instead of MySQL. After benchmarking resource usage and performance, I've come to the conclusion that SQLite is definitely...

Readmore

The cPanel Admin Rss

Installing PostgreSQL

Posted by Vanessa | Tagged under ,, | Posted on January 10, 2010

3

PostgreSQL is an open-source database server similar (but different) than MySQL. cPanel has a built-in installer for setting up PostgreSQL easily. Keep in mind that the actual version of PostgreSQL you get depends on your OS version. For instance, CentOS 4 users will likely get version 7, CentOS 5 will get version 8.

First, run the install script from command line

/scripts/installpostgres

Then in WHM under SQL Services >> Postgres Config Choose Install Config. Once the config has been installed set a root password for PostgreSQL (Only Alphanumerics). If you hav a firewall, you may want to open port 5432.

PostgreSQL is installed now, but PHP is not compiled for it, so you’ll need to run EasyApache and enable PHP with PostgreSQL (pgsql) support. You can do this manually, or through WHM. If doing so manually, here is the configure switch (or use with /var/cpanel/easy/apache/custom/rawopts  [info])

--with-pgsql=/usr

Now when you log into cPanel you’ll see a section for PostgreSQL. You’ll probably notice the phpMyAdmin wannabe phpPgAdmin which is the database management tool for Postgres. If  you don’t see this option, make sure it’s enabled in WHM > Feature Manager.

Now edit /var/lib/pgsql/data/postgresql.conf and edit some settings:

port = 5432

Postgres 7:

tcpip_socket = true

Postgres 8:

listen_addresses='*'

Now restart the postgres service:

service postgres restart

Note that if you’re installing PostgreSQL on a server that already has users on it, privileges will not be added by default for those existing users. To add privileges, run this command:

for user in `ls /var/cpanel/users` ; do su $user -c “createuser -S -D -R $i” postgres; done


Liking this article? Share it and spread the word!
  • Print
  • PDF
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Live
  • MySpace
  • RSS
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Related posts:

Comments (3)

Copying and pasting your commands don’t work. Also, it should be $user in the command to su if you’re using for user in the for loop.

Keep in mind that WordPress does weird things to double dashes and quotes – try typing the commands instead of copying and pasting them

Just FYI to everyone, you need to run /scripts/makecpphp after easy apache and config setup. cPanel’s PhpPGAdmin will warn you it’s not installed for php.

Write a comment