Bug report #10327
QGIS server does not load files from custom folders
|Affected QGIS version:||2.2.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||18750|
In QGIS desktop it is possible to define custom paths for symbols.
When moving the project to QGIS server, the path is not found.
For complete portability from desktop to server, this should not happen.
Care should be taken for different path styles in different OSs (typically C:\\Something in Windows, /home/somethingelse in *nix).
#2 Updated by aperi2007 - over 7 years ago
A good compatible solution with tomcat is the solution adopted by MapServer for its mapfile (we speak of svg but the question is the same)
For the mapfile mapserver allow to define a
MS_MAPFILE and read it when it start.
I know the SVG paths could be more than one, but there are two kind of solutions:
the first is point the env variable to a file where there is enumerate all the paths.
The second possible solution is to named the env variables with a common prefix and search all the variable having that prefix.
QGIS_SVG_1 = path1
QGIS_SVG_2 = path2
QGIS_SVG_3 = path3
#4 Updated by Radim Blazek over 7 years ago
Because there are potentially many options which may be useful also in server, I added to server support for QGIS_OPTIONS_PATH environment variable which sets path to a directory where settings are stored. It works in the same way as qgis application --optionspath option. Attention that default settings file name on UNIX is QGIS/QGIS2.conf, while with QGIS_OPTIONS_PATH or --optionspath it is QGIS/QGIS2.ini (.conf x .ini).
To specify SVG path for QGIS server you can copy user settings or create settings file, for example /path/to/config/QGIS/QGIS2.ini:
multiple paths are separated by '|' (pipe). Then set environment variable on server, for example apache conf:
SetEnv QGIS_OPTIONS_PATH "/path/to/config/"