[mapserver-users] Remote PostGIS server connection problem

Matej Mailing mailing at tam.si
Thu Aug 23 06:02:08 PDT 2012


Hi,

I am running 6.0.1 on a FreeBSD host. Everything works perfect when I
connect to the local PostGIS server (located on the same machine as
the Mapserver is running on). When I try to connect to the PostGIS
server that is not in the same network, I get the following error:
"msDrawMap(): Image handling error. Failed to draw layer named
'LAYER_NAME'. msPostGISLayerOpen(): Query error. Database connection
failed (could not connect to server: Permission denied Is the server
running on host "IP" and accepting TCP/IP connections on port 5432? Is
it allowing connections? Does the specified user exist? Is the
password valid? Is the database on the standard port?

1. I can connect to the server IP on port 5432 via paql from console
from the machine where Mapserver is running.
2. When doing tcpdump dst 5432 on the PostGIS server that is outside,
I see no traffic comming in so basically when the error is displayed
it is not due to remote server settings.

I was browsing on the web and found out that people that were using
SELinux had to enable the option httpd_can_network_connect. It seems
like the Apache is not allowed to initiate a remote connection to a
non-local IP address. Is it the Apache limitation? Is it the OS
limitation or is it the Mapserver limitation (I am pretty sure that it
isn't, but I don't know where to look anymore ...)

After pulling my hair for several hours any help or idea would be very
welcome :-)

TIA,
Matej


More information about the mapserver-users mailing list