Log inUsernamePassword
Log me on automatically each visit    
Register
Register
Log in to check your private messages
Log in to check your private messages
SMS Forum Index » SMS User Support

Post new topic   Reply to topic
postgres and webmin module
View previous topic :: View next topic  
Author Message
baboo
Senior Member


Joined: 04 Sep 2007
Posts: 676

PostPosted: Wed Mar 10, 2010 9:21 pm    Post subject: postgres and webmin module Reply with quote

I installed postgres from extras and postgres webmin module. No error installing.

In webmin clicking on postgres I get this error msg:
The PostgreSQL host configuration file /var/lib/pgsql/data/pg_hba.conf was not found on your system. Maybe PostgreSQL has not been initialised, or your module configuration is incorrect.

I tried to fillout module config but it will not save.

The file pg_hba.conf does not exist.

?

thanks
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Wed Mar 10, 2010 9:36 pm    Post subject: Re: postgres and webmin module Reply with quote

You need to initialize the Postgresql database before you run postgresql.

Code:
su postgres -c "initdb -D /var/lib/pgsql/data"
/etc/rc.d/rc.postgresql start


gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
baboo
Senior Member


Joined: 04 Sep 2007
Posts: 676

PostPosted: Wed Mar 10, 2010 9:45 pm    Post subject: Reply with quote

thanks for reply

the first command to initialize db works. However when trying to start using rc. command I get an error that says root is not allowed to start db. Same thing when trying from webmin.

sh: /etc/rc.d/rc.postgresql: Permission denied

when initializing here is the message at the end:
Success. You can now start the database server using:

postgres -D /var/lib/pgsql/data
or
pg_ctl -D /var/lib/pgsql/data -l logfile start

so do I need to create a user or is this a mistake in config of postgres?
Back to top
View user's profile Send private message
gerasimos_h
Site Admin


Joined: 09 Aug 2007
Posts: 1757
Location: Greece

PostPosted: Wed Mar 10, 2010 9:55 pm    Post subject: Reply with quote

You should have postgres user and group, this is from install script
Code:
if ! grep -q postgres etc/group; then
        groupadd -g 73 postgres
fi
if ! grep -q postgres etc/passwd; then
        useradd -u 73 -g postgres -d /var/lib/pgsql postgres
fi


do a "cat /etc/passwd | grep postgres" & "cat /etc/group | grep postgres"
to check them.
The rc.postgresql uses postgres user for starting the database.
Also there must be an entry in rc.local.

gerasimos_h

_________________
Superb! Mini Server Project Manager
http://sms.it-ccs.com
Back to top
View user's profile Send private message Visit poster's website
baboo
Senior Member


Joined: 04 Sep 2007
Posts: 676

PostPosted: Wed Mar 10, 2010 10:04 pm    Post subject: Reply with quote

aaah - found problem. rc.postgresql was not executable. changed and now works.

thanks for the help. Made you earn your money today Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SMS Forum Index » SMS User Support All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

SMS - Superb! Mini Server Project © 2016
Powered by phpBB © 2001, 2002 phpBB Group
iCGstation v1.0 Template By Ray © 2003, 2004 iOptional