[Qgis-user] QGIS server in professional use?

Jorge Gustavo Rocha jgr at geomaster.pt
Fri Oct 8 03:50:03 PDT 2021


Hi Mats,

I have QGIS Server running under Apache in several public institutions.
My apache2/conf-available files are attached.

It runs pretty well under Apache.

Regards,

Jorge Gustavo

On 08/10/21 11:25, Mats Elfström wrote:
> Hi?
> Is anybody using, or know of someplace where QGIS Server is used in a
> professional and public service, using Apache as web server?
> I would be immensively and eternally grateful if anybody in a position
> to do so would share the secrets of the Apache setup and configuration
> to act as web server to the QGIS fcgi service. Preferably also how one
> can rewrite the url so that  a GetCapabilites request to a workspace
> folder will return a Geoserver equivalent response. 
>
> Many many thanks beforehand, Mats.E
> -- 
>
> *
> *
>
> *GisKraft*, Geodatakonsult
>
> Mats Elfström, Marsvinsholms stationsväg 80, 271 93 Ystad, Sweden
> tel: +46 70 595 39 35 / www.giskraft.se <http://www.giskraft.se>
>
>
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20211008/ea0744ff/attachment-0001.html>
-------------- next part --------------
<IfModule mod_alias.c>
	<IfModule mod_fcgid.c>
		Define ENABLE_USR_LIB_CGI_BIN
		FcgidProcessLifeTime 8200
		FcgidIOTimeout 8200
		FcgidConnectTimeout 400
		FcgidMaxRequestLen 1000000000
	</IfModule>

	<IfModule mod_cgi.c>
		Define ENABLE_USR_LIB_CGI_BIN
	</IfModule>

	<IfModule mod_cgid.c>
		Define ENABLE_USR_LIB_CGI_BIN
	</IfModule>

	<IfDefine ENABLE_USR_LIB_CGI_BIN>
		# ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
		ScriptAlias /cgi-bin/ /usr/local/bin/
		<Directory "/usr/local/bin">
			AllowOverride None
			Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
			Require all granted
		</Directory>
	</IfDefine>
</IfModule>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
-------------- next part --------------
SetEnv PGSERVICEFILE /home/qgis/.pg_service.conf

FcgidInitialEnv QGIS_SERVER_LOG_FILE /var/log/qgis/qgisserver.log
# 0 INFO (log all requests), 1 WARNING, 2 CRITICAL (suitable for production purposes).
FcgidInitialEnv QGIS_SERVER_LOG_LEVEL 0

# Virtual display
FcgidInitialEnv DISPLAY ":99"

FcgidInitialEnv QGIS_SERVER_IGNORE_BAD_LAYERS 1
FcgidInitialEnv QGIS_SERVER_PARALLEL_RENDERING 1
FcgidInitialEnv QGIS_SERVER_MAX_THREADS -1

# Required
# See https://github.com/qgis/QGIS/issues/31675
# Required to get the ortos from DGT
# scp /home/jgr/.local/share/QGIS/QGIS3/profiles/geodashboard/qgis-auth.db qgis at homologacao.geomaster.pt:qgisserverdb qgis-auth.db
# Evitar o erro: Download of capabilities failed: SSL handshake failed
FcgidInitialEnv QGIS_AUTH_DB_DIR_PATH "/home/qgis/qgisserverdb/"
FcgidInitialEnv QGIS_AUTH_PASSWORD_FILE "/home/qgis/qgisserverdb/qgis-auth.db"

RewriteEngine on
RewriteOptions Inherit
RewriteRule ^/postgresql/(.*)/(.*)/(.*)/cgi-bin/qgis_mapserv.fcgi /cgi-bin/qgis_mapserv.fcgi [NC,PT,E=QGIS_PROJECT_FILE:postgresql:?service=$1&sslmode=disable&schema=$2&project=$3]

-------------- next part --------------
# CORS (for debugging; use carefully in production)
# Always set these headers.
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Methods "POST, GET, OPTIONS, DELETE, PUT"
Header always set Access-Control-Max-Age "1000"
Header always set Access-Control-Allow-Headers "x-requested-with, Content-Type, origin, authorization, accept, client-security-token"

# Added a rewrite to respond with a 200 SUCCESS on every OPTIONS request.
RewriteEngine On
RewriteOptions Inherit
RewriteCond %{REQUEST_METHOD} OPTIONS
RewriteRule ^(.*)$ $1 [R=200,L]


More information about the Qgis-user mailing list