Koozali.org: home of the SME Server

Install PostgreSQL on 7.0pre3

gmoney

Install PostgreSQL on 7.0pre3
« on: February 18, 2006, 08:34:57 PM »
Hi,  I just worked through getting PostGres working on 7.0pre3.  I am sharing the process I went through for people who want to do the same, and also to get some comments in case I did anything incorrectly or unnecessarily.

This is based on the script by cydonia and a few other threads in this forum.

wget http://mirrors.kernel.org/centos/4.2/os/i386/CentOS/RPMS/postgresql-docs-7.4.8-1.RHEL4.1.i386.rpm
wget http://mirrors.kernel.org/centos/4.2/os/i386/CentOS/RPMS/postgresql-7.4.8-1.RHEL4.1.i386.rpm
wget http://mirrors.kernel.org/centos/4.2/os/i386/CentOS/RPMS/postgresql-server-7.4.8-1.RHEL4.1.i386.rpm
wget ftp://ftp.nluug.nl/pub/os/Linux/distr/CentOS/4.2/updates/i386/RPMS/php-pgsql-4.3.9-3.9.i386.rpm

rpm -i postgresql-7.4.8-1.RHEL4.1.i386.rpm
rpm -i postgresql-server-7.4.8-1.RHEL4.1.i386.rpm
rpm -i postgresql-docs-7.4.8-1.RHEL4.1.i386.rpm
rpm -i php-pgsql-4.3.9-3.9.i386.rpm

mkdir -p /etc/e-smith/templates-custom/var/lib/pgsql/data/postgresql.conf
touch /etc/e-smith/templates-custom/var/lib/pgsql/data/postgresql.conf/20Socket
echo 'tcpip_socket='true'' > /etc/e-smith/templates-custom/var/lib/pgsql/data/postgresql.conf/20Socket

mkdir -p /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf
touch /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf/50AllowHost
echo 'local all all trust' > /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf/50AllowHost
echo 'host all all '127.0.0.1' '255.255.255.255' trust' > /etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf/50AllowHost

mkdir -p /etc/e-smith/templates-custom/etc/php.ini
touch /etc/e-smith/templates-custom/etc/php.ini/70DynamicExtension90pgsql
echo 'extensions=pgsql.so' > /etc/e-smith/templates-custom/etc/php.ini/70DynamicExtension90pgsql

/etc/init.d/postgresql start
/etc/init.d/postgresql stop

/sbin/e-smith/expand-template /etc/php.ini
/sbin/e-smith/expand-template /var/lib/pgsql/data/postgresql.conf
/sbin/e-smith/expand-template /var/lib/pgsql/data/pg_hba.conf

/etc/init.d/postgresql start

/etc/rc7.d/S86httpd-e-smith sigusr1
/etc/rc7.d/S86httpd-admin sigusr1

/sbin/e-smith/config set postgresql service status enabled
ln -s /etc/rc.d/init.d/e-smith-service /etc/rc.d/rc7.d/S64postgresql
signal-event post-upgrade
signal-event reboot

Offline gregswallow

  • *
  • 651
  • +1/-0
Re: Install PostgreSQL on 7.0pre3
« Reply #1 on: February 19, 2006, 03:40:46 AM »
Thanks for sharing.

You could replace this:
Quote from: "gmoney"

wget http://mirrors.kernel.org/centos/4.2/os/i386/CentOS/RPMS/postgresql-docs-7.4.8-1.RHEL4.1.i386.rpm
wget http://mirrors.kernel.org/centos/4.2/os/i386/CentOS/RPMS/postgresql-7.4.8-1.RHEL4.1.i386.rpm
wget http://mirrors.kernel.org/centos/4.2/os/i386/CentOS/RPMS/postgresql-server-7.4.8-1.RHEL4.1.i386.rpm
wget ftp://ftp.nluug.nl/pub/os/Linux/distr/CentOS/4.2/updates/i386/RPMS/php-pgsql-4.3.9-3.9.i386.rpm

rpm -i postgresql-7.4.8-1.RHEL4.1.i386.rpm
rpm -i postgresql-server-7.4.8-1.RHEL4.1.i386.rpm
rpm -i postgresql-docs-7.4.8-1.RHEL4.1.i386.rpm
rpm -i php-pgsql-4.3.9-3.9.i386.rpm


with:

Code: [Select]
yum --enablerepo=base --enablerepo=updates install postgresql postgresql-server postgresql-docs php-pgsql

That is the safest/best way to install any rpms from CentOS, and will work in your howto even if the version changes.

Tetrao

Install PostgreSQL on 7.0pre3
« Reply #2 on: November 30, 2006, 10:01:32 AM »
Hi !
I did all ...
Can't even createuser !
did you add the postgres user after the install  of the rpm's and before doing the rest of this process to install postgresql ?

