[Mapserver-users] WMS Client on IIS with MS_MAPFILE variable problem

Sean Gillies sgillies at frii.com
Thu Jul 31 12:17:13 EDT 2003


On Thursday, July 31, 2003, at 09:36  AM, David Graham wrote:

> Hi everyone:
>
> Here is a tricky one, perhaps someone has solved this problem.  I am 
> no IIS expert, so there may yet be a simple solution to this.
>
> We have some WMS serviers running on Linux and they work fine.  I have 
> hidden the map file with a shell script as suggested in the WMS Server 
> documentation.
>
> [root at commerce1 cgi-bin]# more i3_demo
> #! /bin/sh
>   MS_MAPFILE=/var/www/wms.i3.com/mapfiles/i3demo.map
>   export MS_MAPFILE
>   /var/www/wms.i3.com/bin/mapserv3.7
>
> And it works great.
>
> I now need to perform the same functionality on Windows 2000 using 
> IIS. I searched around to see if I could set an environment variable 
> to be associated with a given script(exe) but could not find a 
> reference or dialog box to set anything.
>
> I then tried windows scripting. I used cscript.exe to execute the 
> following jscript script.
>
> [dave at solar dave]$ more i3image.js
> var WshShell = WScript.CreateObject("WScript.Shell");
> var WshSysEnv = WshShell.Environment("SYSTEM");
> WshSysEnv.Item( "MS_MAPFILE" ) = 
> "N:\\wms_data\\mapfiles\\wms1\\i3_Imagery_wms_service.map";
> WshShell.Run( "C:\\Inetpub\\wwwroot\\wms\\wmsserver.exe", 0, true );
>
> Then I set the IIS to map an empty file I labled wms.i3image to
> C:\WINNT\cscritpt //Nologo <pathto>\i3image.js
>
> After setting up some permissions, this executed but I have no results.
>
> The problem is that the script spawns a new shell and send the output 
> to that shell which is then not related back to IIS.
>
> It also accured to me that the new shell might not even have the 
> inherited the CGI environment, but I have not tested that either.
>
> So my question is has anyone cracked this problem?   I know I could 
> probably do it in perl or python, but I would rather avoid putting 
> another package on the system just for a script this small.  This is 
> supposed to be the first in a bank of machines that will run only 
> Mapserver WMS services with no other applications installed.  The idea 
> is to minimize the amount of software and thus reduce the degredation 
> of the Windows system.
>
> By the way Windows is a prerequisit since we will be serving up a lot 
> of data that is compressed in ECW format.
>
> So if anyone can give me suggestions on how to make this work with 
> Windows 2000 provided technology I would greatly apreaciate it.
>
> Thanks
>
> Dave Graham
>
>
Dave, did you mean to type "WMS Server" in your subject?

Have you thought about setting up a cascading WMS server on Linux?
In your linux mapserver's map file, define a client connection to
your IIS WMS mapserver.  This may not be the highest performance
solution, but it'll get you online without advertising your
mapfile.

Sean


--
Sean Gillies
sgillies at frii dot com
http://www.frii.com/~sgillies




More information about the mapserver-users mailing list