Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I took a look at this question/answer, and although helpful, it did not solve my issue.

After spending the last couple days on this, I am confused as to why I'm getting:

msWMSGetCapabilities(): WMS server error. WMS request not enabled. Check wms/ows_enable_request settings

I've tried

"wms_enable_request" "*"

along with

"ows_enable_request" "*"

both in METADATA under WEB and METADATA under LAYER

As for my URL, I am using:

http://192.168.2.164/cgi-bin/mapserv.exe?map=/data2/html/OL_AllWorldAirports/catest.map&SERVICE=WMS&REQUEST=GetCapabilities

I initially had the VERSION set too (to 1.1.1) but I read somewhere this is not a necessity.

/tmp/mapserver3.log is not providing much help.

In regards to how the mapfile(s) and data are set up:

-I have one mapfile which has one layer. Within that layer, I reference another mapfile. The mapfile (catest.map) being referenced uses an OGR connection and connects to a .db file.

See here for the mapfiles: https://gist.github.com/DavidPardy/5911943

Any input is greatly appreciated. I feel that I'm close and have some glaring error somewhere, but not sure where to pinpoint it.

share|improve this question
    
have you tried another kind of connection? Postgis perhaps? –  Gery Jul 2 '13 at 19:48
    
Hi @Gery, no I have not. If possible I'd like to try and get this working with what I have. –  DfnD Jul 2 '13 at 20:50
    
Hi David, I use mapserver but never tried db formats, so not sure if that's the problem, that's why if you try other connections you can know if your mapfile works well or not, and see if the db file is the problem. –  Gery Jul 2 '13 at 21:01
    
Understood @Gery, appreciate the quick reply. I have had lots of success using db files in the past. The long term goal for this is to use OpenLayers getFeatureInfo to get data from the db on onclicks and hover with the mouse. I should add that I tried catest.map through a php file and the data is displaying correctly. –  DfnD Jul 2 '13 at 21:03
add comment

3 Answers

Looks like the mapfile you are specifying in the URL, catest.map, does not have the ows_request_enabled inside the WEB - METADATA section. So WMS is not enabled for that mapfile.

You have the metadata entries in your main_mapfile.map. You need these in your catest.map mapfile.

share|improve this answer
    
Thank you @MICHAEL SMITH, I will look into this when I get home. –  DfnD Jul 2 '13 at 23:21
add comment

Seems like I was making the issue much more complicated than it needed to be.

In my mapfile, I now have:

WEB
  METADATA
    "wms_title" "Customer Airports"
    "wms_onlineresource" "http://192.168.2.164/cgi-bin/mapserv.exe?"
    "wms_enable_request" "*"
    "wms_srs" "EPSG:4326"
    "wms_feature_info_mime_type" "text/html"
    "wms_format" "image/png"
  END
END

For the layer within the same mapfile:

LAYER
  NAME CustomerAirports
  DEBUG 5
  TYPE ANNOTATION
  CONNECTIONTYPE OGR
  CONNECTION 'CustomerAirports.db'
  DATA 'Airports'
  STATUS ON
  TEMPLATE "d_template.html"
  DUMP TRUE
  TOLERANCE 3
  METADATA
    "wms_title" "IATA"
    "wms_srs" "EPSG:4326"
    "wms_server_version" "1.1.1"
  END
  LABELITEM "ICAO"
  CLASS
    STYLE
      SYMBOL 'Airport'
      COLOR 0 0 0
      SIZE 6
    END
    STYLE
      SYMBOL 'Airport'
      COLOR  0 0 255
      SIZE 4
    END
    LABEL
      FONT "andalewt"
      TYPE truetype
      ENCODING "UTF-8"
      SIZE 9
      POSITION AUTO
      PARTIALS FALSE
      COLOR 8 29 118
      OFFSET 1 1
      PRIORITY 10
      BUFFER 0
      FORCE OFF
    END # LABEL
   END

   PROJECTION
     "init=epsg:4326"
     "proj=latlong"
     "ellps=WGS84"
     "datum=WGS84"
   END
 END

Outside the layer I also set the projection.

As for the html/php file:

var cust = new OpenLayers.Layer.WMS("CustomerAirports",
"http://192.168.2.164/cgi-bin/mapserv.exe?map=/data2/html/OL_AllWorldAirports/ca.map",
{layers: ['CustomerAirports']}, {wrapDateLine: true});

As for the toggle/js, I just took that from the OL example online.

share|improve this answer
add comment

place this in your map file under MAP > WEB:

METADATA 
    WMS_ENABLE_REQUEST "*" 
END
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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