With a bit more work I've answered my own question. It required setup and testing of a new server and then application to the existing server.
What I had done previously with GDAL ... enabled Ubuntu GIS "unstable" repository, installed what looked like the required update to 1.10.0:
sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
sudo apt-get update
sudo apt-get install libgdal1-dev
This reported (seemingly incorrectly) that I was at 1.10.0 via gdal-config --version. What needed to be run:
sudo apt-get install gdal-bin
This got gdalinfo working and correctly reading the raster info from PostGIS with:
gdalinfo "PG:host=localhost port=31600 dbname='wdata' user='postgres' password='****' schema='worldclim' table=bio12_2_5m"
Next step was MapServer:
sudo apt-get install cgi-mapserver
sudo apt-get install mapserver-bin
MapServer is now at 6.4.1 via /usr/lib/cgi-bin/mapserv -v
This got shp2img working like:
shp2img -m worldclim12.map -o worldclim12.png -all_debug 3
And, finally some tweaks to the layer file to make it into a WMS layer for consumption by leaflet:
LAYER
NAME bio12_2_5m
TYPE raster
METADATA
"wms_title" "bio12_2_5m"
"wms_srs" "EPSG:4326"
"wms_enable_request" "*"
"wms_feature_info_mime_type" "text/html"
END
EXTENT -180 -60 180 90
PROJECTION
"init=epsg:4326"
END
STATUS ON
DATA "PG:host=localhost port=31600 dbname='wdata' user='postgres' password='****' schema='worldclim' table='bio12_2_5m'"
PROCESSING "NODATA=-9999"
PROCESSING "SCALE=AUTO"
END
Moral to this story is I could understand more about how the various packages exist in the Ubuntu GIS "unstable" repository. Thus far still seems easier to goto these than build from source.
It's 30-40 seconds to render the image on a webpage so performance will be next.
Best Answer
After hours of compiling, i found my mistake...
Nothing related to compilation. The problem was my mapfile. I had a layer definition that look like :
If i give absolute path in layer definition, mapserver work perfectly. It work with shapefile, but not with ecw. My mistake, SHAPEPATH is rather explicit.