Just set up my MapServer on Ubuntu - all good. Downloaded this tutorial and it works fine: http://download.osgeo.org/mapserver/docs/mapserver-tutorial.zip
I've tried adding a PostGIS layer to the map, without success - can anyone help me. Here is the map file:
MAP
IMAGETYPE PNG
CONFIG "MS_ERRORFILE" "/tmp/ms_error.txt"
DEBUG 5
EXTENT 11.8496964862307 55.5990839999999 13.02463 57.8704279999999
SIZE 400 300
SHAPEPATH "../data"
IMAGECOLOR 255 255 255
# Layer objects are defined beneath the map object. You need at least one
# layer defined in your map file before you can display a map... You can
# define as many layers as you'd like although a limit is typically hard-coded
# in map.h in the MapServer source. The default limit is set at 100. You'd
# have to have a very specialized application to need more than 100 layers in
# your application.
# Start of LAYER DEFINITIONS ---------------------------------------------
LAYER # States polygon layer begins here
NAME states
DATA states_ugl
STATUS OFF
TYPE POLYGON
# The class object is defined within the layer object. You can define as
# many classes as you need (well, there are limits as with layers, but it's
# senseless to define more than ten on a "normal" layer. There are
# situations, however, where you might have to do it.)
CLASS
NAME "The Upper Great Lakes States"
# There are styles in a class, just like there are classes in a layer,
# just like there are layers in a map. You can define multiple styles in
# a class just as you can define multiple classes in a layer and multiple
# layers in a map.
STYLE
COLOR 232 232 232
OUTLINECOLOR 32 32 32
END
END
END # States polygon layer ends here
LAYER
CONNECTIONTYPE postgis
NAME "plats"
DEBUG 5
# Connect to a spatial database
CONNECTION "user=postgres dbname=test host=localhost password=xxxxx"
#PROCESSING "CLOSE_CONNECTION=DEFER"
# Get the lines from the 'geom' column of the 'plats' table
DATA "geom from plats"
STATUS OFF
TYPE POLYGON
CLASS
NAME "Plats"
# There are styles in a class, just like there are classes in a layer,
# just like there are layers in a map. You can define multiple styles in
# a class just as you can define multiple classes in a layer and multiple
# layers in a map.
STYLE
COLOR 232 232 232
OUTLINECOLOR 32 32 32
END
END
END
# End of LAYER DEFINITIONS -------------------------------
END # All map files must come to an end just as all other things must come to...
the debug output wasn't much help ...
[Fri Mar 14 19:28:07 2014].610665 CGI Request 1 on process 8022
[Fri Mar 14 19:28:07 2014].611179 msDrawMap(): rendering using outputformat named png (AGG/PNG).
[Fri Mar 14 19:28:07 2014].611200 msDrawMap(): WMS/WFS set-up and query, 0.000s
[Fri Mar 14 19:28:07 2014].611318 msDrawMap(): Layer 0 (states), 0.000s
[Fri Mar 14 19:28:07 2014].611336 msDrawMap(): Drawing Label Cache, 0.000s
[Fri Mar 14 19:28:07 2014].611343 msDrawMap() total time: 0.001s
[Fri Mar 14 19:28:07 2014].616884 msSaveImage(stdout) total time: 0.006s
[Fri Mar 14 19:28:07 2014].616976 mapserv request processing time (msLoadMap not incl.): 0.006s
[Fri Mar 14 19:28:07 2014].616989 msFreeMap(): freeing map at 0x8211eb8.
[Fri Mar 14 19:28:07 2014].617015 freeLayer(): freeing layer at 0x821a130.
[Fri Mar 14 19:28:07 2014].617025 msPostGISLayerIsOpen called.
Can anyone help?
OFF
, you need to request the layer explicitly if the layer is set to off I think.