Importante
A tradução é um esforço comunitário você pode contribuir. Esta página está atualmente traduzida em 65.28%.
6. Configuração avançada
6.1. Logging
To log requests sent to the server, you have to set the following environment variable:
With the following variables the logging can be further customized:
6.2. Variáveis ambientais
Você pode configurar alguns aspectos do QGIS Server configurando environment variables.
According to the HTTP server and how you run QGIS Server, there are several ways to define these variables. This is fully described in Servidor HTTP Apache.
Name & Description |
Padrão |
Serviços |
|---|---|---|
|
‘’ |
Tudo |
|
‘’ |
Tudo |
|
‘’ |
Tudo |
|
‘’ |
WMS |
|
depende do pacote |
OAPIF/WFS3 |
|
QGIS3 server |
Tudo |
|
10000 |
OAPIF/WFS3 |
|
|
Tudo |
|
50 MB |
Tudo |
|
40 |
Tudo |
|
falso |
WMS |
|
falso |
Tudo |
|
falso |
Tudo |
|
“” |
Tudo |
|
“” |
Tudo |
|
“” |
Tudo |
|
‘’ |
Tudo |
|
0 |
Tudo |
|
falso |
Tudo |
|
falso |
Tudo |
|
-1 |
Tudo |
|
‘’ |
Tudo |
|
falso |
WMS |
|
Tudo |
|
|
filesystem |
Tudo |
|
‘’ |
Tudo |
|
falso |
WMS |
|
falso |
Tudo |
|
‘’ |
WCS |
|
‘’ |
WFS |
|
-1 |
WMS |
|
‘’ |
WMS |
|
‘’ |
WMTS |
|
‘’ |
Tudo |
6.3. Settings summary
When QGIS Server is starting, you have a summary of all configurable parameters thanks to environment variables. Moreover, the value currently used and the origin is also displayed.
Por exemplo com spawn-fcgi:
export QGIS_OPTIONS_PATH=/home/user/.local/share/QGIS/QGIS3/profiles/default/
export QGIS_SERVER_LOG_STDERR=1
export QGIS_SERVER_LOG_LEVEL=2
spawn-fcgi -f /usr/lib/cgi-bin/qgis_mapserv.fcgi -s /tmp/qgisserver.sock -U www-data -G www-data -n
QGIS Server Settings:
- QGIS_OPTIONS_PATH / '' (Override the default path for user configuration): '/home/user/.local/share/QGIS/QGIS3/profiles/default/' (read from ENVIRONMENT_VARIABLE)
- QGIS_SERVER_PARALLEL_RENDERING / '/qgis/parallel_rendering' (Activate/Deactivate parallel rendering for WMS getMap request): 'true' (read from INI_FILE)
- QGIS_SERVER_MAX_THREADS / '/qgis/max_threads' (Number of threads to use when parallel rendering is activated): '4' (read from INI_FILE)
- QGIS_SERVER_LOG_LEVEL / '' (Log level): '2' (read from ENVIRONMENT_VARIABLE)
- QGIS_SERVER_LOG_STDERR / '' (Activate/Deactivate logging to stderr): '1' (read from ENVIRONMENT_VARIABLE)
- QGIS_PROJECT_FILE / '' (QGIS project file): '' (read from DEFAULT_VALUE)
- MAX_CACHE_LAYERS / '' (Specify the maximum number of cached layers): '100' (read from DEFAULT_VALUE)
- QGIS_SERVER_CACHE_DIRECTORY / '/cache/directory' (Specify the cache directory): '/root/.local/share/QGIS/QGIS3/profiles/default/cache' (read from DEFAULT_VALUE)
- QGIS_SERVER_CACHE_SIZE / '/cache/size' (Specify the cache size): '52428800' (read from INI_FILE)
Ini file used to initialize settings: /home/user/.local/share/QGIS/QGIS3/profiles/default/QGIS/QGIS3.ini
In this particular case, we know that QGIS_SERVER_MAX_THREADS and QGIS_SERVER_PARALLEL_RENDERING values are read from the ini file found in QGIS_OPTIONS_PATH directory (which is defined through an environment variable). The corresponding entries in the ini file are /qgis/max_threads and /qgis/parallel_rendering and their values are true and 4 threads.
6.4. Connection to service file
In order to make apache aware of the PostgreSQL service file (see the
PostgreSQL Service connection file section) you need to make
your *.conf file look like:
SetEnv PGSERVICEFILE /home/web/.pg_service.conf
<Directory "/home/web/apps2/bin/">
AllowOverride None
.....
6.5. Adicione fontes ao seu servidor linux
Tenha em mente que você pode usar projetos QGIS que apontam para fontes que podem não existir por padrão em outras máquinas. Isso significa que se você compartilhar o projeto, ele poderá parecer diferente em outras máquinas (se as fontes não existirem na máquina de destino).
Para garantir que isso não aconteça, você só precisa instalar as fontes ausentes na máquina de destino. Fazer isso em sistemas desktop geralmente é trivial (clique duas vezes nas fontes).
Para linux, se você não tiver um ambiente de desktop instalado (ou preferir a linha de comando), precisará:
On Debian based systems:
sudo su mkdir -p /usr/local/share/fonts/truetype/myfonts && cd /usr/local/share/fonts/truetype/myfonts # copy the fonts from their location cp /fonts_location/* . chown root * cd .. && fc-cache -f -v
On Fedora based systems:
sudo su mkdir /usr/share/fonts/myfonts && cd /usr/share/fonts/myfonts # copy the fonts from their location cp /fonts_location/* . chown root * cd .. && fc-cache -f -v