[Qgis-user] Changing SVG Search Paths without GUI on Debian Buster | QGIS 3.10.12
STEINER Andreas
asteiner at EUROFUNK.COM
Tue Jan 5 02:35:30 PST 2021
Hello everyone.
I tried to load a QGIS Project which was created on windows. In this project I used a svg symbol "symbol/blue-marker.svg". In the .qgis file the path is also "symbol/blue-marker.svg".
When I start my qgisserver and request the map there are only this ? questions marks because qgis can't find the blue-marker.svg.
[cid:image003.png at 01D6D93C.38A85770]
It should look like this:
[cid:image002.jpg at 01D6D93C.3AD34DC0]
I tried to copy the symbol folder with the symbols to /usr/lib/cgi-bin/ folder where the qgis_mapserv.fcgi file is located. Didn't work.
Then I tried to copy the symbol folder to the location of the .qgis project file. Didn't work.
I researched a little bit and found a command to show me what the default svg paths are:
python3
from qgis.core import QgsApplication
QgsApplication.showSettings()
'Application state:\nQGIS_PREFIX_PATH env var:\t\t/usr/share/qgis/lib/qgis/server\nPrefix:\t\t\nPlugin Path:\t\t\nPackage Data Path:\t/usr/share/qgis/lib/qgis/server/share/qgis\nActive Theme Name:\t\nActive Theme Path:\t/usr/share/qgis/lib/qgis/server/share/qgis/resources/themes//icons/\nDefault Theme Path:\t:/images/themes/default/\nSVG Search Paths:\t\nUser DB Path:\t/usr/share/qgis/lib/qgis/server/share/qgis/resources/qgis.db\nAuth DB Path:\tqgis-auth.db\n'
SVG Search Paths:\t\n
From there I know that my SVG Search Paths are empty.
I can change the variable temporary with:
from qgis.core import QgsApplication
QgsApplication.setDefaultSvgPaths(['/usr/share/qgis/svg'])
but this doesn't help.
I also tried to execute this command when creating the docker image but the SVG Search Paths are also empty after that.
So in my opinion somewhere this variable can be set but I can't find it, also not in the QGIS Environment variables.
Here is my qgis apache2 config:
<VirtualHost *:80>
ServerAdmin webmaster at localhost
ServerName qgis.demo
DocumentRoot /var/www/html
# Apache logs (different than QGIS Server log)
ErrorLog ${APACHE_LOG_DIR}/qgis.demo.error.log
CustomLog ${APACHE_LOG_DIR}/qgis.demo.access.log combined
# Longer timeout for WPS... default = 40
FcgidIOTimeout 120
FcgidInitialEnv LC_ALL "en_US.UTF-8"
FcgidInitialEnv PYTHONIOENCODING UTF-8
FcgidInitialEnv LANG "en_US.UTF-8"
# QGIS log (different from apache logs) see https://docs.qgis.org/testing/en/docs/user_manual/working_with_ogc/ogc_server_support.html#qgis-server-logging
FcgidInitialEnv QGIS_SERVER_LOG_FILE /var/log/qgis/qgisserver.log
FcgidInitialEnv QGIS_SERVER_LOG_LEVEL 0
#FcgidInitialEnv QGIS_PREFIX_PATH /usr/share/qgis/lib/qgis/server
FcgidInitialEnv QGIS_PREFIX_PATH /usr
FcgidInitialEnv QGIS_PLUGINPATH /opt/qgis-server/plugins
FcgidInitialEnv QGIS_DEBUG 0
# default QGIS project
SetEnv QGIS_PROJECT_FILE /home/qgis/projects/world.qgs
# QGIS_AUTH_DB_DIR_PATH must lead to a directory writeable by the Server's FCGI process user
FcgidInitialEnv QGIS_AUTH_DB_DIR_PATH "/home/qgis/qgisserverdb/"
FcgidInitialEnv QGIS_AUTH_PASSWORD_FILE "/home/qgis/qgisserverdb/qgis-auth.db"
# See https://docs.qgis.org/testing/en/docs/user_manual/working_with_vector/supported_data.html#pg-service-file
SetEnv PGSERVICEFILE /home/qgis/.pg_service.conf
FcgidInitialEnv PGPASSFILE "/home/qgis/.pgpass"
# Tell QGIS Server instances to use a specific display number
# FcgidInitialEnv DISPLAY ":99"
# if qgis-server is installed from packages in debian based distros this is usually /usr/lib/cgi-bin/
# run "locate qgis_mapserv.fcgi" if you don't know where qgis_mapserv.fcgi is
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
AllowOverride None
Options +ExecCGI -MultiViews -SymLinksIfOwnerMatch
Order allow,deny
Allow from all
Require all granted
</Directory>
<IfModule mod_fcgid.c>
FcgidMaxRequestLen 26214400
FcgidConnectTimeout 60
</IfModule>
</VirtualHost>
Thanks for helping 😊
Best regards,
Andreas Steiner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210105/79aeb662/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 18419 bytes
Desc: image003.png
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210105/79aeb662/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.jpg
Type: image/jpeg
Size: 5890 bytes
Desc: image002.jpg
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20210105/79aeb662/attachment-0001.jpg>
More information about the Qgis-user
mailing list