Koozali.org: home of the SME Server

Fluffed Postgres 8 install on 7.2. Dovecot issues too.

Offline purpaboo

  • ***
  • 48
  • +0/-0
    • http://www.kush-t.co.uk
Fluffed Postgres 8 install on 7.2. Dovecot issues too.
« on: November 20, 2007, 02:50:28 PM »
Hi

I followed the instructions at http://wiki.contribs.org/Postgres in order to get a recent version of
PostgreSQL up and running on my 7.2 box (P2 350, 512MB RAM, 40GB HD).

I started off with the first command from the wiki:
Code: [Select]
rpm -q --whatrequires perl-CGI-Session perl-DBD-Pg
and then
Code: [Select]
yum remove perl-CGI-Session perl-DBD-Pgwhich went smoothly.

I then enabled the centosplus repository and installed postgres:
Code: [Select]
yum --enablerepo=centosplus install postgresql postgresql-contrib postgresql-devel postgresql-docs postgresql-pl postgresql-python postgresql-testwhich also seemed to go nicely, but note the dovecot warning (in red)
Quote
---> Downloading header for tcl to pack into transaction set.
tcl-8.4.7-2.i386.rpm      100% |=========================|  24 kB    00:00
---> Package tcl.i386 0:8.4.7-2 set to be updated
---> Downloading header for postgresql-libs to pack into transaction set.
postgresql-libs-8.1.9-1.e 100% |=========================|  15 kB    00:00
---> Package postgresql-libs.i386 0:8.1.9-1.el4s1.1 set to be updated
---> Downloading header for mx to pack into transaction set.
mx-2.0.5-3.i386.rpm       100% |=========================|  36 kB    00:00
---> Package mx.i386 0:2.0.5-3 set to be updated
--> Running transaction check
--> Processing Dependency: libpq.so.3 for package: dovecot
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for dovecot to pack into transaction set.
ftp://ftp.planetmirror.com/pub/smeserver/releases/7/smeos/i386/SME/RPMS/dovecot-1.0-1.2.rc15.el4.sme.i386.rpm: [Errno 4] IOError: [Errno ftp error] 550 smeserver: Connection timed out
Trying other mirror.
dovecot-1.0-1.2.rc15.el4. 100% |=========================|  26 kB    00:00
---> Package dovecot.i386 0:1.0-1.2.rc15.el4.sme set to be updated
--> Running transaction check
--> Processing Dependency: libpq.so.3 for package: dovecot
--> Restarting Dependency Resolution with new changes.
--> Populating transaction set with selected packages. Please wait.
---> Downloading header for postgresqlclient7 to pack into transaction set.
postgresqlclient7-7.4.17- 100% |=========================| 6.5 kB    00:00
---> Package postgresqlclient7.i386 0:7.4.17-1.el4s1.1 set to be updated
--> Running transaction check

Dependencies Resolved

=============================================================================
 Package                 Arch       Version          Repository        Size
=============================================================================
Installing:
 postgresql              i386       8.1.9-1.el4s1.1  centosplus        2.7 M
 postgresql-contrib      i386       8.1.9-1.el4s1.1  centosplus        414 k
 postgresql-devel        i386       8.1.9-1.el4s1.1  centosplus        1.1 M
 postgresql-docs         i386       8.1.9-1.el4s1.1  centosplus        5.6 M
 postgresql-pl           i386       8.1.9-1.el4s1.1  centosplus         66 k
 postgresql-python       i386       8.1.9-1.el4s1.1  centosplus         63 k
 postgresql-test         i386       8.1.9-1.el4s1.1  centosplus        1.1 M
Installing for dependencies:
 mx                      i386       2.0.5-3          base              569 k
 postgresql-server       i386       8.1.9-1.el4s1.1  centosplus        3.8 M
 postgresqlclient7       i386       7.4.17-1.el4s1.1  centosplus        235 k
 tcl                     i386       8.4.7-2          base              897 k
