Package: py-qgis-server
QGIS embedded WMS/WFS/WCS asynchronous scalable serverDescriptionThis is an asynchronous HTTP QGIS server written in python on top of thetornadoframework and the
0MQ messaging framework for distributing requests workers.It is based on the QGIS 3 server API for efficiently passing requests/responses using 0MQ messaging framework to workers.The server may run as a self-contained single service or as a proxy server with an arbitrary number of workers running
remotely or locally. Independent workers connect automatically to the front-end proxy with no need of special configuration
on the proxy side. Thus, this is ideal for auto-scaling configuration for use with container orchestrator as Rancher, Swarm or Kubernetes.The server is aimed at solving some real situations encountered in production environment: zero conf scalability, handle long-running request situation, auto restart...Py-Qgis-server is constantly tested against QGIS release and ltr version.
See the QGISroadmap.FeaturesMultiples workersFair queuing request dispatchingTimeout for long-running/stalled requestsFull support of qgis server pluginsAuto-restart trigger for workersSupport streamed/chunked responsesSSL supportSupport for access control extensionsSupport for Qgis project stored in postgres databaseSupport adding new projects cache handlers as python extensionPreloading of Qgis projects in static cacheWFS3 supportControl exposition ofQgis APIManagement API (experimental)Requirements:OS: Unix/Posix variants (Linux or OSX) (Windows not officially supported)Python >= 3.6Qgis >= 3.16Some python knowledge about python virtualenv and package installation.libzmq >= 4.0.1 and pyzmq >= 17Documentation:Latest documentation is available ondocs.3liz.orgInstallationFrom Pypipipinstallpy-qgis-serverFrom dockerDocker is the recommended way to deploy py-qgis-server as it ensure a working environment for
running py-qgis-serverFollow the readme in thedocker/folder.From sourceInstall in development modepipinstall-e.Running the serverThe server does not run as a daemon by itself, there are several ways to run a command as a daemon.For example:Use Supervisorhttp://supervisord.org/. Will gives you full control over logs and server status notifications.Use thedaemoncommand.Use systemd...Running the serverusage: qgisserver [-h] [-d] [-c [PATH]]
                  [--version] [-p PORT] [-b IP] [-w NUM] [-j NUM] [-u SETUID]
                  [--rootdir PATH] [--proxy] [--timeout SECONDS]

qgis/HTTP/0MQ scalable server

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           debug mode
  -c [PATH], --config [PATH]
                        Configuration file
  --version             Return version number and exit
  -p PORT, --port PORT  http port
  -b IP, --bind IP      Interface to bind to
  -w NUM, --workers NUM
                        Num workers
  -j NUM, --jobs NUM    Num server instances
  -u SETUID, --setuid SETUID
                        uid to switch to
  --rootdir PATH        Path to qgis projects
  --proxy               Run only as proxy
  --timeout SECONDS     Set client timeout in secondsBy default, the command will run server instances with workers and use unix sockets to communicate. This can
be used to run the server as a single command.Running proxy and workers separatelyIf the--proxyoption the server will act as a proxy server to talk to independent qgis workers.Qgis workers can be run using the command:qgisserver-worker --host=localhost --rootdir=path/to/projectsRequests to OWS servicesThe OWS requests use the following format:/ows/?<ows_query_params>Example:http://myserver:8080/ows/?SERVICE=WFS&VERSION=1.1.0&REQUEST=GetCapabilities&MAP=<qgis_project_spec>Requests to WFS3 OAPIThe requests use the following format:/wfs3/<wfs3_api_endpoint>?MAP=<qgis_project_spec>Example:http://myserver:8080/wfs3/collections.html?MAP=<qgis_project_spec>Accessing the Qgis landing page and other qgis APIBy default, the landing page is not enabled, see thedocumentationon how to enable the landing page.Qgis api may be exposed on demand byconfiguring the api endpointsUsing with lizmapIn order to use the server with lizmap, you must set the following configuration
in yourlizmapConfig.ini.php:[services]
wmsServerURL="http://my.domain:<port>/ows/"
...

; Use relative path
relativeWMSPath=trueConfigurationThe configuration can be done either as configuration .ini file in or as environment variables.The precedences of the configuration parameters is the following (from lowest to highest)Defaults valuesEnvironment variablesConfig fileCommand line optionsConfiguration parametersPlease look atthe documentationfor configuration optionsLoggingBy default, the server log on stdout/stderr and you have to configure redirection and log rotation
on your infrastructure environment