2

I want to setup a QGIS-Server with plugins on Windows10. I installed QGIS-Server, QGIS-Desktop and XAMPP as the Apache-Server.

I downloaded the HelloServer Plugin, unziped it and put it in my plugins folder to test if it works.

My Apache httpd.conf:

LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule asis_module modules/mod_asis.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
LoadModule authz_host_module modules/mod_authz_host.so
LoadModule authz_user_module modules/mod_authz_user.so
LoadModule autoindex_module modules/mod_autoindex.so
LoadModule cgi_module modules/mod_cgi.so
LoadModule dav_lock_module modules/mod_dav_lock.so
LoadModule dir_module modules/mod_dir.so
LoadModule env_module modules/mod_env.so
LoadModule headers_module modules/mod_headers.so
LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule cache_disk_module modules/mod_cache_disk.so
LoadModule mime_module modules/mod_mime.so
LoadModule negotiation_module modules/mod_negotiation.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_ajp_module modules/mod_proxy_ajp.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
LoadModule socache_shmcb_module modules/mod_socache_shmcb.so
LoadModule ssl_module modules/mod_ssl.so
LoadModule status_module modules/mod_status.so
LoadModule version_module modules/mod_version.so
LoadModule fcgid_module modules/mod_fcgid.so


ServerRoot "C:/xampp/apache"
Listen 80
ServerAdmin postmaster@localhost
ServerName localhost:80

Include "conf/extra/httpd-xampp.conf"

SetEnv QGIS_PREFIX_PATH "C:\OSGeo4W\apps\qgis-ltr"
SetEnv GDAL_DATA "C:\OSGeo4W\share\gdal"
SetEnv PYTHONHOME "C:\OSGeo4W\apps\Python39"
SetEnv PATH "C:\OSGeo4W\bin;C:\OSGeo4W\apps\qgis-ltr\bin;C:\OSGeo4W\apps\Qt5\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem"
SetEnv QT_PLUGIN_PATH "C:\OSGeo4W\apps\qgis-ltr\qtplugins;C:\OSGeo4W\apps\Qt5\plugins"
FcgidInitialEnv QGIS_PLUGINPATH "C:\OSGeo4W\server\plugins"

ScriptAlias /cgi-bin/ "C:/OSGeo4W/apps/qgis-ltr/bin/"

<Directory "C:/OSGeo4W/apps/qgis-ltr/bin">
    SetHandler cgi-script
    AllowOverride None
    Options ExecCGI
    Require all granted
</Directory>

<IfModule mod_fcgid.c>
    RewriteEngine on
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>

My problem is, on this request:

http://localhost/cgi-bin/qgis_mapserv.fcgi.exe?SERVICE=HELLO

I get this respone:

<ServiceExceptionReport xmlns="http://www.opengis.net/ogc" version="1.3.0">
<ServiceException code="Service configuration error">Service unknown or unsupported. Current supported services (case-sensitive): WMS WFS WCS WMTS SampleService, or use a WFS3 (OGC API Features) endpoint</ServiceException>
</ServiceExceptionReport>

And i get this errors in my Apache-Logfile:

[Sun May 22 20:58:41.825564 2022] [cgi:error] [pid 8368:tid 1892] [client ::1:60584] AH01215: Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.\r: C:/OSGeo4W/apps/qgis-ltr/bin/qgis_mapserv.fcgi.exe
[Sun May 22 20:58:41.825564 2022] [cgi:error] [pid 8368:tid 1892] [client ::1:60584] AH01215: Warning 1: Unable to find driver ECW to unload from GDAL_SKIP environment variable.\r: C:/OSGeo4W/apps/qgis-ltr/bin/qgis_mapserv.fcgi.exe
[Sun May 22 20:58:41.825564 2022] [cgi:error] [pid 8368:tid 1892] [client ::1:60584] AH01215: Warning 1: Unable to find driver JP2ECW to unload from GDAL_SKIP environment variable.\r: C:/OSGeo4W/apps/qgis-ltr/bin/qgis_mapserv.fcgi.exe
[Sun May 22 20:58:41.825564 2022] [cgi:error] [pid 8368:tid 1892] [client ::1:60584] AH01215: proj_create_from_database: Cannot find proj.db\r: C:/OSGeo4W/apps/qgis-ltr/bin/qgis_mapserv.fcgi.exe
[Sun May 22 20:58:41.825564 2022] [cgi:error] [pid 8368:tid 1892] [client ::1:60584] AH01215: proj_create_from_database: Cannot find proj.db\r: C:/OSGeo4W/apps/qgis-ltr/bin/qgis_mapserv.fcgi.exe

Does anyone know how to configure the Apache on Windows so QGIS-Server is able to use Plugins?

Solution:
I uninstalled and deleted all of QGIS and all Python versions. Then i reinstalled QGIS-Desktop and Server and in my httpd.conf i changed FcgidInitialEnv to SetEnv and now it works.

6
  • What service are you expecting to be served by http://localhost/cgi-bin/qgis_mapserv.fcgi.exe?SERVICE=HELLO and why? May 22, 2022 at 19:36
  • 1
    HELLO is a service from the HelloServer plugin and should response with "HelloServer!" if everything works fine. It is just to test if the configuration works.
    – Marvin
    May 22, 2022 at 19:45
  • I see! Have you tried with barebone minimal configuration of the webserver? There is so much configuration in your post, it is hard to see what might be the issue. May 23, 2022 at 18:34
  • 1
    OK, i deleted my vhost and edited my httpd.conf to a minimum. With this config WFS and WMS are working, but i have the same error with the plugin.
    – Marvin
    May 24, 2022 at 16:45
  • 1
    The webserver user is an admin user and has full control. My QGIS_PLUGINPATH is set correct and at this path is the folder of the Plugin which contains the .py files.
    – Marvin
    May 24, 2022 at 19:14

1 Answer 1

0

Same behavior on Linux containerized deployment with NGINX. That should be to move param QGIS_PLUGIN PATH from fastcgi_param block at nginx conf file to Dockerfile in same place with other QGIS enviroment variables, it will look like:

ENV QGIS_PLUGINPATH your/plugins/directory/path

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.