[Qgis-user] QGIS Server installation on Windows via XAMPP

Richard Duivenvoorde rdmailings at duif.net
Wed Apr 15 03:41:23 PDT 2020


On 4/15/20 11:44 AM, Alessandro Pasotti wrote:
> On Wed, Apr 15, 2020 at 11:39 AM Franko Naimarevic

>> What am I missing?
> 
> The web server component (apache or nginx or any other webserver you
> can plug FCGI into).
> 
> FCGI binary is not an HTTP server.

I think Franko does have a running Apache webserver: in XAMPP the A
stands for Apache?

> If you have QGIS 3.12 you can try the standalone development server (I
> have not tested it on windows but it may work), the executable name
> should be qgis_mapserver.exe.

@Allesandro: you say a standalone development server. But (even on
windows) it's not that you run a webserver on port 80 if you run
qgis_mapserver or qgis_mapserver.exe, is it? If I run it here it's
initing all QGIS machinery and ends with:
INFO Server[178177]: No server python plugins are available
seemingly waiting for a connection, but I do not know how....

To make more clear to Franko: QGIS comes with 2 mapservers:
- a fastcgi module and a (simple) (you need mod_fastcgi (or something
like that for it)
- a cgi module: qgis_mapserver.exe is the simple cgi version.

The last one is easiest, IF the environment of apache is ok, you should
be able to put this in your cgi-bin dir of apache.

To set the right environment, you could have a look into the
osgeo4w64\httpd.d\httpd_qgis.conf (which comes with an osgeo4w64 install
of qgis-server) which has most of the apache-config rules you need:

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\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"
DefaultInitEnv QT_PLUGIN_PATH
"C:\OSGeo4W64\apps\qgis\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/ C:\OSGeo4W64/apps/qgis/bin/

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

Off course this should all match your paths, but given this your cgi (or
fastcgi) should be able to find all stuff needed to run qgis-server.

Easiest way for me was to run an apache with modfcgi in it, install
qgis-server with osgeo4w64 and then just 'include' the httpd_qgis.conf
in your httpd.conf

Hope this helps, regards,

Richard Duivenvoorde




More information about the Qgis-user mailing list