2

I have the same problem described in this question, with the difference that I am using NGINX for Lizmap and QGIS Server, and that I used a python virtual environment to install the QGIS-Plugin-Manager. Debian Linux (Raspbian Lite on Raspberry Pi 4).

Could it be that "QGIS Server returns an HTTP error about the Lizmap plugin: Unknown", because the plugin is sort of "hidden" inside inside the virtual environment? I tried also running QGIS Server with the same .conf file and port as Lizmap with a location /qgisserver. which did not help.

Listing the QGIS Plugins inside the virtual environment:

(pvenv) m.hackenberg@raspberrypi:/usr/lib/qgis/plugins $ qgis-plugin-manager list
Cannot check version with PyQGIS, check your QGIS installation or your PYTHONPATH
Current user : m.hackenberg
PYTHONPATH=None
List all plugins in the current working directory : /usr/lib/qgis/plugins

Your https://plugins.qgis.org remote is not using a dynamic QGIS version.
Instead of
'https://plugins.qgis.org/plugins/plugins.xml?qgis=3.22'
in your 'sources.list' file, you should have
'https://plugins.qgis.org/plugins/plugins.xml?qgis=[VERSION]'

Can you remove the file sources.list ? 'qgis-plugin-manager init' will regenerate it using dynamic QGIS version if QGIS is well configured.
This is only a warning, the process will continue with the hardcoded QGIS version in your 'sources.list' file.

-----------------------------------------------------------------------------------------------------------------
|  Folder ⬇   |  Name       |  Version  |  Flags  |  QGIS min  |  QGIS max  |  Author  |  Folder rights     |  Action ⚠  |
-----------------------------------------------------------------------------------------------------------------
|lizmap_server|Lizmap server|2.8.1      |Server   |3.10        |3.99        |3Liz      |m.hackenberg : 0o755|   |
-----------------------------------------------------------------------------------------------------------------

output of qgis-server status:

Jan 07 10:28:23 raspberrypi spawn-fcgi[715]: 10:28:23 INFO ./src/server/qgsserverplugins.cpp[715]: load library /usr/lib/qgispython (3.22.16)
Jan 07 10:28:23 raspberrypi spawn-fcgi[715]: 10:28:23 INFO ./src/server/qgsserverplugins.cpp[715]: Python support library loaded successfully.
Jan 07 10:28:32 raspberrypi spawn-fcgi[715]: <string>:1: DeprecationWarning: setapi() is deprecated
Jan 07 10:28:33 raspberrypi spawn-fcgi[715]: 10:28:33 INFO Server[715]: No server python plugins are available

This is my NGINX .conf file in /etc/nginx/sites-available/:

server {
    listen 80;
    root /var/www/html/lizmap;
    index index.php index.html index.htm;

    # compression setting
    gzip_vary on;
    gzip_proxied any;
    gzip_comp_level 5;
    gzip_min_length 100;
    gzip_http_version 1.1;
    gzip_types text/plain text/css application/json application/javascript text/xml >

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ [^/]\.php(/|$) {
       fastcgi_split_path_info ^(.+\.php)(/.*)$;
       set $path_info $fastcgi_path_info; # because of bug http://trac.nginx.org/ngi>
       try_files $fastcgi_script_name =404;
       include fastcgi_params;

       fastcgi_index index.php;
       fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
       fastcgi_param PATH_INFO $path_info;
       fastcgi_param PATH_TRANSLATED $document_root$path_info;
       fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
       fastcgi_param SERVER_NAME $http_host;
   }
}

And this is the file for QGIS Server:

upstream qgis-server_backend {
   server unix:/var/run/qgis-server-1.sock;
   server unix:/var/run/qgis-server-2.sock;
   server unix:/var/run/qgis-server-3.sock;
   server unix:/var/run/qgis-server-4.sock;
}

server {
    listen 8081;
    root /var/www/html/qgis;
    index index.php index.html index.htm;

    location / {
        try_files $uri $uri/ =404;
 }

    location ^~ /qgisserver {
         gzip           off;
         include        fastcgi_params;
         fastcgi_pass   unix:/var/run/qgisserver.socket;
    }
}

Both QGIS Server and Lizmap are working. The WMS URL is set to

http://77.64.216.135:8081/qgisserver.

QGIS Desktop on my Laptop is version 3.22, QGIS on the Raspberry Pi version 3.22.16. I am not sure how to get the version of QGIS-Server, but I am pretty sure that it is 3.22 as well. Can this somehow be fixed, or should I try to run QGIS-Server on apache2 and use NGINX with reverse proxy?

if $QGIS_SERVER_LIZMAP_REVEAL_SETTINGS; then echo 'var is 0'; fi

returns var is 0 after booting the server and all the other environment variables like QGIS_PLUGIN_PATH are empty as well.

6
  • so no more errors ?
    – R. Martin
    Commented Jan 8 at 15:05
  • I managed to set the environment variable using apache for QGIS Server (and NGINX for Lizmap). But with that setup, I get "the specified configuration cannot be used" in the desktop plugin. With the NGINX-only setup, I can actually see my QGIS projects in the Lizmap interface, just not display them. Commented Jan 9 at 7:51
  • looks like somehow the lizmap_server plugin isn't available, did you set QGIS_SERVER_LIZMAP_REVEAL_SETTINGS ( fastcgi_param QGIS_SERVER_LIZMAP_REVEAL_SETTINGS True;) ?
    – R. Martin
    Commented Jan 9 at 8:59
  • Yes, I have set it in /etc/systemd/system/qgis-server.service, /etc/qgis-server/env, /etc/nginx/fastcgi_params and in the .../sites-available/.conf file inside the brackets of location /qgisserver{} Commented Jan 9 at 10:36
  • on Lizmap Administration "Server Information Panel" > does the QGIS server is fully responding (<host>/admin.php/admin/server_information) ?
    – R. Martin
    Commented Jan 9 at 10:55

1 Answer 1

0

I managed to set the environment variables with QGIS running on apache2 (behind NGINX reverse proxy, Lizmap still on NGINX).

Lizmap "Configuration cannot be used"

Still I would like to know what I missed for the fastcgi_param environment variables to work with nginx.

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.