[mapserver-users] MapServer Environment Variables and IIS

Jeff McKenna jmckenna at gatewaygeomatics.com
Mon Feb 9 08:02:39 PST 2015


On 2015-02-09 10:30 AM, geographika wrote:
> Hi list,
>
> There seems to be an issue with running FastCGI under IIS 7.5 and
> environment variables used by MapServer. I need to point to a
> curl-ca-bundle.crt file to access a remote WFS server, and it appears
> this can only be set using an environment variable named CURL_CA_BUNDLE.
>
> In brief, if I run the following from the command line:
>
> mapserv -nh
> "QUERY_STRING=map=C:\Mapserver\apps\test\test.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities"
>
> My error log contains
>
> [Mon Feb 09 14:47:29 2015].66000 HTTP: Starting to prepare HTTP requests.
> [Mon Feb 09 14:47:29 2015].66000 Using CURL_CA_BUNDLE=curl-ca-bundle.crt
>
> If I run
> http://localhost/mapserver/?map=C:\Mapserver\apps\test\test.map&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities
> in the browser the "Using CURL_CA_BUNDLE" line does not appear and my
> certs are not found.
> It appears this is not limited to this variable - setting MS_ERRORLOG as
> a system variable is also ignored.
>
> I have checked that the variables are available  using a Python script
> running in IIS. I've also tried setting up custom environment variables
> for the FastCGI app, played with all sorts of permissions, but no luck.
>
> Tamas's blog mentions:
>
> "The main issue here is that most of the libararies use *getenv *to
> retrieve the environment setting, which operates only on the data
> structures accessible to the run-time library (msvcrt) and not on the
> environment "segment" created for the process by the operating system."
>
> http://blog.gisinternals.com/2010/12/daily-built-binary-packages-for.html
>
> However I'm not sure what the workaround here is exactly.
> This issue appears to have come up before on the list -
> http://lists.osgeo.org/pipermail/mapserver-users/2014-February/075983.html
> Any help appreciated.
>
> Regards,
>
> Seth
>
> --
> web:http://geographika.co.uk
> twitter: @geographika
>
>
>
>

MS4W sets that environment variable through an Apache directive; for IIS 
clients using MS4W, I always make sure to set System (not User) 
environment variables, and always always reboot the server manually 
after setting these variables (for some reason, whenever I set this up 
with MS4W on IIS I have to reboot the client's server for IIS to "see" 
them).

-jeff


-- 
Jeff McKenna
MapServer Consulting and Training Services
http://www.gatewaygeomatics.com/







More information about the mapserver-users mailing list