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

Lime, Steve D (MNIT) steve.lime at state.mn.us
Fri Jan 6 07:50:24 PST 2023


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/20230106/34fe96af/attachment.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/20230106/34fe96af/attachment.png>


More information about the MapServer-users mailing list