[RPM] Update examples and documentation (#31623)

* [RPM] Update examples and documentation

* [RPM] Fix a typo
This commit is contained in:
Daniele Viganò 2019-09-12 10:52:39 +02:00 committed by Marco Bernasocchi
parent 3144425caf
commit 04b2f4d696
4 changed files with 30 additions and 17 deletions

View File

@ -25,8 +25,10 @@ QGIS project is "/var/www/ows/my_qgis_project.qgs". The sample
configuration automatically adds the project file extension for you. configuration automatically adds the project file extension for you.
The actual data can stay where it is. Make sure QGIS server can The actual data can stay where it is. Make sure QGIS server can
access the project file and don't forget to let Httpd reload its access the project file and don't forget to let the web server reload its
configuration before sending your requests! configuration before sending your requests! Make also sure that
the environment variable 'QGIS_PREFIX_PATH' is set to '/usr' before
running the FCGI server; see the examples for further details.
Please fill in the metadata tab for your QGIS project. Please fill in the metadata tab for your QGIS project.

View File

@ -10,6 +10,10 @@ After = network.target qgis-server-fcgi.socket
# An existing user must be set # An existing user must be set
User = qgis User = qgis
Group = qgis Group = qgis
Environment = "QGIS_PREFIX_PATH=/usr" "QGIS_SERVER_LOG_STDERR=true"
# See https://docs.qgis.org//en/docs/user_manual/working_with_ogc/server/config.html
# for the full list of supported environment variables, i.e.:
# Environment = "QGIS_SERVER_PARALLEL_RENDERING=true"
ExecStart = /usr/libexec/qgis/qgis_mapserv.fcgi ExecStart = /usr/libexec/qgis/qgis_mapserv.fcgi
StandardInput = socket StandardInput = socket
WorkingDirectory = /tmp WorkingDirectory = /tmp

View File

@ -10,6 +10,10 @@ ScriptAlias /qgis/ "/usr/libexec/qgis/"
Options ExecCGI Options ExecCGI
Options FollowSymLinks Options FollowSymLinks
FcgidInitialEnv QGIS_PREFIX_PATH=/usr
# See https://docs.qgis.org//en/docs/user_manual/working_with_ogc/server/config.html
# for the full list of supported environment variables, i.e.:
# FcgidInitialEnv QGIS_SERVER_PARALLEL_RENDERING=true
<IfModule mod_authz_core.c> <IfModule mod_authz_core.c>
# Apache 2.4 # Apache 2.4

View File

@ -22,24 +22,26 @@ http {
include /etc/nginx/mime.types; include /etc/nginx/mime.types;
default_type application/octet-stream; default_type application/octet-stream;
# Get 'port' from `$http_host` # Get 'host' from `$host` unless 'X-Forwarded-Host'
# is set by the reverse proxy.
# 'X-Forwarded-Host' may contain also the port,
# so it is removed from the variable
map $http_x_forwarded_host $qgis_host {
"~(?<h>[^:]+)" $h;
default $host;
}
# Get 'PORT' from `$http_host`
map $http_host $port { map $http_host $port {
"~*.*:(?<p>.*)" $p; "~*.*:(?<p>.*)" $p;
default server_port; default $server_port;
} }
# Get 'proto' from `$scheme` unless 'X-Forwarded-Proto' # Get 'HTTPS' status from `$https` unless 'X-Forwarded-Proto'
# is set by the reverse proxy # is set by the reverse proxy and contains 'https' scheme
map $http_x_forwarded_proto $qgis_proto { map $http_x_forwarded_proto $qgis_ssl {
"" $scheme; "https" "on";
default $http_x_forwarded_proto; default $https;
} }
# Get 'host' from `$host` unless 'X-Forwarded-Host' # Get 'PORT' from `$port` unless 'X-Forwarded-Port'
# is set by the reverse proxy
map $http_x_forwarded_host $qgis_host {
"" $host;
default $http_x_forwarded_host;
}
# Get 'port' from `$port` unless 'X-Forwarded-Port'
# is set by the reverse proxy # is set by the reverse proxy
map $http_x_forwarded_port $qgis_port { map $http_x_forwarded_port $qgis_port {
"" $port; "" $port;
@ -63,9 +65,10 @@ http {
fastcgi_param QUERY_STRING $query_string; fastcgi_param QUERY_STRING $query_string;
# build links in GetCapabilities based on # build links in GetCapabilities based on
# the hostname exposed by the reverse proxy # the hostname exposed by the reverse proxy
fastcgi_param SERVER_PROTOCOL $qgis_proto; fastcgi_param HTTPS $qgis_ssl;
fastcgi_param SERVER_NAME $qgis_host; fastcgi_param SERVER_NAME $qgis_host;
fastcgi_param SERVER_PORT $qgis_port; fastcgi_param SERVER_PORT $qgis_port;
include fastcgi_params;
} }
error_page 404 /404.html; error_page 404 /404.html;
location = /40x.html { location = /40x.html {