<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi Alberto, <br><br>I can get the capabilities document, & a list of available layers, using the WMS facility in Quantum GIS, but when I try to access/load the layers as a map the request fails:<br><br>"Response: <HTML>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><HEAD><TITLE>MapServer Message</TITLE></HEAD></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><!-- MapServer version 6.0.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=ICONV SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=GEOS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE --></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><BODY BGCOLOR="#FFFFFF"></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">msLoadMap(): Unable to access file. (http://173.236.45.118/home/bicimapas/mapdata/BiciMapasMS.map)</p>
<p style="margin: 0px; text-indent: 0px;"></BODY></HTML>"</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">I suggest that having your mapfile in your home directory tree rather than your webserver's directory tree might be the problem.</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">You might also try tools like uDIG or QGIS to access the WMS service & debug it before you try to get it working with OpenLayers.</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style="margin: 0px; text-indent: 0px;">Cheers,</p><p style="margin: 0px; text-indent: 0px;"><br></p><p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">   Brent Wood<br></p><br><br>--- On <b>Sat, 4/28/12, Alberto Najera <i><anajera@bicimapas.com.mx></i></b> wrote:<br><blockquote style="border-left: 2px
 solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Alberto Najera <anajera@bicimapas.com.mx><br>Subject: RE: [mapserver-users] Open Layers Problem<br>To: mapserver-users@lists.osgeo.org<br>Date: Saturday, April 28, 2012, 11:25 AM<br><br><div class="plainMail">Thanks,<br><br>I used this<br><br><a href="http://173.236.45.118/cgi-bin/mapserv?map=/home/bicimapas/mapdata/BiciMapasM" target="_blank  onclick="return" themainwindow.showlinkwarning(this)"="">http://173.236.45.118/cgi-bin/mapserv?map=/home/bicimapas/mapdata/BiciMapasM</a><br>S.map&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetCapabilities<br><br><br>and now get the capabilities report, which seems to be correct, but still<br>the map does not show with OpenLayers.<br><br>Any ideas?<br><br><br><br><br>Alberto Najera<br>www.bicimapas.com.mx<br>www.bicimapas.com.mx/Empresa.htm<br>Avenida Lomas Verdes No. 58, Local 17<br>Colonia Santa Cruz
 Acatlán<br>Naucalpan, Estado de México<br>México CP 53150<br>Tel: (55) 53 60 30 65<br><a ymailto="mailto:anajera@bicimapas.com.mx" href="/mc/compose?to=anajera@bicimapas.com.mx">anajera@bicimapas.com.mx</a><br> <br>   Búscanos como Bicimapas<br> <br><br><br>-----Mensaje original-----<br>De: Havard Tveite [mailto:<a ymailto="mailto:havard.tveite@umb.no" href="/mc/compose?to=havard.tveite@umb.no">havard.tveite@umb.no</a>] <br>Enviado el: viernes, 27 de abril de 2012 06:17 p.m.<br>Para: Alberto Najera<br>Asunto: Re: [mapserver-users] Open Layers Problem<br><br>Try using the complete (absolute) path to the mapfile.<br><br>Håvard<br><br>On 28/04/12 00:48, Alberto Najera wrote:<br>> I tested the WMS capabilities with this string<br>><br>> <a href="http://173.236.45.118/cgi-bin/mapserv?map=BiciMapasMS.map&SERVICE=WMS&" target="_blank  onclick="return"
 themainwindow.showlinkwarning(this)"="">http://173.236.45.118/cgi-bin/mapserv?map=BiciMapasMS.map&SERVICE=WMS&</a><br>> VERSIO<br>> N=1.1.1&REQUEST=GetCapabilities<br>><br>> and get this message<br>><br>> msLoadMap(): Unable to access file. (BiciMapasMS.map)<br>><br>> Why would the map file not be accessible to openlayers while Mapserver <br>> can access it?  Is it a permissions or a path definition problem?<br>><br>> Any hel os appreciated. Thanks<br>><br>><br>> Alberto Najera<br>><br>><br>> -----Mensaje original-----<br>> De: <a ymailto="mailto:mapserver-users-bounces@lists.osgeo.org" href="/mc/compose?to=mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a><br>> [mailto:<a ymailto="mailto:mapserver-users-bounces@lists.osgeo.org" href="/mc/compose?to=mapserver-users-bounces@lists.osgeo.org">mapserver-users-bounces@lists.osgeo.org</a>] En nombre de
 Alberto <br>> Najera Enviado el: viernes, 27 de abril de 2012 01:19 p.m.<br>> Para: <a ymailto="mailto:mapserver-users@lists.osgeo.org" href="/mc/compose?to=mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>> Asunto: [mapserver-users] Open Layers Problem<br>><br>> Hello<br>><br>> We have a map that is rendered well using the Mapserver template and <br>> are trying to use it with OpenLayers but are experiencing some <br>> problems as the map does not show and I cannot find why.<br>><br>> We are using a Linux Centos 5 remote server and the map file is <br>> located in home/bicimapas/mapdata/BiciMapasMS.map and the Mapserver <br>> CGI  is located in /home/bicimapas/cgi-bin/mapserv. The IP address is  <br>> 173.236.45.118<br>><br>> On the map file we added this Metadata lines under the WEB section<br>><br>> METADATA<br>>      "wms_title"
 "BiciMapasMS"<br>>      "wms_onlineresource"<br>> "<a href="http://173.236.45.118/cgi-bin/mapserv?map=http://173.236.45.118/home/" target="_blank  onclick="return" themainwindow.showlinkwarning(this)"="">http://173.236.45.118/cgi-bin/mapserv?map=http://173.236.45.118/home/</a><br>> bicima<br>> pas/mapdata/BiciMapasMS.map&"<br>>      "wms_srs" "EPSG:4326"<br>>      "wms_enable_request" "*"<br>>      END<br>><br>><br>> And the metadata for the test layer was added like this<br>><br>> LAYER<br>>      NAME "areaurbana"<br>>      DATA "AreasMS"<br>>      STATUS on<br>>      TYPE polygon<br>>      LABELCACHE on<br>>      LABELITEM "NAME"<br>>      CLASSITEM "CATEGORY"<br>>      METADATA<br>> 
     "wms_title" "areaurbana"<br>>      "wms_srs" "EPSG:4326"<br>>      "wms_include_items" "all"<br>>      END<br>> (more code here...........)<br>><br>> Finally, the code being used to make the Openlayers call is:<br>><br>> <!DOCTYPE html><br>> <html lang='en'><br>> <head><br>>      <meta charset='utf-8' /><br>>     <title>Open Layers Test</title>    <br>>      <script type='text/javascript' src="OpenLayers.js"></script><br>>      <script type='text/javascript'><br>><br>>      var map;<br>><br>>     function init() {<br>>          // Setup our map object<br>>          map = new OpenLayers.Map('map_element', {});<br>><br>> 
         // Setup our layer objects<br>><br>>         var layer1 = new OpenLayers.Layer.WMS( 'Area <br>> Urbana','<a href="http://173.236.45.118/cgi-bin/mapserv%27" target="_blank  onclick="return" themainwindow.showlinkwarning(this)"="">http://173.236.45.118/cgi-bin/mapserv'</a>, {layers:<br>'areaurbana',map:<br>> '//173.236.45.118//home/bicimapas/mapdata/BiciMapasMS.map',} );<br>><br>><br>><br>>      //Add layers to the map<br>>      map.addLayer([layer1]);<br>><br>><br>><br>>          // Zoom the map to the max extent<br>>         if(!map.getCenter()){<br>>             map.zoomToMaxExtent();<br>>         }<br>>      }<br>><br>>     
 </script><br>> </head><br>><br>> <body onload='init();'><br>>      <div id='map_element' style='width: 500px; height: 500px;'><br>>     </div><br>> </body><br>> </html><br>><br>> Thanks in advance for your help<br>><br>> Alberto Najera<br><br>_______________________________________________<br>mapserver-users mailing list<br><a ymailto="mailto:mapserver-users@lists.osgeo.org" href="/mc/compose?to=mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br></div></blockquote></td></tr></table>