[mapserver-users] PostGIS Connection Failure

Paul Ramsey pramsey at cleverelephant.ca
Mon Jun 23 13:27:13 PDT 2014


Centos frequently installs with the firewall enabled. That would block
connections even if you've turned on network connect in
postgresql.conf

P

On Mon, Jun 23, 2014 at 1:21 PM, Krishna Priya Patury
<krishna.patury at gmail.com> wrote:
> Hi There,
>
> I'm getting the below error when I try to access an application uisng
> PostGis. Both the Postgres database and the mapserver installation are on
> the same CentosOS 64 bit VM.
>
> msPostGISLayerOpen(): Query error. Database connection failed(could not
> connect to server: Permission denied Is the server running on
> "localhost"(::1) and accepting TCP/IP connections on port 5432).
>
>
> I know my application works as the same application is working just fine on
> a different installation. On this installation I can connection to the
> database using the same parameters using PSQL and I can generate the image
> just fine using the shp2imp or the running the mapserver directly using
> QUERY_STRING  as below.
>
> shp2img -m mapfile -all_debug 5
> ./mapserver QUERY_STRING='map=xxx etc'
>
> Apache is running under the apache user, and Postgres as postgres but I can
> run the above commands as an apache user and still runs fine.
>
> I am not quite sure at this point why I cannot connect using the
> application. I checked to make sure there are no firewalls enabled.
>
> Below is my pg_bha.conf file entries:
>
> local all all trust
> host all 0.0.0.0/0 trust
>
> In the postgresql.conf file, listen_addresses is set to all:
> listen_addresses='*'
>
> Any advice would be appreciated.
>
> Thanks,
> Krishna.
>
>
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the MapServer-users mailing list