[Mapserver-users] WMS Client on IIS with MS_MAPFILE variable problem
Palle Due Larsen
palle at mail-online.dk
Thu Jul 31 12:06:20 PDT 2003
Here is what I would do:
Make an asp script i.e. mapserv.asp. Pass it all the parameters
mapserver needs + a service parameter. Have all the services stored in
a configuration file, that says which mapfile goes with which service.
Have all map files stored outside the website. Pass all parameters,
except the service parameter on to mapserver + the map parameter. Grab
the output, and pass it back.
We do something similar with a perl script, it's quite easy in perl, it
could be harder using asp.
Best regards
Palle Due Larsen
Carl Bro GIS&IT
-----Original Message-----
From: Daniel Morissette <morissette at dmsolutions.ca>
To: David Graham <dgraham at i3.com>
Cc: mapserver-users at lists.gis.umn.edu
Date: Thu, 31 Jul 2003 13:19:46 -0400
Subject: Re: [Mapserver-users] WMS Client on IIS with MS_MAPFILE
variable problem
> Here are two more suggestions:
>
> 1- Try setting MS_MAPFILE globally in your server to a relative path,
> e.g. MS_MAPFILE = local.map
> then create one scripts directory per WMS service. Each directory
> will contain only a copy of mapserv.exe plus the local.map for that
> WMS
> service. When you access mapserv.exe in each script directory it
> will
> load the local.map in that directory since MS_MAPFILE is a relative
> path.
>
> 2- If you are setup to compile mapserv.exe you could produce custom
> executables for each WMS service in which you would hardcode the
> mapfile
> path.
>
> 3- A better long-term solution could be to enhance mapserv.exe so
> that
> if you rename it to for instance mywms1.exe then it looks for a
> mapfile
> with the same basename (mywms1.map) in a directory specified using an
> environment variable such as MS_MAPFILE_PATH. So to setup a new WMS
> service you would simply make a copy of mapserv.exe under the name of
> the new WMS service in your scripts directory.
>
> Daniel
>
>
>
> 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
> >
> >
>
> _______________________________________________
> Mapserver-users mailing list
> Mapserver-users at lists.gis.umn.edu
> http://lists.gis.umn.edu/mailman/listinfo/mapserver-users
Få en gratis emailkonto her: www.mail-online.dk
-----------------------------------------------
Deltag i en lille konkurrence på nettet, og
vind et gavekort på 50.000 kroner...
KLIK HER: www.directoffice.dk/konkurrence
More information about the MapServer-users
mailing list