Howto install PostgresQL (English version)

HowTo
install PostgresQL

Author:  Van hees Michel <michel_AT_vanhees.cc>

Contributor:  

Release supported: e-smith SME 5.6 & 6.0b3

License: color=#ff0000>GPL

Last updated:

Wednesday, August 06, 2003 08:49 AM

 


Problem: Install of POSTGRESQL database

Solution:
  Follow this HowTo

NOTE: All the installation have to been execute in ROOT


STEP 1: Download
all RPM

mx-2.0.3-1.i386.rpm


postgresql-7.2.1-5.i386.rpm

postgresql-contrib-7.2.1-5.i386.rpm

postgresql-devel-7.2.1-5.i386.rpm

postgresql-docs-7.2.1-5.i386.rpm

postgresql-jdbc-7.2.1-5.i386.rpm

postgresql-libs-7.2.1-5.i386.rpm

postgresql-odbc-7.2.1-5.i386.rpm

postgresql-perl-7.2.1-5.i386.rpm

postgresql-python-7.2.1-5.i386.rpm

postgresql-server-7.2.1-5.i386.rpm

postgresql-tcl-7.2.1-5.i386.rpm

postgresql-tk-7.2.1-5.i386.rpm

#
wget -nd -r -l2 -np [URL]

STEP 2: size=2> Install all RPM

#
rpm -Uvh --nodeps *.rpm


STEP 3: Launch ofPostgresQL

Command :

?A?º??or=#ffcc99>#
/etc/init.d/postgresql start



Result :

Initializing
database: [ OK ]

Starting postgresql service: [ OK ]

STEP 4:  Create
configuration template

Create template directory

#
mkdir -p /etc/e-smith/templates/var/lib/pgsql/data

# mkdir -p /etc/e-smith/templates-custom/var/lib/pgsql/data

Copy original config
file into template directory

#
cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates/var/lib/pgsql/data

#
cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates/var/lib/pgsql/data

#
cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates-custom/var/lib/pgsql/data


#
cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates
-custom/var/lib/pgsql/data


STEP 5:  Modify
configuration files

Edit postgresql.conf

#
pico /etc/e-smith/templates-custom/var/lib/pgsql/data/postgresql.conf

Modify line 26
to accept TCP/IP connection

Before modification you have :

#tcpip_socket = false

After modification you should have :

tcpip_socket = true

Save the file (CTRL o) and exit(CTRL x)

Edit pg_hba.conf

#
pico /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf

at the end of the
file there is

local
all ident sameuser

change that line for

#local
all ident sameuser

local all trust

host all [IP_LOCAL] [MASK] trust

host all all 0.0.0.0 255.255.255.255 reject

IP_LOCAL have to been
replace by your IP

MASK have to been remplace by your subnet mask


STEP 6:  Expand postgres template


#
/sbin/e-smith/expand-template
/var/lib/pgsql/data/pg_hba.conf

# /sbin/e-smith/expand-template /var/lib/pgsql/data/postgresql.conf


STEP 7:  Restart
postgresQL


/etc/init.d/postgresql stop

Stopping
postgresql service: [ OK ]

/etc/init.d/postgresql start

Starting
postgresql service: [ OK ]


STEP 8:  Testing
access to postgresQL

Connect with postgres
user

#
su - postgres

Create a new DB
test

#
createdb postgrestest

Create a test user
and return with root user

#
createuser -A -D jesuistest

# exit

Connect to PostgresQL

#
psql postgrestest-h [HOSTNAME] -U jesuistest

HOSTNAME is to replace
with your localhost name

Result sould sound
like :

Welcome
to psql 7.3.3, the PostgreSQL interactive terminal.

Type: \copyright
for distribution terms

\h for help with SQL commands

\? for help on internal slash commands

\g or terminate with semicolon to execute query

\q to quit

postgrestest=>



Now your Postgres database is install and ready for Opengroupware installation


STEP 9:  Automatic
launching postgres

# ln -s /etc/init.d/postgresql
/etc/rc.d/rc7.d/S56postgresql

# ln -s /etc/init.d/postgresql /etc/rc.d/rc6.d/K03postgresql


 

Category: 
Howtos pour E-Smith/SME