HowTo install PostgresQL 7.4.2 on SME server (English)

HowTo
install PostgresQL 7.4.2 on SME server

Author: 
Van hees Michel <michel_AT_vanhees.cc>

Contributor:
  

Release supported: SME 6.0

License: color=#ff0000>GPL


Last updated:

Tuesday, 06-Jul-2004 9:20

 


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-docs-7.4.2-1PGDG.i386.rpm

postgresql-python-7.4.2-1PGDG.i386.rpm

postgresql-7.4.2-1PGDG.i386.rpm

postgresql-jdbc-7.4.2-1PGDG.i386.rpm

postgresql-server-7.4.2-1PGDG.i386.rpm

postgresql-contrib-7.4.2-1PGDG.i386.rpm

postgresql-libs-7.4.2-1PGDG.i386.rpm

postgresql-test-7.4.2-1PGDG.i386.rpm

postgresql-devel-7.4.2-1PGDG.i386.rpm

postgresql-pl-7.4.2-1PGDG.i386.rpm



Download all rpm from

ftp://ftp.be.postgresql.org/postgresql/


Or download the local copy :

#
lynx
"http://www.vanhees.cc/modules.php?op=modload&name=CmodsDownload&file=ind...

STEP 2: size=2> Install all RPM

#
rpm -Uvh --nodeps *.rpm


STEP 3: Launch of
PostgresQL

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 all ident sameuser

change that line for

#local
all all ident sameuser

local all all trust

host all 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.4.2, 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