[Qgis-user] QGIS Server setup <-- PostgreSQL/PostGIS
Jorge Gustavo Rocha
jgr at geomaster.pt
Tue Feb 11 15:54:06 PST 2025
Hi Sebastián,
Can you try without passing MAP on the URL?
Try to get the Capabilities document in first place.
http://qgis.server:6080/cgi-bin/qgis_mapserv.fcgi?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities
Regards,
Jorge Gustavo
On 11/02/25 22:52, Sebastián Meyer via QGIS-User wrote:
> Hi,
>
> Thanks a lot! Subject cleared!
>
> I'll share my details, Apache config, tests that work and full error log.
>
> Apache qgis.server:6080
>
> PostgreSQL qgis.server:7000
>
> DB structure: proyectos_qgis / qgis_metadata / qgis_projects (projects)
>
> / z_project1 / layer n
>
>
> ### Apache config (I left off logs variables only. Maybe some
> mandatory variables I'm missing? No QGIS_AUTH_DB_DIR_PATH or
> PG_SERVICE_FILE...)
> <VirtualHost *:6080>
>
> ServerAdmin webmaster at qgis.server
> ServerName qgis.server
>
> DocumentRoot /var/www/html
>
> # Longer timeout for WPS... default = 40
> FcgidIOTimeout 120
>
> FcgidInitialEnv LC_ALL "es_AR.UTF-8"
> FcgidInitialEnv PYTHONIOENCODING UTF-8
> FcgidInitialEnv LANG "es_AR.UTF-8"
>
> SetEnv QGIS_PROJECT_FILE
> "postgresql://user:pass@qgis.server:7000?sslmode=disable&dbname=proyectos_qgis&schema=qgis_metadata&project=z_project1"
>
> ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
> <Directory "/usr/lib/cgi-bin/">
> AllowOverride None
> Options +ExecCGI -MultiViews -SymLinksIfOwnerMatch
> Require all granted
> </Directory>
>
> <IfModule mod_fcgid.c>
> FcgidMaxRequestLen 26214400
> FcgidConnectTimeout 60
> FcgidInitialEnv DISPLAY ":99"
> </IfModule>
>
> </VirtualHost>
>
>
> ### Tested
>
> a- DB access successfully with
>
> sudo -u www-data psql "dbname='proyectos_qgis' host='qgis.server'
> user='user' password='pass' port='7000'"
>
> b- Full project access from QGis Desktop via PostGIS connection to
> z_project1
>
>
>
> ### Error log to request
> http://qgis.server:6080/cgi-bin/qgis_mapserv.fcgi?MAP=z_project1&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/jpeg
>
>
> 18:51:07 INFO Server[5035]: QGIS Server Starting : 3.40.3-Bratislava
> (2a274ab7754)
> 18:51:07 INFO Server[5035]: QGIS Server Settings:
>
> <snip> LOT OF INFOs </snip>
>
>
> 18:51:07 WARNING Server[5035]: Invalid cache strategy, expecting
> 'filesystem', 'periodic' or 'off'. Using 'filesystem' as default.
> 18:51:07 WARNING Server[5035]: Invalid cache strategy, expecting
> 'filesystem', 'periodic' or 'off'. Using 'filesystem' as default.
> 18:51:07 INFO Server[5035]: Initializing 'filesystem' cache strategy
> 18:51:07 INFO Server[5035]: Server initialized
> 18:51:07 INFO ./src/server/qgsserverplugins.cpp[5035]: load library
> /usr/lib/qgispython (3.40.3)
> 18:51:07 INFO ./src/server/qgsserverplugins.cpp[5035]: Python support
> library loaded successfully.
> 18:51:08 INFO Server[5035]: No server python plugins are available
> 18:51:08 INFO Server[5035]: ******************** New request
> ***************
> 18:51:08 INFO Server[5035]: Request URL:
> http://qgis.server:6080/cgi-bin/qgis_mapserv.fcgi?MAP=z_project1&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/jpeg
> 18:51:08 INFO Server[5035]: Environment:
> 18:51:08 INFO Server[5035]:
> ------------------------------------------------
> 18:51:08 INFO Server[5035]: SERVER_NAME: qgis.server
> 18:51:08 INFO Server[5035]: REQUEST_URI:
> /cgi-bin/qgis_mapserv.fcgi?MAP=z_project1&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/jpeg
> 18:51:08 INFO Server[5035]: SCRIPT_NAME: /cgi-bin/qgis_mapserv.fcgi
> 18:51:08 INFO Server[5035]: REMOTE_ADDR: 172.30.64.19
> 18:51:08 INFO Server[5035]: SERVER_PORT: 6080
> 18:51:08 INFO Server[5035]: QUERY_STRING:
> MAP=z_project1&SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image/jpeg
> 18:51:08 INFO Server[5035]: REQUEST_METHOD: GET
> 18:51:08 INFO Server[5035]: QGIS_PROJECT_FILE:
> postgresql://user:pass@qgis.server:7000?sslmode=disable&dbname=proyectos_qgis&schema=qgis_metadata&project=z_project1
> 18:51:08 INFO Server[5035]: SERVER_PROTOCOL: HTTP/1.1
> Headers:
> ------------------------------------------------
> "Accept" :
> "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7"
> "Host" : "qgis.server:6080"
> "User-Agent" : "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36
> (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36"
> 18:51:08 INFO Server[5035]: FORMAT:image/jpeg
> 18:51:08 INFO Server[5035]: MAP:z_project1
> 18:51:08 INFO Server[5035]: REQUEST:GetMap
> 18:51:08 INFO Server[5035]: SERVICE:WMS
> 18:51:08 INFO Server[5035]: VERSION:1.3.0
> 18:51:08 CRITICAL Server[5035]: Error when loading project file
> 'z_project1': Unable to open z_project1
> 18:51:08 WARNING Server[5035]: <?xml version="1.0" encoding="UTF-8"?>
> <ServerException>Project file error. For OWS services: please provide
> a SERVICE and a MAP parameter pointing to a valid QGIS project
> file</ServerException>
>
> 18:51:08 INFO Server[5035]: Request finished in 2 ms
>
>
> TIA,
>
> --
>
> seb
>
>
> _______________________________________________
> 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
--
Logo *Geomaster, LDA *
*VENHA DESCOBRIR O CAMINHO DO OPEN SOURCE CONNOSC *
Rua Afonso Palmeira, 31, 7 D
4715-278 Braga
VAT/NIF 510 906 109
Phone +351 253 257 173
Site geomaster.pt <http://geomaster.pt>
GPS 41.54627, -8.40432
------------------------------------------------------------------------
Jorge Gustavo Rocha
CTO
Mobile +351 910 333 888
Email jgr at geomaster.pt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250211/f3ff8fa7/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cropped-geomaster300x300-1.png
Type: image/png
Size: 33896 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20250211/f3ff8fa7/attachment-0001.png>
More information about the QGIS-User
mailing list