[MapServer-users] How to create aliases on mapserver docker image camptocamp/mapserver?

Marcin Niemyjski mniemyjski at cloudferro.com
Mon Jan 9 02:12:56 PST 2023


Steve,

after trying to connect to WMS using https://geo.cloudferro.com/ogc/wms/Sentinel2Ukraine I recive:

Instead of the capabilities string that was expected, the following response has been received:

<HTML>
<HEAD><TITLE>MapServer Message</TITLE></HEAD>
<!-- MapServer version 8.0.0 OUTPUT=PNG OUTPUT=JPEG OUTPUT=KML SUPPORTS=PROJ SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS SUPPORTS=RSVG SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WFS_CLIENT SUPPORTS=WCS_SERVER SUPPORTS=SOS_SERVER SUPPORTS=OGCAPI_SERVER SUPPORTS=FASTCGI SUPPORTS=GEOS SUPPORTS=PBF INPUT=JPEG INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE INPUT=FLATGEOBUF -->
<BODY BGCOLOR="#FFFFFF">
msCGILoadMap(): Web application error. CGI variable "map" is not set.
</BODY></HTML>

any idea on this one?

Thanks,
Marcin




[cid:cfca5ef3-fccc-4e97-ad09-4a6b9b820144]<https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature>           Book time to meet with me<https://outlook.office.com/bookwithme/user/6347c7def05a478ba013ae948648789d@cloudferro.com?anonymous&ep=signature>
________________________________
From: Lime, Steve D (MNIT) <steve.lime at state.mn.us>
Sent: Friday, January 6, 2023 4:50 PM
To: Marcin Niemyjski <mniemyjski at cloudferro.com>; Marcin Niemyjski via MapServer-users <mapserver-users at lists.osgeo.org>
Subject: RE: How to create aliases on mapserver docker image camptocamp/mapserver?


What isn’t working with the configuration you have in place on docker? The locations aren’t virtual hosts so they’d be sharing a mapserver config file. The config file support will fall back to an environment variable if the value isn’t set explicitly in the config file – we get that for free with the CPL functions being used. So, at first glance it seems like having a custom value for MS_MAPFILE based on location should work assuming you don’t have that value set in the mapserver config file.



From: MapServer-users <mapserver-users-bounces at lists.osgeo.org> On Behalf Of Marcin Niemyjski via MapServer-users
Sent: Thursday, January 5, 2023 5:46 AM
To: Marcin Niemyjski via MapServer-users <mapserver-users at lists.osgeo.org>
Subject: [MapServer-users] How to create aliases on mapserver docker image camptocamp/mapserver?





________________________________

Hello,



I'm using camptocamp mapserver docker image. I want to create Aliases so I can access several mapfiles using their file names,



example: www.service.pl/WMSNo1<http://www.service.pl/WMSNo1> instead of www.service.pl<https://gcc02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.service.pl%2F&data=05%7C01%7Csteve.lime%40state.mn.us%7C2d095d4e751240e1742808daef12621c%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C638085159479253733%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=6htBeD8jSSlM6UEANoVIQFUSFR3oQHYl%2F%2FQL3JCh97c%3D&reserved=0>?map=/etc/mapserver/WMSNo1.map.



Could you please provide me an example of how to edit /etc/apache2/apache2.conf to make it work?



On regular Mapserver I'm using this as alias and it works just fine:

Alias /Sentinel2Ukraine "/usr/lib/cgi-bin/mapserv"

<Location /Sentinel2Ukraine >

   SetHandler cgi-script

   Options ExecCGI

   SetEnv MS_MAPFILE "/DyskPlanetiler/MAPFILEs/automatyzacja/Sentinel2Ukraine.map"

</Location>



On camptocamp I created somthing similiar to code above:



Alias /Sentinel2Ukraine "/usr/local/bin/mapserv"

<Location /Sentinel2Ukraine >

        SetHandler cgi-script

        Options ExecCGI

        SetEnv MS_MAPFILE "/etc/mapserver/Sentinel2Ukraine.map"

</Location>



Alias /Sentinel2Poland "/usr/local/bin/mapserv"

<Location /Sentinel2Poland >

        SetHandler cgi-script

        Options ExecCGI

        SetEnv MS_MAPFILE "/etc/mapserver/Sentinel-2-PL.map"

</Location>



Best,

Marcin



[cid:image001.png at 01D921B4.154084C0]<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Foutlook.office.com%2Fbookwithme%2Fuser%2F6347c7def05a478ba013ae948648789d%40cloudferro.com%3Fanonymous%26ep%3Dsignature&data=05%7C01%7Csteve.lime%40state.mn.us%7C2d095d4e751240e1742808daef12621c%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C638085159479253733%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=pm6EgkSTxCH%2Fe9Ht44OvJShOVjNR2JbBMGwSvF3f3Tk%3D&reserved=0>

Book time to meet with me<https://gcc02.safelinks.protection.outlook.com/?url=https%3A%2F%2Foutlook.office.com%2Fbookwithme%2Fuser%2F6347c7def05a478ba013ae948648789d%40cloudferro.com%3Fanonymous%26ep%3Dsignature&data=05%7C01%7Csteve.lime%40state.mn.us%7C2d095d4e751240e1742808daef12621c%7Ceb14b04624c445198f26b89c2159828c%7C0%7C0%7C638085159479409085%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=X8XCOdQDaHr%2BwCXgeoyshmg5ErqGIMIda6dy7uthFfo%3D&reserved=0>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20230109/ef4d04c9/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 528 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20230109/ef4d04c9/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-ncnwmudk.png
Type: image/png
Size: 528 bytes
Desc: Outlook-ncnwmudk.png
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20230109/ef4d04c9/attachment-0003.png>


More information about the MapServer-users mailing list