Installing PostgreSQL
Posted by Vanessa | Posted in Misc | Posted on January 10, 2010
2
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






sending...