Je n'ai jamais pu faire du yoga. Chaque fois qu'on me dit : assied-toi et ne pense à rien, ça me rappelle trop le bureau. Fred Cristallini
HowTo install PostgresQL 7.4.2 on SME server (Français)
HowTo install PostgresQL 7.4.2 on SME server Author: Tuesday, 06-Jul-2004 9:20
|
|
|
|
Problem: Installation d'un base de donnée NOTE: Toute l'installation s'effectue avec l'utilisateur ROOT |
|
|
STEP 1: Récupération
des différents 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
Downloader les différents rpm depuis l'adresse :
ftp://ftp.be.postgresql.org/postgresql/
Ou downloader la copie locale :
# lynx "http://www.vanhees.cc/modules.php?op=modload&name=CmodsDownload&file=ind... |
STEP 2:
size=2> Installation des RPM
# rpm |
STEP 3: Lancement
de PostgresQL
Commande :
# /etc/init.d/postgresql start |
Résultat
:
Initializing database: [ OK ] Starting postgresql service: [ OK ] |
STEP 4: Création
des templates de configuration
Création
du répertoire de template
# mkdir -p /etc/e-smith/templates/var/lib/pgsql/data # mkdir -p /etc/e-smith/templates-custom/var/lib/pgsql/data |
Copie des fichiers
de base dans le répertoire template
# 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: Modification
des fichiers de configuration
Edition du fichier
postgresql.conf
# pico /etc/e-smith/templates-custom/var/lib/pgsql/data/postgresql.conf |
Modification de
la ligne 26 pour accepter les connections TCP/IP
Avant la modification vous avez :
#tcpip_socket = false
Après la modification vous devriez avoir :
tcpip_socket = true
Sauvez (CTRL o) et quittez (CTRL x)
Edition du fichier
pg_hba.conf
# pico /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf |
à la fin du
fichier il y a
local all all ident sameuser |
changer cette ligne
pour
#local 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 est a remplacé
par votre IP
MASK est à remplacé par votre mask réseaux
STEP 6: Génération
des templates
# /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: Redémmarage
de postgresQL
/etc/init.d/postgresql stop
Stopping postgresql service: [ OK ] |
/etc/init.d/postgresql start
Starting postgresql service: [ OK ] |
STEP 8: Tester
l'accès à postgresQL
Se connecter
avec l'utilisateur postgres
# su - postgres |
Création
d'un base de test
# createdb postgrestest |
Création
d'un utilisateur de test et retour à ROOT
# createuser -A -D jesuistest # exit |
Connection à
la postgresQL
# psql postgrestest-h [HOSTNAME] -U jesuistest |
HOSTNAME est remplacé
par le nom du host
Le résultat
doit donner :
Welcome to psql 7.4.2, the PostgreSQL interactive terminal. Type: \copyright for distribution terms \h for help with SQL commands postgrestest=> |
Maintenant votre base de donnée POSTGRES est installé et prête
pour l'installation de OpenGroupware
STEP 9: Lancement
automatique de Postgres au démarrage
# ln -s /etc/init.d/postgresql /etc/rc.d/rc7.d/S56postgresql # ln -s /etc/init.d/postgresql /etc/rc.d/rc6.d/K03postgresql |