[Qgis-user] QGIS3 Server on Windows Server and IIS

Richard Duivenvoorde rdmailings at duif.net
Fri May 10 05:50:23 PDT 2019


On 10/05/2019 13.57, Mats Elfström wrote:
> Hi!
> Thanks for hints.
> I forgot to state a fourth assumption:
> * I believe that there are QGIS users who know how to deploy QGIS Server
> under Windows server, and are willing to share that knowledge.
> 
> Not that somebody would freely volunteer to figure this out for fun.
> This mess is very far from fun.
> 
> I have given Docker a try. First, I had to commission an expensive
> Windows 2016 machine, since Docker will not run on 2012 which all my
> Geodata machines use.
> And where there are no problems with components like PostGIS, Geoserver
> and so on.
> 
> So I installed Docker and was within minutes stuck in a proverbial
> quagmire of missing files, missing rights and whatever. In short, Docker
> did not even initialise properly.
> I will not go there again.
> I fail to see the point of having to run a simple application in a
> virtual Linux machine within a virtual Windows machine. Too many layers
> on that onion.

Do you really (really) need IIS?

Recently to me it was pretty easy to install QGIS-Server in Apache(!) on
Windows using Osgeo4w64 (and I just retested this on my Windows10 virt mach)

From: https://www.apachelounge.com/download/
I downloaded both httpd and the fascgi-module

Unzipped in (proposed/recommended) C:\Apache24

With Osgeo4w64 (in C:\OSGeo4W64) I installed qgis-ltr and
qgis-ltr-server (in 'web').

Note that Osgeo4w64 does not really install apache+qgisserver, but it
creates a working config + qgisserver. You find the conf here:

c:\OSGeo4W64\httpd.d\httpd_qgis-ltr.conf

Copy that one to your
<apache24>/conf
directory, and include it in the main httpd.conf by adding:

Include conf/httpd_qgis-ltr.conf

in your conf/httpd.conf

httpd_qgis-ltr.conf (note the different - and _ ) contains all those
magic environment vars:

DefaultInitEnv O4W_QT_PREFIX "C:\OSGeo4W64/apps/Qt5"
DefaultInitEnv O4W_QT_BINARIES "C:\OSGeo4W64/apps/Qt5/bin"
DefaultInitEnv O4W_QT_PLUGINS "C:\OSGeo4W64/apps/Qt5/plugins"
DefaultInitEnv O4W_QT_LIBRARIES "C:\OSGeo4W64/apps/Qt5/lib"
DefaultInitEnv O4W_QT_TRANSLATIONS "C:\OSGeo4W64/apps/Qt5/translations"
DefaultInitEnv O4W_QT_HEADERS "C:\OSGeo4W64/apps/Qt5/include"
DefaultInitEnv O4W_QT_DOC "C:\OSGeo4W64/apps/Qt5/doc"

DefaultInitEnv PATH
"C:\OSGeo4W64\apps\qt5\bin;C:\OSGeo4W64\bin;C:\OSGeo4W64\apps\qgis-ltr\bin;C:\OSGeo4W64\apps\grass\@grasspath@\bin;C:\OSGeo4W64\apps\grass\@grasspath@\lib;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem"
DefaultInitEnv QGIS_PREFIX_PATH "C:\OSGeo4W64\apps\qgis-ltr"
DefaultInitEnv QT_PLUGIN_PATH
"C:\OSGeo4W64\apps\qgis-ltr\qtplugins;C:\OSGeo4W64\apps\qt5\plugins"
DefaultInitEnv TEMP "C:\Users\richa\AppData\Local\Temp"
DefaultInitEnv PYTHONHOME "C:\OSGeo4W64\apps\Python37"
DefaultInitEnv PYTHONPATH
"C:\OSGeo4W64\apps\Python37;C:\OSGeo4W64\apps\Python37\Scripts"

Alias /qgis-ltr/ C:\OSGeo4W64/apps/qgis-ltr/bin/

<Directory "C:\OSGeo4W64/apps/qgis-ltr/bin/">
    SetHandler fcgid-script
    Options ExecCGI
    # NOTE: this is for Apache 2.2 You need Require for 2.4 !
    #Order allow,deny
    #Allow from all
    Require all granted
</Directory>

I had to remove the "Order ... " part and add the "Require " parth.

But after that I had a working QgisServer (in Apache....)  \o/


Off course, useless if you really need IIS :-( .

But the crux in all this (both in IIS and Apache) is to have all the
proper environment variables and paths in place.

http://www.itopen.it/bulk/qgis3-server

is a very good source for that. Eg vor all he Fcgid variables (talking
Apache here, not sure how this is in IIS):

http://www.itopen.it/bulk/qgis3-server/#/step-16

I would recommend:
- if you can go for Apache on Windows, use that
- if you can go for Linux, use that
- if all that fails: use IIS on Windows

But sorry no experience with that.

Regards,

Richard Duivenvoorde






More information about the Qgis-user mailing list