H-Sphere Documentation Sysadmin Guide

For more information contact us at info@psoft.net

PostgreSQL Installation

 

Step-by-step Installation

Step 1. PostgreSQL Installation Checkup.

First, check if you have PostgreSQL database server already installed.
You may do this by entering the following command into your command prompt:

which psql

If you get the following (or similar):
/usr/local/pgsql/bin/psql,
this means you already have got PostgreSQL database software installed.

Using the rpm -q command is an alternative way to check if PostgreSQL is installed. Type the following command in your command prompt:

rpm -qa | grep postgresql

If you get
postgresql-7.1.3-1
or something alike when the command is executed, it will mean that you already have PostgreSQL database software installed.

Now you may use the existing one or install a later version of PostgreSQL.

WARNING: H-Sphere requires PostgreSQL version 7.1 or higher.

Step 2. Downloading PostgreSQL
(skip this step if PostgreSQL is already installed)

If you don't have PostgreSQL installed, you will need to download PostgreSQL from binary RPM distribution from www.postgresql.org or its mirror sites.

Find RMP file which is usually stored in the software/download directory
Download it.

Step 3. PostgreSQL Installation.

Install the PostgreSQL database software. Do this by following command:

rpm -i postgresql_rpm_file_name
where postgresql_rpm_file_name is PostgreSQL binary RPM distribution.

Step 4. PostgreSQL Configuration.

To configure the access to PostgreSQL DBs, go to PostgreSQL home directory /usr/local/pgsql (or similar) and find the /data/pg_hba.conf file. Open it and find the records similar to the ones below:

TYPE
DATABASE
IP_ADDRESS
MASK
AUTHTYPE MAP
 
local
all
   
trust
 
host
all
127.0.0.1
255.255.255.255
password
 

If the 'AUTHTYPE' parameter is set to trust, you must change the authentication option to password.
* For more detail configuration see pg_hba.conf file.

To make H-Sphere scripts work properly, go to PostgreSQL home directory /usr/local/pgsql (or similar) and find the /data/global/pg_pwd file.
Open it and find the record of the respective postgres user similar to this:

postgres 0 x x x x abcdefgh \N

If you can't find such record, execute the following commands:

1) psql -d template1 -U postgres
2) alter user postgres with password 'postgres_password';

The record similar to:

postgres 0 x x x x postgres_password
\N

should appear in the pg_pwd file.

On PostgreSQL database box in the /hsphere/shared/scripts directory, the following scripts must be installed:

pgsql-change-user-password - changes user password
pgsql-change-user-password.sh - changes user password
pgsql-create-db - creates PostgreSQL database
pgsql-create-db.sh - creates PostgreSQL database
pgsql-create-user - creates PostgreSQL user
pgsql-create-user.sh - creates PostgreSQL user
pgsql-db-size - calculates database size
pgsql-db-size.pl - calculates database size
pgsql-delete-user - deletes PostgreSQL user
pgsql-delete-user.sh - deletes PostgreSQL user
pgsql-drop-database - drops PostgreSQL database
pgsql-drop-database.sh - drops PostgreSQL database
pgsql-get-login - gets PostgreSQL superuser login and password
pgsql-get-login.pl - gets PostgreSQL superuser login and password
pgsql-resume-user - resumes the suspended user
pgsql-resume-user.sh - resumes the suspended user
pgsql-setenv - sets PostgreSQL environment variables
pgsql-suspend-user - suspends PostgreSQL user
pgsql-suspend-user.sh - suspends PostgreSQL user

All scripts accept some command line parameters. All scripts consist of two parts. The first part, typically without extension, sets necessary variables and then calls the second part of the script under sudo.

INFO: fix_perm.sh scripts sets needed owner and rights to postres scripts.

WARNING: Some of these scripts are different on FreeBSD systems, so copy corresponding versions of scripts from /hsphere/shared/scripts/FreeBSD.

phpPgAdmin

If you are going to use phpPgAdmin in your H-Sphere 2.x installation, some additional operations should be done. Firstly, get phpPgAdmin version 2.3 or higher (download it from tar -zxf phpPgAdmin.tar.gz) (http://sourceforge.net/projects/phppgadmin)



Home   Products   Services   Partners   Support   News   Contact   Forum
© Copyright 1998-2003. Positive Software Corporation.
All rights reserved.