I need to know how to set qgis-server environment variables, because I can't find a good explanation of how this works here on the SE or in the documentation. The specific environment variable I am trying to set is QGIS_SERVER_PARALLEL_RENDERING
.
I have searched within many directories that contain the miscellaneous workings of qgis-server and Apache 2, but it doesn't seem to be located within any .cfg/.ini files I have found.
I don't think it matters much, but I'm running Ubuntu Desktop 21.04, qgis and qgis-server 3.2, and Lizmap 3.4.4.
pic 1 shows the variables, but not how to set them
qgis server documentation page
pic 2 explains what happens without explaining what happens confusion #2
1 Answer 1
Considering, you deployed QGIS Server with Apache FCGI (If other approaches, recipe/answer would change)
You can set the environment variable within Apache configuration file with
FcgidInitialEnv QGIS_SERVER_PARALLEL_RENDERING "1"
You can inspect this sample code for an example in context
Two ways to find out the answer:
Simple one:
Go to https://github.com and do a search using keyword
QGIS_SERVER_PARALLEL_RENDERING
like this url https://github.com/search?q=QGIS_SERVER_PARALLEL_RENDERINGThen, on the left, click on "Code" to get an url like https://github.com/search?p=2&q=QGIS_SERVER_PARALLEL_RENDERING&type=Code
Then, inspect results to try to find relevant samples
Complex one:
If already familiar with Apache, looking at https://docs.qgis.org/3.16/en/docs/server_manual/plugins.html#http-server-configuration that mentioned below
FcgidInitialEnv QGIS_PLUGINPATH "/var/www/qgis-server/plugins"
and see that QGIS_PLUGINPATH
was mentioned in https://docs.qgis.org/3.16/en/docs/server_manual/config.html#environment-variables to guess how to use QGIS_SERVER_PARALLEL_RENDERING
. Must admit this way is not easy.
Explore related questions
See similar questions with these tags.