Rien n'est jamais joué si l'on se refuse à subir. Françoise Giroud
HowTo install PostgresQL 7.4.2 on SME server (English)
| HowTo install PostgresQL 7.4.2 on SME server Author: Tuesday, 06-Jul-2004 9:20
|
|
|
|
|
|
Problem: Install of POSTGRESQL database 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
|
# |
Command :
| ?A?º??or=#ffcc99># |
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 |
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 |