Introduction
In this exercise you will learn how to set up the software MapServer as a Web Map Service using the Open Geospatial Consortium's OWS standards, from data stored in a PostGIS database. Make sure you have executed and understood the setup instructions for MapServer in the previous "Preparation" section before starting this exercise!
A Web Map Service produces maps of georeferenced data. A "map" is just a visual representation of geodata; a map is not the data itself. These maps are generally rendered in a pictorial format such as PNG, GIF or JPEG, or occasionally as vector-based graphical elements in Scalable Vector Graphics (SVG) or PDF, WebCGM and other formats.
In these exercises we'll use the software called MapServer for implementing the WMS. MapServer is an Open Source (OS) application for constructing spatially enabled web sites. It builds upon several existing popular OS libraries ((e.g., Proj4, GDAL/OGR) and runs on *nix systems (Linux/Unix/MacOSX) as well as Windows. It was originally developed in 1994 at the University of Minnesota (USA), funded by NASA. It can be connected to numerous spatial data stores: Vector support is built--in for Shapefiles, ArcSDE , Oracle Spatial and PostGIS, with the OGR module supporting many other formats. Raster support goes through the GDAL module supporting more than 30 formats (e.g., TIFF/GeoTIFF, EPPL7, ECW, Erdas). It can be set up to deliver data according to the following OGC specifications: WMS, WFS (not WFS--T), WCS and SLD.
MapServer is a so--called Common Gateway Interface (CGI) application, a standard for interfacing external applications with web servers. Executed on basis of an URL Request sent to the web server, it is able to provide dynamic/real time information.

One configures the MapServer CGI service by creating a MAP file, a text file with the .map
suffix that defines an object tree in a hierarchical structure. You will learn how to set up such map files in the next section. To get an overall view about the MapServer .map 'language', take a look at the "MapFile Reference" at the mapserver website in http://mapserver.org/documentation.html