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

Alessandro Pasotti apasotti at gmail.com
Wed Apr 15 03:50:19 PDT 2020


On Wed, Apr 15, 2020 at 12:41 PM Richard Duivenvoorde
<rdmailings at duif.net> wrote:
>
> 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?

Yes, it's a full standalone HTTP development server.

> 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....

try calling it with '-h'

>
> 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.

No: that's not correct.

qgis_mapserver binary is NOT a CGI module, it is a full HTTP
(development) server. It listens on port 8000 by default (it should
print it on stdout when it starts).

As I said, I didn't test it on windows so I don't even know if that
works, work fine on Linux though.

>
> 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.

No! Don't use the development server in production. Is is a very naive
50 lines of code HTTP server implementation.

>
> 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
>
>


-- 
Alessandro Pasotti
w3:   www.itopen.it


More information about the Qgis-user mailing list