[Qgis-user] QGIS and Mango

Collin Coe CoeC at vanburencountymi.gov
Thu Feb 22 12:06:05 PST 2024


Chris,

Thank you so much for all the additional information, to be honest a lot of it is quite a bit over my head, but I will use it to hopefully point our folks at Mango down the right path.

It is good to have a second set of eyes verify what we thought, that our Apache/QGIS server is in fact serving this WMS data, but that Mango is just formatting their requests incorrectly.

Thanks!



  [cid:96ec8907-5332-44ab-a948-e13217d99e07]



  [Facebook] <https://www.facebook.com/VanBurenCountyMI/>     [LinkedIn] <https://www.linkedin.com/company/van-buren-county-government>     [Twitter] <https://twitter.com/VanBurenCoMI>

Collin Coe

IT Operations Manager

Van Buren County Information Services

a:

219 E. Paw Paw St, Suite 202

Paw Paw, MI 49079

t:

269-657-8266 ext. 1248

f:

269-657-8297

w:

https://www.vanburencountymi.gov<https://www.vanburencountymi.gov/>  e: coec at vanburencountymi.gov<mailto:coec at vanburencountymi.gov>

Need to meet with me? Book a meeting or check my availability with this link: Microsoft Bookings<https://outlook.office365.com/owa/calendar/CollinCoePersonalBookings@VanBurenCo.onmicrosoft.com/bookings/>

________________________________
From: chris hermansen <clhermansen at gmail.com>
Sent: Thursday, February 22, 2024 2:42 PM
To: Collin Coe <CoeC at vanburencountymi.gov>
Cc: qgis-user at lists.osgeo.org <qgis-user at lists.osgeo.org>
Subject: Re: [Qgis-user] QGIS and Mango

This email was sent from outside your organization. Please use caution when clicking links or opening attachments.
________________________________
Collin and list,

On Thu, Feb 22, 2024 at 10:19 AM Collin Coe <CoeC at vanburencountymi.gov<mailto:CoeC at vanburencountymi.gov>> wrote:
Thank you for your response, see my answers below.


  *
Note "the server understands the request but refuses to authorize it".
     *
That was my thought, as if I shut the Apache service down, the request times out instead.

  *
Looking at your URL, it appears your request doesn't go directly to the QGIS server, but rather goes to mangomap.com<https://urldefense.com/v3/__http://mangomap.com__;!!PO4-HVKE-L9l8-c!hPRhCbuNMimPUluNMhaOjOJgXVTDfVBj1JPev1G7lPbcxJRAJ-TJ3tF3MBfmcrEf2zi3lwhtSo22EFtbSFQ2WPE90Tv8$> (it is "mangomap" and not "mangomaps", correct?).
     *
The URL that we program into Mango is below, the one from the error is what I assume is Mango reformatting the URL behind the scenes as it presents in their UI to me. Note this URL is something that Mango advised us to use for the call on our server. We have tried it with the one specified in the below question as well to the same results.
        *
https://wms.vanburencountymi.gov/cgi-bin/qgis_mapserv.fcgi.exe?service=WMS&request=GetCapabilities&version=1.3.0

If I try to access this URL with curl I get an error, I suppose because no parameters are specified:

 $ curl 'https://wms.vanburencountymi.gov/cgi-bin/qgis_mapserv.fcgi.exe?service=WMS&request=GetCapabilities&version=1.3.0'
<?xml version="1.0" encoding="UTF-8"?>
<ServerException>Layer(s) not valid</ServerException>
$

        *

  *
Is your qgis server / apache server / network policy set up to accept requests from outside your network?
     *
It is. We have tested with ARCGIS and it is able to pull in the WMS data fine with the below URL
        *
https://wms.vanburencountymi.gov/cgi-bin/qgis_mapserv.fcgi.exe?service=WMS&request=GetCapabilities&version=1.3.0&crs=EPSG:3857&map=VBCWMS1.qgz&layers=APTEST

If I try to access this URL with curl I get stuff:

