[mapserver-users] Problem with PostGIS layer

Tyler Mitchell TMitchell at lignum.com
Wed Aug 7 07:33:06 PDT 2002


Glad to hear it was simple.  As a side note, for Linux (and others?) that
have Postgres start at boot up (i.e. via /etc/rc.d/init.d/postgres script),
I noticed mine did not startup with the tcp/ip connections allowed.  I
guess I could have edit the postgresql.conf file, but instead I edit the
startup script.  You'll see in the section near the end of the script that
there are some if type statements and then a command to either start, stop
or restart postgres.  I simply added the "-i" option at the end of these
commands.  However, since it uses the pg_ctl command (and not the
postmaster command directly) I had to flag the "-i" as an option to pass to
postmaster, you do this by preceding it with "-o" for option.  Finally, for
example, see the end of the 5th line here as an example.

# Parse command line parameters.
case $1 in
  start)
      $ECHO_N "Starting PostgreSQL: "$ECHO_C
      su - $PGUSER -c "$DAEMON start -D '$PGDATA' -s -l $PGLOG -o -i"
      echo "ok"


|---------+--------------------------------------->
|         |           Thomas Haechler             |
|         |           <thaechl at geo.unizh.ch>      |
|         |           Sent by:                    |
|         |           owner-mapserver-users at lists.|
|         |           gis.umn.edu                 |
|         |                                       |
|         |                                       |
|         |           08/07/2002 05:49 AM         |
|         |                                       |
|---------+--------------------------------------->
  >------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                              |
  |       To:       mapserver-users <mapserver-users at lists.gis.umn.edu>                                                          |
  |       cc:                                                                                                                    |
  |       Fax to:                                                                                                                |
  |       Subject:  Re: [mapserver-users] Problem with PostGIS layer                                                             |
  >------------------------------------------------------------------------------------------------------------------------------|




Many thanks to Dave & Tyler for their help. I am posting this to the
list since I got emails from people with the same problem.

There was actually no problem with the user or permission because for
testing purpose I used the db-admin account. The solution is much more
simple:

I started the postmaster without allowing TCP/IP connetions. This option
is off by default, and since I run the webserver, mapserver and
postgresql on the same machine, I thought it is not necessary.

So for everyone with this problem: make sure to accept TCP/IP
connections. You have 2 possibilities to do this:

1.) use the -i option when starting the postmaster, or

2.) edit the postgresql.conf: tcpip_socket = true



Hope this helps someone else,

Thomy


--

THOMAS HAECHLER

Geographic Information Systems Division
Institute of Geography
University of Zurich
Switzerland

thomas.haechler at geo.unizh.ch








More information about the MapServer-users mailing list