Previous Next

Thread: SetEnv equivalent in IIS

Last post 10-31-2007 3:53 PM by mvolo. 1 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (2 items)

Sort Posts:

  • 10-30-2007, 6:01 AM

    • jonban
    • Not Ranked
    • Joined on 10-30-2007, 9:43 AM
    • Posts 1
    • jonban

    SetEnv equivalent in IIS

    I'm trying to set up a CGI based application (MapServer WMS), which only came with instructions on how to set it up on Apache and I'm having a hard time transposing those guidelines to IIS6.

    Basically, I need to create a Virtual Directory that redirect to a CGI binary while passing two environment variables to the binary. In Apache, you would place the snippet below in your httpd.conf, but in IIS, I have no idea how to set those environment variables so they would only affect the Virtual Directory. Setting the variables as system envirnoment variables works for the WMS part but unfortunately has unwanted side-effects (eg. unability to use multiple mapfiles)

    Alias /ogc/wms /usr/lib/cgi-bin/mapserv 
      <Location /xx/wms> 
         SetHandler cgi-script 
         SetEnv MS_MAPFILE_PATTERN "^/var/www/wms/xx/xx.map$" 
         SetEnv MS_MAPFILE /var/www/wms/xx/xx.map 
     </Location>

  • 10-31-2007, 3:53 PM In reply to

    • mvolo
    • Top 10 Contributor
    • Joined on 09-17-2003, 1:48 PM
    • Philadelphia, PA
    • Posts 583
    • IIS MVPs
    • mvolo

    Re: SetEnv equivalent in IIS

    Hi Jon,

    Unfortunately I dont believe there is a way to inject custom environment variables into a CGI process.  On IIS7, you can create custom server variables and those will be passed to the CGI, so you an pick them up in the process (if you own the code) and set them.  You cant do that on IIS6.

    Thanks,

    Mike Volodarsky

    Program Manager
    IIS Core Server
    Visit mvolo.com for more inside information on IIS7, IIS and ASP.NET

    This posting is provided "AS IS" with no warranties, and confers no rights.
Page 1 of 1 (2 items)
Page view counter