Updating for dependencies:
 dovecot                 i386       1.0-1.2.rc15.el4.sme  smeos             1.3 M
 postgresql-libs         i386       8.1.9-1.el4s1.1  centosplus        183 k

Transaction Summary
=============================================================================
Install     11 Package(s)
Update       2 Package(s)
Remove       0 Package(s)
Total download size: 18 M
Is this ok [y/N]: y
Downloading Packages:
(1/13): postgresql-server 100% |=========================| 3.8 MB    00:04
(2/13): postgresql-pl-8.1 100% |=========================|  66 kB    00:00
(3/13): postgresqlclient7 100% |=========================| 235 kB    00:00
(4/13): dovecot-1.0-1.2.r 100% |=========================| 1.3 MB    00:01
(5/13): postgresql-test-8 100% |=========================| 1.1 MB    00:01
(6/13): tcl-8.4.7-2.i386. 100% |=========================| 897 kB    00:00
(7/13): postgresql-contri 100% |=========================| 414 kB    00:00
(8/13): postgresql-python 100% |=========================|  63 kB    00:00
(9/13): postgresql-libs-8 100% |=========================| 183 kB    00:00
(10/13): mx-2.0.5-3.i386. 100% |=========================| 569 kB    00:00
(11/13): postgresql-8.1.9 100% |=========================| 2.7 MB    00:02
(12/13): postgresql-docs- 100% |=========================| 5.6 MB    00:06
(13/13): postgresql-devel 100% |=========================| 1.1 MB    00:01
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
smeserver trap pre-install: postgresql-server
smeserver trap pre-install: postgresql-pl
smeserver trap pre-install: postgresqlclient7
smeserver trap pre-install: dovecot
smeserver trap pre-install: postgresql-test
smeserver trap pre-install: tcl
smeserver trap pre-install: postgresql-contrib
smeserver trap pre-install: postgresql-python
smeserver trap pre-install: postgresql-libs
smeserver trap pre-install: mx
smeserver trap pre-install: postgresql
smeserver trap pre-install: postgresql-docs
smeserver trap pre-install: postgresql-devel
  Updating  : postgresql-libs              ####################### [ 1/15]
  Installing: postgresql                   ####################### [ 2/15]
  Installing: postgresqlclient7            ####################### [ 3/15]
  Installing: postgresql-server            ####################### [ 4/15]
  Installing: mx                           ####################### [ 5/15]
  Installing: tcl                          ####################### [ 6/15]
  Installing: postgresql-pl                ####################### [ 7/15]
  Updating  : dovecot                                              [ 8/15]warning: /etc/dovecot.conf created as /etc/dovecot.conf.rpmnew
 
Updating  : dovecot                      ####################### [ 8/15]
  Installing: postgresql-test              ####################### [ 9/15]
  Installing: postgresql-contrib           ####################### [10/15]
  Installing: postgresql-python            ####################### [11/15]
  Installing: postgresql-docs              ####################### [12/15]
  Installing: postgresql-devel             ####################### [13/15]
  Cleanup   : dovecot                      ####################### [14/15]
  Cleanup   : postgresql-libs              ####################### [15/15]
Migrating existing database yum_repositories
Migrating existing database yum_installed
Migrating existing database hosts
Migrating existing database yum_available
Migrating existing database accounts
Migrating existing database configuration
Migrating existing database mailpatterns
Migrating existing database backups
Migrating existing database networks
Migrating existing database domains
Migrating existing database yum_updates
Migrating existing database spamassassin
smeserver trap post-install: postgresql-server
smeserver trap post-install: postgresql-pl
smeserver trap post-install: postgresqlclient7
smeserver trap post-install: dovecot
smeserver trap post-install: postgresql-test
smeserver trap post-install: tcl
smeserver trap post-install: postgresql-contrib
smeserver trap post-install: postgresql-python
smeserver trap post-install: postgresql-libs
smeserver trap post-install: mx
smeserver trap post-install: postgresql
smeserver trap post-install: postgresql-docs
smeserver trap post-install: postgresql-devel

