I set up WMS server using MapServer, and the following requests work:



I also tried to use the WMS that I serve in a map file, added the WMS in the following way:

  NAME         hydro
  TYPE         RASTER
  STATUS       ON
  CONNECTION "http://localhost:8081/cgi-bin/mapserv.exe?"  

    "wms_srs" "EPSG:4326"
    "wms_name" "hydro"
    "wms_server_version" "1.1.1"
    "wms_format" "image/jpeg"

Then requested it with the following URL: http://localhost:8081/cgi-bin/mapserv.exe?map=/ms4w/apps/tutorial/htdocs/example1-7.map&layer=hydro&mode=map

However, I only see a blank image.

Looks like this is the way, see http://mapserver.org/ogc/wms_client.html#wms-client & http://demo.mapserver.org/cgi-bin/mapserv?map=/osgeo/mapserver/tutorial/htdocs/example1-7.map&layers=states+states_label+modis_jpl&mode=map. Here modis_jpl is not visible too, but in the map file its status is off, this can be the reason.

Any idea on what I am doing wrong here?

2 Answers 2


Any idea on what I am doing wrong here?

You need to remove the mode=map parameter from your requests if you want to have MapServer provide a WMS.

  • As I am truly a beginner in MapServer, I am trying to follow the MapServer tutorial. So, in the example 2.5 (demo.mapserver.org/cgi-bin/mapserv?map=/osgeo/mapserver/…) a remote WMS is attempted to be used (modis_jpl - "Daily MODIS Image"). But I cannot see it. In any case I added my local WMS layer in the map file and edited the HTML and HTML template. Still nothing.
    – Eylül
    Commented Feb 27, 2017 at 12:31
  • Mapserver can through a single map file be configured to provide multiple types of service. Your title suggests that you have a client that operates on a WMS, but if your requests to the server include the mode=map parameter then you will not get a WMS response. To see if you have configured your map file correctly as a WMS try using a client such as QGIS to consume the service. In your map file set the DEBUG level to 4, and look at the logs if things don't work
    – nmtoken
    Commented Feb 27, 2017 at 13:42

A PROJECTION must be set in the mapfile for the MAP unless you are sure that all your WMS layers support only a single projection which is the same as the PROJECTION of the map. The MAP PROJECTION can be set using "init=epsg:xxxx" codes or using regular PROJ parameters. Failure to set a MAP PROJECTION may result in blank maps coming from remote WMS servers (because of inconsistent BBOX+SRS combination being used in the WMS connection URL).


This is an exemple: https://mapserver.org/tutorial/example1-7.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.