-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8687 from daniviga/rpm-fixes
[RPM] Improve RPM packaging
- Loading branch information
Showing
7 changed files
with
149 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Adapted from http://www.itopen.it/bulk/qgis3-server/#/step-27 | ||
# Path: /etc/systemd/system/qgis-server-fcgi.service | ||
# systemctl enable qgis-server-fcgi.service && systemctl start qgis-server-fcgi.service | ||
|
||
[Unit] | ||
Description = QGIS Server Tracker FastCGI backend | ||
After = network.target qgis-server-fcgi.socket | ||
|
||
[Service] | ||
# An existing user must be set | ||
User = qgis | ||
Group = qgis | ||
ExecStart = /usr/libexec/qgis/qgis_mapserv.fcgi | ||
StandardInput = socket | ||
WorkingDirectory = /tmp | ||
|
||
Restart = always |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Adapted from http://www.itopen.it/bulk/qgis3-server/#/step-26 | ||
# Path: /etc/systemd/system/qgis-server-fcgi.socket | ||
# systemctl enable qgis-server-fcgi.socket && systemctl start qgis-server-fcgi.socket | ||
|
||
[Unit] | ||
Description = QGIS Server FastCGI Socket | ||
PartOf = qgis-server-fcgi.service | ||
|
||
[Socket] | ||
ListenStream = 127.0.0.1:9993 | ||
Accept = yes | ||
|
||
[Install] | ||
WantedBy = sockets.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Adapted from https://github.com/gem/oq-qgis-server/blob/master/conf/qgis-server-nginx.conf | ||
# It requires a FCGI processes spawner like spawn-fcgi or systemd (see s-server-fcgi.socket) | ||
|
||
user nginx; | ||
worker_processes auto; | ||
access_log /var/log/nginx/access.log; | ||
error_log /var/log/nginx/error.log; | ||
pid /run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 65; | ||
types_hash_max_size 2048; | ||
|
||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
|
||
# Get 'port' from `$http_host` | ||
map $http_host $port { | ||
"~*.*:(?<p>.*)" $p; | ||
default server_port; | ||
} | ||
# Get 'proto' from `$scheme` unless 'X-Forwarded-Proto' | ||
# is set by the reverse proxy | ||
map $http_x_forwarded_proto $qgis_proto { | ||
"" $scheme; | ||
default $http_x_forwarded_proto; | ||
} | ||
# Get 'host' from `$host` unless 'X-Forwarded-Host' | ||
# 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 | ||
map $http_x_forwarded_port $qgis_port { | ||
"" $port; | ||
default $http_x_forwarded_port; | ||
} | ||
|
||
server { | ||
listen 80 default_server; | ||
listen [::]:80 default_server; | ||
server_name _; | ||
root /usr/share/nginx/html; | ||
|
||
location /ows/ { | ||
rewrite ^/ows/(.*)$ /qgis/qgis_mapserv.fcgi?map=/var/www/ows/$1.qgs; | ||
} | ||
location /qgis/ { | ||
internal; # Used only by the OGC rewrite | ||
root /var/www/ows; | ||
fastcgi_pass localhost:9993; | ||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | ||
fastcgi_param QUERY_STRING $query_string; | ||
# build links in GetCapabilities based on | ||
# the hostname exposed by the reverse proxy | ||
fastcgi_param SERVER_PROTOCOL $qgis_proto; | ||
fastcgi_param SERVER_NAME $qgis_host; | ||
fastcgi_param SERVER_PORT $qgis_port; | ||
} | ||
error_page 404 /404.html; | ||
location = /40x.html { | ||
} | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
} | ||
} | ||
|
||
} |