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


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


You can inspect this sample code for an example in context

Two ways to find out the answer:

Simple one:

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.