[Mapserver-users] WMS Client on IIS with MS_MAPFILE variable problem
David Graham
dgraham at i3.com
Thu Jul 31 08:36:22 PDT 2003
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
--
David W. Graham
Director of Geospatial Applications Development
information integration and imaging, LLC
201 Linden St, Third Floor
Fort Collins, CO 80524
(970) 482-4400
dgraham at i3.com
http://www.i3.com
More information about the MapServer-users
mailing list