Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Database Server
  • Search

How to install PostgreSQL

Questions regarding the Database Server
MySQL, PostgreSQL, MariaDB, Percona Server, phpMyAdmin, phpPgAdmin
Post Reply
  • Print view
Advanced search
7 posts • Page 1 of 1
skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

How to install PostgreSQL
  • Quote

Post by skid » Fri Aug 02, 2013 9:57 am

# Install PostgreSQL server

Code: Select all

yum install postgresql postgresql-server postgresql-contrib
# Initialize database cluster

Code: Select all

/etc/init.d/postgresql initdb
# Start the server

Code: Select all

service postgresql start
# Download hba configuration

Code: Select all

wget http://c.vestacp.com/0.9.8/rhel/pg_hba.conf -O /var/lib/pgsql/data/pg_hba.conf
# Set oracle user password

Code: Select all

su - postgres
psql -c "ALTER USER postgres WITH PASSWORD 'pgp4sw0rd'"
# Restart the server

Code: Select all

service postgresql restart
# Enable pgsql databases support in vesta

Code: Select all

Edit /usr/local/vesta/conf/vesta.conf and make it look like DB_SYSTEM='mysql,pgsql'
# Register pg instance in vesta

Code: Select all

v-add-database-host pgsql localhost postgres pgp4sw0rd
# Add user database using webinterface or cli

Code: Select all

v-add-database admin test test test0011 pgsql
Top

KeiroD
Posts: 61
Joined: Fri Oct 11, 2013 8:35 pm

Re: How to install PostgreSQL
  • Quote

Post by KeiroD » Mon Nov 04, 2013 1:31 pm

skid wrote:# Install PostgreSQL server
Can you do the Debian-based steps as well? Or, would you be willing to check this section out: http://support.eidolonhost.com/wiki/Ves ... on_VestaCP

Not entirely sure if this will work for Debian-based servers. Unfortunately, I'm not near my test lab for VestaCP, so I can't quite confirm if the steps'll work for Debian-based systems... but I've done what I could.
Top

skid
VestaCP Team
Posts: 1476
Joined: Wed Apr 06, 2011 11:12 pm

Re: How to install PostgreSQL
  • Quote

Post by skid » Mon Nov 04, 2013 8:13 pm

KeiroD, howto worked like a charm.
I have uploaded pg_hba.conf to debian and ubuntu config directory. So wget command should look like

Code: Select all

wget http://c.vestacp.com/0.9.8/debian/pg_hba.conf -O /var/lib/postgresql/9.1/main/pg_hba.conf
Thank you
Top

KeiroD
Posts: 61
Joined: Fri Oct 11, 2013 8:35 pm

Re: How to install PostgreSQL
  • Quote

Post by KeiroD » Mon Nov 04, 2013 8:15 pm

skid wrote:KeiroD, howto worked like a charm.
I have uploaded pg_hba.conf to debian and ubuntu config directory. So wget command should look like

Code: Select all

wget http://c.vestacp.com/0.9.8/debian/pg_hba.conf -O /var/lib/postgresql/9.1/main/pg_hba.conf
Thank you
Beautiful, glad to hear it worked perfectly for you as well. :) I'll be updating my guide here shortly to account for that.

Edit: Note: Each time VestaCP updates their software, this section of the guide will be updated to account for this. However, if you want to update the system's configuration without waiting for us to update the guide, simply substitute 0.9.8 for VestaCP for the newest version of VestaCP and then, for Postgresql, replace 9.1 for the newest version of PostgreSQL.

This was appended to the specific wget section for VestaCP/PostgreSQL.

Feel free to use the wiki format so far as a basis for your own wiki. Or, y'know, set up the wiki similarly to my company's wiki and we can contribute to the wiki.
Top

zaidcrowe
Posts: 3
Joined: Wed May 07, 2014 1:08 pm

Re: How to install PostgreSQL
  • Quote

Post by zaidcrowe » Thu Oct 08, 2015 3:59 pm

Hi Guys,

I have a related problem - I simply need to connect to a remote Postgres instance, not set one up.

My app is throwing this error: Fatal error: Call to undefined function pg_connect()

When I run: yum install php-pgsql (after yum update)

I get this error:

Code: Select all

Error: Package: php-pgsql-5.3.3-46.el6_6.x86_64 (updates)
           Requires: php-common(x86-64) = 5.3.3-46.el6_6
           Installed: php-common-5.4.36-1.el6.remi.x86_64 (@remi)
               php-common(x86-64) = 5.4.36-1.el6.remi
           Available: php-common-5.3.3-40.el6_6.x86_64 (base)
               php-common(x86-64) = 5.3.3-40.el6_6
           Available: php-common-5.3.3-46.el6_6.x86_64 (updates)
               php-common(x86-64) = 5.3.3-46.el6_6
I didn't want to downgrade/switch php version for fear of messing things up - is there another way to achieve what I'm looking to do?
Top

liveuk
Posts: 1
Joined: Tue Dec 15, 2015 5:27 am

Re: How to install PostgreSQL
  • Quote

Post by liveuk » Tue Dec 15, 2015 5:33 am

Hello loving the VestaCP

This thread is 9.1 but the PostgreSQL is now 9.4
On Debian we get

# apt-get install postgresql postgresql-server postgresql-contrib
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package postgresql-server

Please could you guide us through install this and the phppgadmin
to an already install vesta CP on Debian 8 Jessie

Mike
Top

weasam
Posts: 1
Joined: Wed Apr 04, 2018 12:41 am

Os: CentOS 5x
Web: apache + nginx
Re: How to install PostgreSQL
  • Quote

Post by weasam » Wed Apr 04, 2018 12:51 am

Thanks for your demonstration.
After following your way step by step to installed PostgreSQL. Vesta.conf also configured
The problem I met is even the PostgreSQL on running. but i still can not create a PostgreSQL from vesrtacp. creating the Database only have mysql can select

Machine Information
System: Centos 6
Remote server:66.***.***.150
Top


Post Reply
  • Print view

7 posts • Page 1 of 1

Return to “Database Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password