Installed: postgresql.i386 0:8.1.9-1.el4s1.1 postgresql-contrib.i386 0:8.1.9-1.el4s1.1 postgresql-devel.i386 0:8.1.9-1.el4s1.1 postgresql-docs.i386 0:8.1.9-1.el4s1.1 postgresql-pl.i386 0:8.1.9-1.el4s1.1 postgresql-python.i386 0:8.1.9-1.el4s1.1 postgresql-test.i386 0:8.1.9-1.el4s1.1
Dependency Installed: mx.i386 0:2.0.5-3 postgresql-server.i386 0:8.1.9-1.el4s1.1 postgresqlclient7.i386 0:7.4.17-1.el4s1.1 tcl.i386 0:8.4.7-2
Dependency Updated: dovecot.i386 0:1.0-1.2.rc15.el4.sme postgresql-libs.i386 0:8.1.9-1.el4s1.1
Complete!
==============================================================
WARNING: You now need to run BOTH of the following commands
to ensure consistent system state:

signal-event post-upgrade; signal-event reboot

You should run these commands unless you are certain that
yum made no changes to your system.
==============================================================
I signalled the post-upgrade event, and rebooted.




Then started the postgresql server:
Code: [Select]
[root@www ~]# /etc/init.d/postgresql start
Quote
Initializing database:                                     [  OK  ]
Starting postgresql service:                               [  OK  ]




and followed the instructions to make the necessary custom templates:
Code: [Select]
[root@www ~]# mkdir -p /etc/e-smith/templates/var/lib/pgsql/data
[root@www ~]# mkdir -p /etc/e-smith/templates-custom/var/lib/pgsql/data
[root@www ~]# cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates/var/lib/pgsql/data
[root@www ~]# cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates/var/lib/pgsql/data
[root@www ~]# cp /var/lib/pgsql/data/postgresql.conf /etc/e-smith/templates-custom/var/lib/pgsql/data
[root@www ~]# cp /var/lib/pgsql/data/pg_hba.conf /etc/e-smith/templates-custom/var/lib/pgsql/data

I then logged as postgres user:
Code: [Select]
[root@www ~]# su postgres
and had a go at the next series of commands, but
Code: [Select]
bash-3.00$ psql -U postgres -d template1gave me
Quote
could not change directory to "/root"
Welcome to psql 8.1.9, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
       \h for help with SQL commands
       \? for help with psql commands
       \g or terminate with semicolon to execute query
       \q to quit
which looks suspiciously like it didn't work properly but I went for it anyway:
Code: [Select]
template1=# alter user postgres with encrypted password 'verysecretpassword';
ALTER ROLE
template1=# \q
bash-3.00$ exit

I made the rest of the changes as per the wiki, but after rebooting and trying to access postgres with the new password:
Code: [Select]
[root@www data]# su postgresI get
Quote
bash-3.00$ psql -U postgres -d template1
psql: FATAL:  missing or erroneous pg_hba.conf file
HINT:  See server log for details.

So, I have a few questions.

1) Where does psql keep its log files? (Nothing obvious in /var/log)
2) Why does it kick up a "missing or erroneous pg_hba.conf file"?
3) What's with the dovecot error, and why is my webmail now showing 0 messages?

Any help on this would be much appreciated.

TIA