$ curl 'https://wms.vanburencountymi.gov/cgi-bin/qgis_mapserv.fcgi.exe?service=WMS&request=GetCapabilities&version=1.3.0&crs=EPSG:3857&map=VBCWMS1.qgz&layers=APTEST'
<?xml version="1.0" encoding="utf-8"?>
<WMS_Capabilities version="1.3.0" xsi:schemaLocation="http://www.opengis.net/wms<https://urldefense.com/v3/__http://www.opengis.net/wms__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARspbQVfKg$> http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd<https://urldefense.com/v3/__http://schemas.opengis.net/wms/1.3.0/capabilities_1_3_0.xsd__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARsuBDJvaM$> http://www.opengis.net/sld<https://urldefense.com/v3/__http://www.opengis.net/sld__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARshj82gO1$> http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd<https://urldefense.com/v3/__http://schemas.opengis.net/sld/1.1.0/sld_capabilities.xsd__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARsiCRAGUo$> http://www.qgis.org/wms<https://urldefense.com/v3/__http://www.qgis.org/wms__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARstKjFNDB$> https://wms.vanburencountymi.gov/cgi-bin/qgis_mapserv.fcgi.exe?MAP=VBCWMS1.qgz&SERVICE=WMS&REQUEST=GetSchemaExtension" xmlns:sld="http://www.opengis.net/sld<https://urldefense.com/v3/__http://www.opengis.net/sld__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARshj82gO1$>" xmlns:qgs="http://www.qgis.org/wms<https://urldefense.com/v3/__http://www.qgis.org/wms__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARstKjFNDB$>" xmlns="http://www.opengis.net/wms<https://urldefense.com/v3/__http://www.opengis.net/wms__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARspbQVfKg$>" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance<https://urldefense.com/v3/__http://www.w3.org/2001/XMLSchema-instance__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARshfzYrkg$>">
 <Service>
  <Name>WMS</Name>
  <Title>VBCWMS1</Title>
  <KeywordList>
   <Keyword vocabulary="ISO">infoMapAccessService</Keyword>
  </KeywordList>
  <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink<https://urldefense.com/v3/__http://www.w3.org/1999/xlink__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARsq3bDQSW$>" xlink:type="simple" xlink:href="https://wms.vanburencountymi.gov/cgi-bin/qgis_mapserv.fcgi.exe?MAP=VBCWMS1.qgz"/>
  <Fees>conditions unknown</Fees>
  <AccessConstraints>None</AccessConstraints>
 </Service>
 <Capability>
  <Request>
   <GetCapabilities>
    <Format>text/xml</Format>
    <DCPType>
     <HTTP>
      <Get>
       <OnlineResource xmlns:xlink="http://www.w3.org/1999/xlink<https://urldefense.com/v3/__http://www.w3.org/1999/xlink__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARsq3bDQSW$>" xlink:type="simple" xlink:href="https://wms.vanburencountymi.gov/cgi-bin/qgis_mapserv.fcgi.exe?MAP=VBCWMS1.qgz&"/>
      </Get>
     </HTTP>
    </DCPType>
   </GetCapabilities>
...
 </Capability>
</WMS_Capabilities>
$

If I try the original you sent to me with curl, I get:

$ curl 'https://mangomap.com/clients/5dfb3952-42b1-11ee-83b6-027d7e0bb32b/coverage_stores/get_wms_layers?wms_source=https%253A%252F%252Fwms.vanburencountymi.gov%252Fcgi-bin%252Fqgis_mapserv.fcgi.exe%253Fservice%253DWMS%2526request%253DGetCapabilities%2526version%253D1.3.0&_=1708610138093<https://urldefense.com/v3/__https://mangomap.com/clients/5dfb3952-42b1-11ee-83b6-027d7e0bb32b/coverage_stores/get_wms_layers?wms_source=https*253A*252F*252Fwms.vanburencountymi.gov*252Fcgi-bin*252Fqgis_mapserv.fcgi.exe*253Fservice*253DWMS*2526request*253DGetCapabilities*2526version*253D1.3.0&_=1708610138093__;JSUlJSUlJSUlJSU!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARslDQ_hMf$>'
<html><body>You are being <a href="https://mangomap.com/sign-in<https://urldefense.com/v3/__https://mangomap.com/sign-in__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARsoQ3U8xI$>">redirected</a>.</body></html>$

