-
Notifications
You must be signed in to change notification settings - Fork 8
/
qgis3-server.conf.template
88 lines (79 loc) · 4.57 KB
/
qgis3-server.conf.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
ServerName 127.0.0.1
<VirtualHost *:$PORT>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
LogLevel ${APACHE_LOG_LEVEL}
# Set CORS headers for GetCapabilities and GetFeatureInfo requests
Header set Access-Control-Allow-Origin "*"
RewriteEngine On
# Endpoint for QGIS projects stored in PostgreSQL DB
RewriteRule ^${URL_PREFIX}/pg/(.+)/(.+)$ /cgi-bin/qgis_mapserv.fcgi?map=postgresql\%3A\%2F\%2F\%2F\%3Fservice\%3D${DB_PROJECT_SERVICE}\%26schema=$1\%26project=$2 [QSA,PT]
# Endpoint for file based QGIS projects
RewriteRule ^${URL_PREFIX}/(.*)$ /cgi-bin/qgis_mapserv.fcgi?map=/data/$1.${QGIS_PROJECT_SUFFIX} [QSA,PT]
# Endpoint for logs
RewriteRule ^/logs$ /cgi-bin/tail_logs.sh [QSA,PT]
# Forbid direct access
RewriteRule ^/cgi-bin/.*$ - [F]
# https://httpd.apache.org/mod_fcgid/mod/mod_fcgid.html
FcgidIOTimeout ${FCGI_IO_TIMEOUT}
FcgidMinProcessesPerClass ${FCGI_MIN_PROCESSES}
FcgidMaxProcessesPerClass ${FCGI_MAX_PROCESSES}
FcgidProcessLifeTime ${FCGI_PROCESS_LIFE_TIME}
FcgidIdleTimeout ${FCGI_IDLE_TIMEOUT}
FcgidMaxRequestLen ${FCGI_MAX_REQUESTLEN}
FcgidConnectTimeout ${FCGI_CONNECT_TIMEOUT}
# Not configurable QGIS Server ENVs
FcgidInitialEnv QGIS_SERVER_LOG_STDERR 1
FcgidInitialEnv QGIS_CUSTOM_CONFIG_PATH "/var/lib/qgis"
FcgidInitialEnv QGIS_AUTH_DB_DIR_PATH "/var/lib/qgis"
FcgidInitialEnv QGIS_OPTIONS_PATH "/etc"
FcgidInitialEnv QGIS_SERVER_API_RESOURCES_DIRECTORY "/usr/share/qgis/resources/server/api"
FcgidInitialEnv QGIS_SERVER_CACHE_DIRECTORY "/.cache"
FcgidInitialEnv QGIS_PLUGINPATH "/usr/share/qgis/python/plugins"
# Configurable QGIS Server ENVs
FcgidInitialEnv LOCPATH ${LOCPATH}
FcgidInitialEnv LC_ALL ${LC_ALL}
FcgidInitialEnv LANG ${LANG}
FcgidInitialEnv QGIS_DEBUG ${QGIS_DEBUG}
FcgidInitialEnv MAX_CACHE_LAYERS ${MAX_CACHE_LAYERS}
FcgidInitialEnv QGIS_SERVER_ALLOWED_EXTRA_SQL_TOKENS ${QGIS_SERVER_ALLOWED_EXTRA_SQL_TOKENS}
FcgidInitialEnv QGIS_SERVER_API_WFS3_MAX_LIMIT ${QGIS_SERVER_API_WFS3_MAX_LIMIT}
FcgidInitialEnv QGIS_SERVER_CACHE_SIZE ${QGIS_SERVER_CACHE_SIZE}
FcgidInitialEnv QGIS_SERVER_DISABLE_GETPRINT ${QGIS_SERVER_DISABLE_GETPRINT}
FcgidInitialEnv QGIS_SERVER_FORCE_READONLY_LAYERS ${QGIS_SERVER_FORCE_READONLY_LAYERS}
FcgidInitialEnv QGIS_SERVER_IGNORE_BAD_LAYERS ${QGIS_SERVER_IGNORE_BAD_LAYERS}
FcgidInitialEnv QGIS_SERVER_LANDING_PAGE_PREFIX ${QGIS_SERVER_LANDING_PAGE_PREFIX}
FcgidInitialEnv QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES ${QGIS_SERVER_LANDING_PAGE_PROJECTS_DIRECTORIES}
FcgidInitialEnv QGIS_SERVER_LANDING_PAGE_PROJECTS_PG_CONNECTIONS ${QGIS_SERVER_LANDING_PAGE_PROJECTS_PG_CONNECTIONS}
FcgidInitialEnv QGIS_SERVER_LOG_LEVEL ${QGIS_SERVER_LOG_LEVEL}
FcgidInitialEnv QGIS_SERVER_LOG_FILE ${QGIS_SERVER_LOG_FILE}
FcgidInitialEnv QGIS_SERVER_LOG_PROFILE ${QGIS_SERVER_LOG_PROFILE}
FcgidInitialEnv QGIS_SERVER_MAX_THREADS ${QGIS_SERVER_MAX_THREADS}
FcgidInitialEnv QGIS_SERVER_OVERRIDE_SYSTEM_LOCALE ${QGIS_SERVER_OVERRIDE_SYSTEM_LOCALE}
FcgidInitialEnv QGIS_SERVER_PARALLEL_RENDERING ${QGIS_SERVER_PARALLEL_RENDERING}
FcgidInitialEnv QGIS_SERVER_PROJECT_CACHE_CHECK_INTERVAL ${QGIS_SERVER_PROJECT_CACHE_CHECK_INTERVAL}
FcgidInitialEnv QGIS_SERVER_PROJECT_CACHE_STRATEGY ${QGIS_SERVER_PROJECT_CACHE_STRATEGY}
FcgidInitialEnv QGIS_SERVER_SERVICE_URL ${QGIS_SERVER_SERVICE_URL}
FcgidInitialEnv QGIS_SERVER_SHOW_GROUP_SEPARATOR ${QGIS_SERVER_SHOW_GROUP_SEPARATOR}
FcgidInitialEnv QGIS_SERVER_TRUST_LAYER_METADATA ${QGIS_SERVER_TRUST_LAYER_METADATA}
FcgidInitialEnv QGIS_SERVER_WCS_SERVICE_URL ${QGIS_SERVER_WCS_SERVICE_URL}
FcgidInitialEnv QGIS_SERVER_WFS_SERVICE_URL ${QGIS_SERVER_WFS_SERVICE_URL}
FcgidInitialEnv QGIS_SERVER_WMS_MAX_HEIGHT ${QGIS_SERVER_WMS_MAX_HEIGHT}
FcgidInitialEnv QGIS_SERVER_WMS_MAX_WIDTH ${QGIS_SERVER_WMS_MAX_WIDTH}
FcgidInitialEnv QGIS_SERVER_WMS_SERVICE_URL ${QGIS_SERVER_WMS_SERVICE_URL}
FcgidInitialEnv QGIS_SERVER_WMTS_SERVICE_URL ${QGIS_SERVER_WMTS_SERVICE_URL}
@FCGID_EXTRA_ENV@
SetEnv PGSERVICEFILE /etc/postgresql-common/pg_service.conf
SetEnv PGPASSFILE /etc/postgresql-common/pgpass.conf
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin/">
AllowOverride All
Options +ExecCGI -MultiViews -SymLinksIfOwnerMatch
Order allow,deny
Allow from all
Require all granted
AddHandler cgi-script .sh
</Directory>
</VirtualHost>