[QGIS-Developer] QGIS server landing page when running as fastcgi?

Richard Duivenvoorde rdmailings at duif.net
Wed Feb 3 13:19:34 PST 2021


On 2/3/21 5:47 PM, Alessandro Pasotti wrote:
>> But I still fail to see the same "QGIS Server Catalog" when I run it in cgi-bin.
>>
>> I do see that in the docker there seems to be some redirection? The config works for localhost/ but I think most peeps will (at least try) first in their local cgi-bin and so will use the url:
>> http://localhost/cgi-bin/qgis_mapserv.fcgi/
>>
> 
> This won't work: the problem is that we can match for `/wfs3/` (for
> the WFS3 landing page) but we cannot match for a simple `/` (for the
> catalog) in a long URL, so the landing page will only show up for an
> URL `/` (it's a landing page after all).
> 
> IMO in a real deployment no one will ever use the path
> /cgi-bin/qgis_mapserv.fcgi without rewriting it so I don't think it's
> a real issue, anyway a possible solution would be to create yet
> another server setting that allows us to specify the base path of the
> server (in your case: `/cgi-bin/qgis_mapserv.fcgi`) so that we can
> prepend it to the match (that would become
> `/cgi-bin/qgis_mapserv.fcgi/`).
> 
> This is the reason for:
> https://github.com/elpaso/qgis-server-docker/blob/production/default.conf#L45

Ok, after removing my /index.html AND using that rewrite rules, I finally get the catalog landing page \o/

But I do not agree with you. QGIS should not force a server to run on / to be able to use/see the catalog page, not even in prototypes/dev environments.
With me for example I always have several other projects (sometimes also needing /) on my machines/laptops.
Most often I want the html/client to start on / and a map/geo/qgisserver is more of a help application...

So contrary to my complaint of the many VARS, I would be in favor or a SERVER_BASE_PATH or so....

(now building master server on my little homeserver to be able to show some things to you/others... but that one I really cannot serv stuff on / ...)

>> If I do:
>>  http://localhost/cgi-bin/qgis_mapserv.fcgi/wfs3/collections?
>> shows me the wfs3 api landing page
>> but
>>  http://localhost/cgi-bin/qgis_mapserv.fcgi/
>> just gives me the OWS xml errors
>>
>> Some other remarks (at least here with me):
>> - the FcgidInitialEnv QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES does not seem to be picked up???
> 
> According to your logs it seems to be picked up:
> 
>> 16:38:51 INFO Server[31098]:   - QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES / '/qgis/server_projects_directories' (Directories used by the landing page service to find .qgs and .qgz projects): '/home/richard/z/21/qgis/qgisserver' (read from ENVIRONMENT_VARIABLE)
> 
> 
>> I only get Feature collections when I put the qgz project files next to the qgis_mapserv.fcgi OR point QGIS to it via the ?map= parameter
>>
>> So yes, if anybody is able to 'just run' QGIS-server on apache, please let me know.
>>
>> NOTE: WMS/WFS/WFS3 is working! It's just that I do not have the "QGIS Server Catalog" landing page etc...

Is there some caching going one? I still get strange results like:

- When using QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES, I do have the landing page on
http://localhost/index.html#/
but then the http://localhost/wfs3 only shows me only the data of the project file I have defined with QGIS_PROJECT_FILE

EVEN if I see the right 4 maps on the catalog page, if I go the the metadata/services/wfs3 I do NOT get the WFS data of that map, but then it seems one of the other (I have 4 maps/projects) always opens, though I see different identifiers like "3286a1aa4483079c3539955ea38f1bd9' below"

I also see:

http://localhost/index.html#/map/3286a1aa4483079c3539955ea38f1bd9
Epic failure
JSON.parse: unexpected character at line 1 column 1 of the JSON data

Is there some heavy caching I should/can invalidate?

Also sometimes I miss 3 (of the 4) map previews... As if there are no requests going. Especially when I zoom in in those thumbnails. If I pan after that the map appears most of the times.


I hope others also start testing (preferably with apache :-) ), I do hope these are not personal issues I have with QGISserver....

Regards & Thanks,

Richard Duivenvoorde


PS: the actual source of all this was a question of another community aspirant QGISserver user, trying to setup QGISserver... 
it's just that I can be rather pitbully when I do not get something to work when I think it should be possible (or others tell me they have) ....







More information about the QGIS-Developer mailing list