Opened 19 years ago

Closed 19 years ago

Last modified 13 years ago

#14 closed defect (wontfix)

Impossible to set MS_MAPFILE on Windows

Reported by: dmorissette Owned by: dmorissette
Priority: high Milestone:
Component: WMS Server Version: 3.5
Severity: normal Keywords:


When using the WMS server we cannot (and don't want to!) pass the mapfile path 
in the URL, that's why the MS_MAPFILE environment variable was added.

This works fine on Unix since we can easily create a shell script that will set 
the variable and then pass control to the mapserv CGI, but on Windows it is not 
that easy to setup a CGI script, and .bat files won't seem to work.

We need to come up with a better way to specify which mapfile to use with the 
WMS server.

Change History (1)

comment:1 Changed 19 years ago by dmorissette

Resolution: wontfix
Status: newclosed
A couple of options have been discussed in order to specify the mapfile for a 
WMS server... some of them work on Windows too, so we'll just close this bug 
without any change to MapServer... just a note in the WMS HOWTO

1- On Unix, use a shell script for each WMS instance:
   #! /bin/sh
   export MS_MAPFILE
   exit 0

2- Include the map= parameter in the OnlineResource URL (wms_onlineresource 
metadata) terminated by "&":
  wms_onlineresource =

3- With Apache, it is possible to use the SetenvIf directive in httpd.conf to 
set the MS_MAPFILE to a different value for each WMS instance (thanks to JF 
Doyon for pointing this!):
  SetEnvIfNoCase Request_URI "/cgi-bin/atlasogcmapper" 

The 3rd option should work with Apache on Windows as well.
Note: See TracTickets for help on using tickets.