<div dir="ltr">This doesn't exactly answer your question, but directly referencing your map file in the URL is discouraged because it's a potential security issue. The "best practice" is to create an alias to each of your map files. For mapserv >= 8.0 that can be done in the mapserver.conf file, for example:<div> MAP</div><div> foo1 "/path/to/foo1.map</div><div> foo2 "/path/to/foo2.map</div><div> END</div><div>or for mapserv < 8.0 it can be done in the Apache config:</div><div> SetEnv foo1 "/path/to/foo1.map"</div><div> SetEnv foo1 "/path/to/foo1.map"</div><div>And then "best practice" is to block access to map files on the file system with </div><div> MS_MAP_NO_PATH "1"</div><div>which is done in the mapserver.conf or the Apache conf depending on mapserv version.</div><div><br></div><div>If you still want to reference map files in the http request I believe they are relative to the mapserv binary (I'm saying this from memory, so I might be wrong). So you could put a symlink in your cgi-bin/ to /path/to/mapfiles/ but I think that's a terrible idea.</div><div><br></div><div>Rich</div><div><br></div><div><br><div><br></div></div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Mar 20, 2025 at 9:37 AM Rob Dennett via MapServer-users <<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="msg6285733804245592347">
<div dir="ltr">
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Is there a way to set a sort of document root for .map files and other files .map files might reference? For example, my .map files are found at the root of an S3 bucket and we're trying to use an EFS volume instead. Our URLs currently look like</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<a href="https://www.ourOrg.com/cgi-bin/mapserv/?map=/foo.map&." target="_blank">https://www.ourOrg.com/cgi-bin/mapserv/?map=/foo.map&.</a>..</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Where foo.map lives in the root of the s3 bucket. With the new system we want, it will live at the root of the EFS volume, but with that volume mounted in a different directory in the docker container where MapServer runs, e.g. /ourOrg_mapserver. The file
system in the container is </div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
/ourOrg_mapserver/foo.map</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
There are many existing URLs in our client apps as well as 3rd party customer apps which use the above URL. Is there a way to set up mapserver so that /ourOrg_mapserver acts like an Apache document root so that existing stuff won't need to change?</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Thanks,</div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
Rob</div>
</div>
_______________________________________________<br>
MapServer-users mailing list<br>
<a href="mailto:MapServer-users@lists.osgeo.org" target="_blank">MapServer-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</div></blockquote></div><div><br clear="all"></div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr">Richard W. Greenwood<br><a href="http://www.greenwoodmap.com" target="_blank">www.greenwoodmap.com</a></div></div>