Thanks for answer

Offline gregswallow

  • *
  • 651
  • +1/-0
Install PostgreSQL on 7.0pre3
« Reply #3 on: November 30, 2006, 06:21:20 PM »
Charlie Brady made a smeserver-postgresql rpm.  It is likely still in development, I haven't noticed any discussion about it - http://mirror.contribs.org/smeserver/releases/7/builds/rpms/RPMS/noarch/smeserver-postgresql-0.0.1-20.noarch.rpm
(With this rpm you won't need to make all the symlinks and template stuff yourself)

You can try it if it is a test server and if you have any suggestions or patches for that rpm then discuss them on the devinfo mailing list.

Offline byte

  • *
  • 2,183
  • +2/-0
Install PostgreSQL on 7.0pre3
« Reply #4 on: November 30, 2006, 06:25:23 PM »
Quote from: "gregswallow"

You can try it if it is a test server and if you have any suggestions or patches for that rpm then discuss them on the devinfo mailing list.


Or maybe to the bug tracker under this bug...

http://bugs.contribs.org/show_bug.cgi?id=1667
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline gregswallow

  • *
  • 651
  • +1/-0
Install PostgreSQL on 7.0pre3
« Reply #5 on: November 30, 2006, 06:29:32 PM »
> Or maybe to the bug tracker under this bug...

Yup - even better.  I added a note on the bug report that there is a later version.

Tetrao

Install PostgreSQL on 7.0pre3
« Reply #6 on: November 30, 2006, 10:52:10 PM »
Excuse me but I'm very new with sme. I use it for two years but never used yum to install soft.
Could you write the line I need to type in place of :

yum --enablerepo=base --enablerepo=updates install postgresql postgresql-server postgresql-docs php-pgsql

??

Thanks for anwer !!!!
(we always forget to thanks ...)

Offline stiperstones

  • *
  • 177
  • +0/-0
    • http://www.stiperstones.com
Install PostgreSQL on 7.0pre3
« Reply #7 on: November 30, 2006, 11:07:03 PM »
Open a terminal to your server and log in as root and issue this command


Code: [Select]
yum --enablerepo=base --enablerepo=updates install postgresql postgresql-server postgresql-docs php-pgsql
which is the code you have been shown. which gregswallow indicated

To get a understanding of yum in the terminal issue this command
Code: [Select]
man yum

Here are  a couple of commands to help
Code: [Select]

yum check-update
checks what updates are available

Code: [Select]
yum -y upgrade updates your server dont forget to follow the instruction after the update completes
Stiperstones

http://wiki.contribs.org/Koozali_Foundation
Try the Wiki some great how's there

"My Licence".........

Don't report security issues here - Contact security at contribs dot org
Don't report problems here - Please report bugs @ http://bugs.contribs.org/
Don't ask the same question twice - Please search the forums, your question may have been asked before - Thank You.

Offline jester

  • *
  • 496
  • +1/-0
Install PostgreSQL on 7.0pre3
« Reply #8 on: December 01, 2006, 10:13:39 AM »
Would it be possible to install postgres8 from the RH el4 rpm's from the postgresql site on SME7 and use the described howto at the top of this topic?!

postgres7 is missing some really important features (vacuuming) i have been told by the developers of Ledger-smb that i'm trying to install.

regards,
jester.

Tetrao

Install PostgreSQL on 7.0pre3
« Reply #9 on: December 01, 2006, 12:01:51 PM »
If I well understand you, Stiperstones, I 'only' have to use

yum --enablerepo=base --enablerepo=updates install postgresql postgresql-server postgresql-docs php-pgsql

and nothing else which was written at the beginning of this topic ?


Thanks for answers !
tetrao

Jester : vacuum was already in the 7.x versions ...

Offline jester

  • *
  • 496
  • +1/-0
Install PostgreSQL on 7.0pre3
« Reply #10 on: December 01, 2006, 12:26:42 PM »
@Tetrao: Hmm.... there must be a difference between vacuum and autovacuum then: http://sourceforge.net/forum/forum.php?thread_id=1597692&forum_id=606441

regards,
jester.

Tetrao

Install PostgreSQL on 7.0pre3
« Reply #11 on: December 01, 2006, 12:41:29 PM »
Jester,
Did you already installed postgres 7.x on a sme ?
Does it support perl / tcl (compiled with options -perl -tcl ) ?


Tetrao

Offline jester

  • *
  • 496
  • +1/-0
Install PostgreSQL on 7.0pre3
« Reply #12 on: December 01, 2006, 01:40:04 PM »
I followed this howto: http://no.longer.valid/phpwiki/index.php/How%20to%20install%20SQL-Ledger%20on%20SME%207.0

Sql-ledger is based on Perl so that works, don't know about the tcl option.


regards,
jester.