[Qgis-user] qgis-web-client and updating existing project files

Larry Shaffer larrys at dakotacarto.com
Mon Jul 7 21:32:02 PDT 2014


Hi Niklaas,

Hmm. It should be invalidating the related cache entries to the project,
when the project file has changed:
https://github.com/qgis/QGIS/blob/master/src/mapserver/qgsconfigcache.cpp#L36

Seems like just refreshing your browser after each project file save should
do the trick. You may have to close the project file in QGIS Desktop, or
your file editor, if editing it by hand. Some of this may not work on every
platform.

If that fails, it should be reported as an issue. In the meantime...

Since you are running Nginx already, you can spawn the qgis_mapserv.fcgi
process independently and use Nginx's fastcgi_module [0] to pass the
request on to your spawned process. This allows you to specifically
re-start the qgis_mapserv process without affecting any other web server
process. Restarting the process should invalidate its cache and re-parse
your project file. However, the project refresh noted above may just work
anyway, when using spawn-fcgi (untested).

You can use various tools to spawn the qgis_mapserv process, but I prefer
either spawn-fcgi [1] or uWSGI [2]. spawn-fcgi is the simplest to
integrate; here is an example [3].

The user/group you run spawn-fcgi under will need access to the QGIS
project file (and data directories, if any) that you specify with the MAP
request parameter.

[0] http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
[1] http://redmine.lighttpd.net/projects/spawn-fcgi/wiki/WikiStart
[2] http://projects.unbit.it/uwsgi/
[3] http://wiki.habariproject.org/en/Installation_using_Nginx

Regards,

Larry Shaffer
Dakota Cartography
Black Hills, South Dakota


On Sat, Jul 5, 2014 at 2:43 PM, Niklaas Baudet von Gersdorff <
niklaas at kulturflatrate.net> wrote:

> Hi,
>
> I am wondering, whether there is an elegant way of configuring the
> qgis-web-client in a way that it is refreshing (or regenerating) the
> images of a project file on /every/ attempt displaying the corresponding
> project file. This would make testing or experimenting with the desktop and
> web application much much easier. I have already been asking this question
> at [1] but got the answer that I shall try restarting Apache2. In fact,
> this works (I can see the changes I made to a file after an update) but, in
> my opinion, this is not an
> elegant solution.
>
>     1: http://gis.stackexchange.com/q/78423/19375
>
> I have also already asked at the IRC channel but haven't had any luck. I
> also did a web search but neither found a solution. I also had a look at
> the documentation of mod_fcgid at [2] but did not find anything promising
> unfortunately. My understanding of Apache2 (and mod_fcgid) is also quite
> limited.
>
>     2: http://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
>
> Can anybody think of a setting in the configuration of Apache2 (or
> qgis-web-client) that changes the behaviour of 'caching' or 'buffering'
> (if it is called that way) to not 'cache' or 'buffer' anything at all?
>
> Maybe it is worth mentioning that our Server is running NGINX primarily.
> So I configured a proxy that is forwarding everything to the Apache2 server
> listening at 8008. (I am also wondering whether NGINX is caching something
> and I need to change anything there but since it is configured acting as a
> proxy I would suggest that it's not NGINX caching anything at all. Since
> restarting Apache2 leads to refreshing of the generated images I am quite
> sure that it's Apache2 and not NGINX buffering anything.)
>
> Any help is very much appreciated.
>
> All the best,
>
> --
> Niklaas Baudet von Gersdorff
> niklaas at kulturflatrate.net
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20140707/16e8d6fc/attachment.html>


More information about the Qgis-user mailing list