which lets me know mangomap.com<https://urldefense.com/v3/__http://mangomap.com__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARsu7Gfk_h$> is doing a redirect as we suspected.  If I try with the curl "follow redirects" switch I am sent to mangomap.com<https://urldefense.com/v3/__http://mangomap.com__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARsu7Gfk_h$>'s login page:

 $ curl -L 'https://mangomap.com/clients/5dfb3952-42b1-11ee-83b6-027d7e0bb32b/coverage_stores/get_wms_layers?wms_source=https%253A%252F%252Fwms.vanburencountymi.gov%252Fcgi-bin%252Fqgis_mapserv.fcgi.exe%253Fservice%253DWMS%2526request%253DGetCapabilities%2526version%253D1.3.0&_=1708610138093<https://urldefense.com/v3/__https://mangomap.com/clients/5dfb3952-42b1-11ee-83b6-027d7e0bb32b/coverage_stores/get_wms_layers?wms_source=https*253A*252F*252Fwms.vanburencountymi.gov*252Fcgi-bin*252Fqgis_mapserv.fcgi.exe*253Fservice*253DWMS*2526request*253DGetCapabilities*2526version*253D1.3.0&_=1708610138093__;JSUlJSUlJSUlJSU!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARslDQ_hMf$>'
<!DOCTYPE html>
<html>
<head>
<title>Sign in to Mango</title>

...

</html>
$

So, so far so good, but not talking to your qgis server yet.

You might find it worthwhile continuing this way with curl, supplying your login credentials, so you can get a bit more information on what's going on.


        *

  *
The text "(anonymous)" appears in the log following.  Could this mean that mangomap.com<https://urldefense.com/v3/__http://mangomap.com__;!!PO4-HVKE-L9l8-c!hPRhCbuNMimPUluNMhaOjOJgXVTDfVBj1JPev1G7lPbcxJRAJ-TJ3tF3MBfmcrEf2zi3lwhtSo22EFtbSFQ2WPE90Tv8$> is trying to access your qgis server as user "anonymous"?
     *
It is trying to access it anonymously, but I will note that ARCGIS also accesses it this way and works fine

  *
When you configure MangoMap(s) to talk to your qgis server, have you entered the necessary credentials (user name and password)?
     *
See above, it is availible anonymously. We will be locking it down with creds eventually, but for testing it is

Got it.

     *

  *
Can you verify that your qgis server is ok to respond to the "getcapabilities" request with the parameters supplied?  Ie maybe try it with curl from inside your network?
     *
This is one spot that I am thinking I am missing. I do have the allowed access type of GET allowed, in fact for testing we have all access types allowed at the moment, but I am not sure that we have set that up properly. Below is a screencap of that part of my Apache config file. I shared that with the Mango folks, and they seen to think it looks good.

We've verified above that your Apache / QGIS configuration is correct using curl to access the URL you provided.  So I don't think you need to tweak things in Apache.

I've pulled the redirect URL out of the mangomap.com<https://urldefense.com/v3/__http://mangomap.com__;!!PO4-HVKE-L9l8-c!hEv2n3Gmchd9UNWt1ZcDY0oAbsr6Rb10ZV94u2DxjFXxQ6oN-l1w1wgM6gy3Lzu-CMBxAd0sgdiCRtHMI5ARsu7Gfk_h$> URL you provided in your first email; it looks like this:

https://wms.vanburencountymi.gov/cgi-bin/qgis_mapserv.fcgi.exe?service=WMS&request=GetCapabilities&version=1.3.0&_=1708610138093

When I try a curl with that, I get a "Layer(s) not valid" exception returned:

$ curl 'https://wms.vanburencountymi.gov/cgi-bin/qgis_mapserv.fcgi.exe?service=WMS&request=GetCapabilities&version=1.3.0&_=1708610138093'
<?xml version="1.0" encoding="UTF-8"?>
<ServerException>Layer(s) not valid</ServerException>
$

So it looks to me like MangoMaps is mangling your calls to getCapabilities.  In particular MangoMaps is not supplying the parameters:

crs=EPSG:3857
map=VBCWMS1.qgz
layers=APTEST

that your working test call supplied, while it is supplying

version=1.3.0
_=1708610138093

Not sure what that "_" parameter is.  Maybe map extent or map centre or something like that, in some kind of fixed format?

So something needs to be adjusted in the MangoMaps config so that it sends the crs, the map and the layers required.

--
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240222/828642c3/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-234w4khc.png
Type: image/png
Size: 20796 bytes
Desc: Outlook-234w4khc.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240222/828642c3/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-Facebook.png
Type: image/png
Size: 1820 bytes
Desc: Outlook-Facebook.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240222/828642c3/attachment-0005.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-LinkedIn.png
Type: image/png
Size: 1796 bytes
Desc: Outlook-LinkedIn.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240222/828642c3/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-Twitter.png
Type: image/png
Size: 1483 bytes
Desc: Outlook-Twitter.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20240222/828642c3/attachment-0007.png>


More information about the QGIS-User mailing list