Koozali.org: home of the SME Server
Obsolete Releases => SME 7.x Contribs => Topic started by: Peter120 on August 21, 2007, 10:59:02 PM
-
Hi,
I'd like to install postgreSQL on my sme 7.2 but I want to use version 8+, i.e as new as possible.
Is there any how to or if someone have any idea how I should go about it. I have searched the forum but cant find a clear description.
I would be grateful for any suggestions.
/Peter
-
I can provide you something in french if you want. Commands are the same...
-
Thanks,
I don't know any french but maybe the commands would be enough, I'd like to try.
/Peter
-
you could start with:
yum search postgre
-
yum --enablerepo centosplus install postgresql-jdbc.i386 postgresql-server.i386
/etc/init.d/postgresql start
mkdir -p /etc/e-smith/templates/var/lib/pgsql/data
mkdir -p /etc/e-smith/templates-custom/var/lib/pgsql/data
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
su - postgres
psql -d template1
alter user postgres with password 'xxxxx';
\q
exit
vi /etc/e-smith/templates-custom/var/lib/pgsql/data/postgresql.conf
superuser_reserved_connections=2
ssl = on
password_encryption = on
listen_addresses = '*'
cd /var/lib/pgsql/data
cp /etc/httpd/conf/ssl.crt/server.crt .
cp /etc/httpd/conf/ssl.key/server.key .
chown postgres:postgres server.*
vi /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf
à la fin du fichier, changer:
local all all ident sameuser
en:
local all all md5
changer:
host all all 127.0.0.1/32 ident sameuser
en
host all all 127.0.0.1/32 md5
changer:
host all all ::1/128 ident sameuser
en:
host all all ::1/128 md5
Ajouter (rejet du broadcast):
host all all 0.0.0.0 255.255.255.255 reject
Reporter les modifs:
expand-template /var/lib/pgsql/data/pg_hba.conf
expand-template /var/lib/pgsql/data/postgresql.conf
/etc/init.d/postgresql stop
/etc/init.d/postgresql start
Tests de fonctionnement:
createuser -S -R -D -U postgres jesuistest (sans droit de création de rôle)
psql -d postgrestest -U postgres
alter user jesuistest with password 'jesuistest';
\q
createdb -E UTF-8 -T template1 -O postgrestest -e -U postgres
exit
psql postgrestest -U jesuistest (mot de passe: 'jesuistest')
select * from pg_tables where tablename not like 'pg_%';
\q
dropdb postgrestest
ln -s /etc/init.d/postgresql /etc/rc.d/rc7.d/S56postgresql
ln -s /etc/init.d/postgresql /etc/rc.d/rc6.d/K03postgresql
signal-event post-upgrade
signal-event reboot
-
looks good to me
the packages are in the centos base repo. you don't have to enable the centosplus.
-
if I remember, packages in centos are those of version 7.4. packages in centosplus are 8.1 (that was like that 2 or 3 months ago)
-
Perfect, got 8.1.9 up and running now. :grin:
Thanks
/Peter
-
learn something new everyday! Thanks hedererjs