MapServer错误:FATAL:用户“...”的身份验证失败

问题描述:

我试图在Centos 6虚拟机上运行MapServer 5/PostGIS安装。 我部署地图服务器在我的cgi-bin文件夹,但现在当我查询(使用火狐)mapserv文件 与URL [virtual machine local IP]/cgi-bin/mapserv?MAP=/var/www/cgi-bin/[...],我得到的是与它下面的错误消息的图像:MapServer错误:FATAL:用户“...”的身份验证失败

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'

我试图在没有运气的情况下更改pg_hba.conf中的设置。 可以使用psql命令将foo数据库作为sql用户和foo作为密码访问。 我能做什么?

+0

执行'psql'为同一'您使用psql你的数据库运行作为'MapServer'的操作系统用户呢? –

+0

我正在以root用户的身份运行'psql foo -U foo',我不知道那个操作系统用户是否被MapServer使用,以及如何设置它(我是一种UNIX新手)。 – MattOnyx

+0

从你的答案我看os用户无关紧要:)密码只有ASCII码?没有特殊字符? –

accordong到http://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html 变化identmd5用户foohba.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.

您可以检查哪些HBA show hba_file ;

+0

我已经有这一行的pg_hba.conf: '当地所有所有md5' 但没有帮助。 – MattOnyx

+0

从这个错误:'致命:身份验证失败的用户“富”你不打你的行在hba.conf。这是第一个吗? –

+0

好的,我找到了答案。问题是我正在寻找为本地访问或127.0.0.1主机启用访问权限。实际上,我必须像这样使用IPv6本地主机:'主机foo foo :: 1/128 md5'。谢谢你的帮助 :) – MattOnyx