0

I'm trying to run a MapServer 5/PostGIS installation on a Centos 6 virtual machine. I deployed MapServer in my cgi-bin folder, but now when I query (using firefox) mapserv file with the url [virtual machine local IP]/cgi-bin/mapserv?MAP=/var/www/cgi-bin/[...], all I get is an image with the following error message on it :

msDrawMap(): Image handling error. Failed to draw layer named '[name of my layer]'.;msPostGISLayerOpen(): Query error. Database connection failed (FATAL: ident authentification failed for user "foo") with connect string 'user=foo dbname=foo password=foo host=localhost port=5432'

I tried to change setting in pg_hba.conf with no luck. foo database can be accessed with foo as sql user and foo as password using psql command. What can I do ?

Vao Tsun
  • 47,234
  • 13
  • 100
  • 132
MattOnyx
  • 172
  • 12

1 Answers1

1

accordong to http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html change ident to md5 for user foo in hba.conf

Obtain the operating system user name of the client by contacting the ident server on the client and check if it matches the requested database user name. Ident authentication can only be used on TCP/IP connections. When specified for local connections, peer authentication will be used instead. See Section 19.3.5 for details.

you can check which hba you use by psql to your db and running show hba_file ;

Vao Tsun
  • 47,234
  • 13
  • 100
  • 132
  • I already have this line in pg_hba.conf : `local all all md5` But it doesn't help. – MattOnyx May 23 '16 at 12:09
  • from this error: `FATAL: ident authentification failed for user "foo"` you don't hit your line in hba.conf. is it the first in order? – Vao Tsun May 23 '16 at 12:16
  • 1
    Ok I found the answer. The problem was that I was looking for enabling access for a local access or a 127.0.0.1 host. Actually, I had to use the IPv6 localhost like this : `host foo foo ::1/128 md5`. Thanks for your help :) – MattOnyx May 23 '16 at 12:25