Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] phppgadmin: login failed
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 607
Location: Switzerland

PostPosted: Fri Jun 18, 2010 8:19 pm    Post subject: [SOLVED] phppgadmin: login failed Reply with quote

Hi
I have installed apache2, php, and postgres.
My web application can log in to my postgres data base
and read and manipulate data there.

But when i log in to phppgadmin with the exact same user
and password as in my web application i always get 'login failed'

My /var/www/localhost/htdocs/phppgadmin/conf/config.inc.php is 'out of the box'
and i have 2 pg_hba.conf instances (both identical, and 'out of the box'):
Code:

-rw------- 1 postgres postgres 3652 Jun 13 20:32 /usr/local/pgsql/data/pg_hba.conf
-rw------- 1 postgres postgres 3652 Jun 12 19:10 /var/lib/postgresql/8.4/data/pg_hba.conf
Their content:
Code:
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
# IPv6 local connections:
host    all         all         ::1/128               trust


Has anybody got a suggestion for me?

Thank You in advance
Jody


Last edited by jody on Fri Jun 25, 2010 1:52 pm; edited 1 time in total
Back to top
View user's profile Send private message
PeGa!
Tux's lil' helper
Tux's lil' helper


Joined: 13 May 2005
Posts: 104
Location: Capital Federal, Buenos Aires, Argentina

PostPosted: Sun Jun 20, 2010 3:44 am    Post subject: Reply with quote

Can you log in as the root postgres user? If not, watch for the config file -- phppgadmin doesn't allow root access for security reasons. Once solved that issue, log in as root, and verify the database permissions for that user in particular.

Regards,

Paul.
_________________
If it moves, it needs an ebuild.

Adopt an unanswered post.
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 607
Location: Switzerland

PostPosted: Sun Jun 20, 2010 9:30 am    Post subject: Reply with quote

Hi

I changed 'extra_login_secutirty' to false in /var/www/localhost/htdocs/phppgadmin/conf/config.inc.php
Code:
      $conf['extra_login_security'] = false;


But even so my postgres user can't log in to phppgadmin.

Anway, i think the database permission are in order, because all my db-users
can log in through psql or in my php-script by means of 'pg_connect'

Jody
Back to top
View user's profile Send private message
titanofold
Developer
Developer


Joined: 30 Dec 2003
Posts: 235
Location: Bryson City, NC USA

PostPosted: Thu Jun 24, 2010 12:08 pm    Post subject: Reply with quote

Which connection method is phppgadmin utilizing? A Unix socket or localhost?
_________________
The best things in life are free.
Guy-1: Surely, you will fold with me...
Guy-2: Alright, but don't call me Shirley
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 607
Location: Switzerland

PostPosted: Thu Jun 24, 2010 12:57 pm    Post subject: Reply with quote

Hi titanofold
Quote:
Which connection method is phppgadmin utilizing? A Unix socket or localhost?

Would this be a setting in a configuration file? (if yes which one?)

Thank You
Jody
Back to top
View user's profile Send private message
titanofold
Developer
Developer


Joined: 30 Dec 2003
Posts: 235
Location: Bryson City, NC USA

PostPosted: Thu Jun 24, 2010 1:03 pm    Post subject: Reply with quote

jody wrote:
Hi titanofold
Quote:
Which connection method is phppgadmin utilizing? A Unix socket or localhost?

Would this be a setting in a configuration file? (if yes which one?)

Thank You
Jody


Yes, in phppgadmin's config file. You told it where the server is located. (Something along the lines of 'host = . . . .')

If you didn't specify a host, then it'll use the Unix socket to communicate with the server . . . maybe.

You must have told phppgadmin where to find the server, so where did you tell it the server was located?
_________________
The best things in life are free.
Guy-1: Surely, you will fold with me...
Guy-2: Alright, but don't call me Shirley
Back to top
View user's profile Send private message
jody
l33t
l33t


Joined: 16 Oct 2007
Posts: 607
Location: Switzerland

PostPosted: Fri Jun 25, 2010 1:52 pm    Post subject: Reply with quote

hi
thanks for your reply.

I checked the config file ' config.inc.php' and changed the relevant entry from
Code:
    // Hostname or IP address for server.  Use '' for UNIX domain socket.
    // use 'localhost' for TCP/IP connection on this computer
    $conf['servers'][0]['host'] = '';
to
Code:
$conf['servers'][0]['host'] = 'localhost';
and now i
can log in to phppgadmin.

Thanks again
Jody
Back to top
View user's profile Send private message
titanofold
Developer
Developer


Joined: 30 Dec 2003
Posts: 235
Location: Bryson City, NC USA

PostPosted: Sat Jun 26, 2010 3:13 am    Post subject: Reply with quote

If you want to utilize the Unix domain socket, you'll have to add the apache system user to the postgres system group.

Code:
usermod -a -G postgres apache


As only users in the postgres system group can read/write from/to the socket.
_________________
The best things in life are free.
Guy-1: Surely, you will fold with me...
Guy-2: Alright, but don't call me Shirley
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
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