Pete

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Fluffed Postgres 8 install on 7.2. Dovecot issues too.
« Reply #1 on: November 20, 2007, 05:09:46 PM »
When you have rebooted, postgres is already runing. You have started again.
I don't know if it is possible to run more than one instances of postgres. To ensure, reboot you server, and stop postgres.
Code: [Select]
/etc/init.d/postgresql stop
Remove all the content of /var/lib/pgsql/data/*
Remove the templates files:
/etc/e-smith/templates/var/lib/pgsql/data/postgresql.conf
/etc/e-smith/templates/var/lib/pgsql/data/pg_hba.conf
/etc/e-smith/templates-custom/var/lib/pgsql/data/postgresql.conf
/etc/e-smith/templates-custom/var/lib/pgsql/data/pg_hba.conf

Start again postgres, and follow the wiki from "Start postgres" section.
« Last Edit: November 20, 2007, 05:14:22 PM by Normando »

Offline Cosmyn

  • *
  • 12
  • +0/-0
Postgres 8 install on 7.1.3 issues
« Reply #2 on: December 04, 2007, 11:46:46 AM »
Hi,

    Postgres replace mysql ?
    After installing Postgres i can no longer access my folders in webmail. When i try to create the folder it does not appear in folder list and second time i try it says "mailbox already exists" but still not allow me to access it. Also i can no longer connect to phpmyadmin.
    Also i have a question about certificates: where are they keept in /home/e-smith/ or in /etc/httpd or both ? And when my certificate expire - how do i renew it?


Thank you

Offline purpaboo

  • ***
  • 48
  • +0/-0
    • http://www.kush-t.co.uk
Re: Fluffed Postgres 8 install on 7.2. Dovecot issues too.
« Reply #3 on: December 04, 2007, 12:21:04 PM »
I still haven't got PostgreSQL to work properly, but to bring back all the mail folders I did (as root):
Code: [Select]
yum clean all
yum update
signal-event post-upgrade; signal-event reboot
And then logged into my mail via IMAP in Mozilla Thunderbird.

YMMV

Pete

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Fluffed Postgres 8 install on 7.2. Dovecot issues too.
« Reply #4 on: December 06, 2007, 08:01:41 AM »
I have never see this issue. Some people have no problem with postgres:

http://forums.contribs.org/index.php?topic=39212.0
http://forums.contribs.org/index.php?topic=39003.0

About dovecot your server is not up to date, but this is ok.

The yum output with a new and updated server give me:

Quote
postgresql              i386       8.1.9-1.el4s1.1  centosplus        2.7 M
 postgresql-contrib      i386       8.1.9-1.el4s1.1  centosplus        414 k
 postgresql-devel        i386       8.1.9-1.el4s1.1  centosplus        1.1 M
 postgresql-docs         i386       8.1.9-1.el4s1.1  centosplus        5.6 M
 postgresql-pl           i386       8.1.9-1.el4s1.1  centosplus         66 k
 postgresql-python       i386       8.1.9-1.el4s1.1  centosplus         63 k
 postgresql-test         i386       8.1.9-1.el4s1.1  centosplus        1.1 M
Installing for dependencies:
 mx                      i386       2.0.5-3          base              569 k
 postgresql-server       i386       8.1.9-1.el4s1.1  centosplus        3.8 M
 postgresqlclient7       i386       7.4.17-1.el4s1.1  centosplus        235 k
 tcl                     i386       8.4.7-2          base              897 k
Updating for dependencies:
 postgresql-libs         i386       8.1.9-1.el4s1.1  centosplus        183 k

Offline Cosmyn

  • *
  • 12
  • +0/-0
Re: Fluffed Postgres 8 install on 7.2. Dovecot issues too.
« Reply #5 on: December 11, 2007, 06:33:04 AM »
I`ve done that yum update and i still can`t access my e-mail folders. If I delete them and in re-create them in webmail options, I get this error: Folder created but not subscribed. And the settings it is not remembered so after I press "save options" i can no longer access the folder (error is "mailbox already exists").
What else can I do? I really need that Webmail !

Thank you

PS: It is not user related. All users have same problem in webmail.

Offline Normando

  • *
  • 841
  • +2/-1
    • Unixlan
Re: Fluffed Postgres 8 install on 7.2. Dovecot issues too.
« Reply #6 on: December 11, 2007, 06:48:49 AM »
Please, after each update, execute this two commands:

Code: [Select]
signal-event post-upgrade
signal-event reboot