[Qgis-user] QGIS Server with Postgis layers

Jorge Gustavo Rocha jgr at di.uminho.pt
Mon Nov 30 08:33:12 PST 2015


Hi,

I'm not able to add postgis layers to a QGIS projet (2.12) and them 
publish it with QGIS Server + QGIS Client (from github) due to an 
authentication error.

I've tried with QGIS Server 2.12 (from package) and QGIS Server compiled 
from sources.

Other layers without authetication (from shapefile/rasters) are 
published. If I add a Postgis layer, it does not show on QGIS Client and 
I get the following error on the server log file:

QFSFileEngine::open: No file name specified
ERROR: Auth db directory path could not be created
credentials for dbname='madeira' host=localhost port=5432 sslmode=disable
message: fe_sendauth: no password supplied

username: password: credentials for dbname='madeira' host=localhost 
port=5432 sslmode=disable
message: fe_sendauth: no password supplied

I've set several options in Apache configuration without success.

   FcgidInitialEnv PGPASSWORD user
   FcgidInitialEnv PGPASSFILE "/home/user/.pgpass"
   FcgidInitialEnv QGIS_AUTH_DB_DIR_PATH "/home/user/.qgis2/"
   FcgidInitialEnv QGIS_AUTH_PASSWORD_FILE "/home/user/.qgis2/qgis-auth.db"

   FcgidIOTimeout 120
   FcgidInitialEnv LC_ALL "pt_PT.UTF-8"
   FcgidInitialEnv PYTHONIOENCODING UTF-8
   FcgidInitialEnv LANG "pt_PT.UTF-8"
   FcgidInitialEnv QGIS_DEBUG 99
   FcgidInitialEnv QGIS_CUSTOM_CONFIG_PATH "/home/user/.qgis2"
   FcgidInitialEnv QGIS_SERVER_LOG_FILE "/tmp/qgis.log"
   FcgidInitialEnv QGIS_SERVER_LOG_LEVEL 99
   FcgidInitialEnv QGIS_OPTIONS_PATH "/usr/lib/cgi-bin/"
   FcgidInitialEnv QGIS_PLUGINPATH "/home/user/.qgis2/python/plugins"


I was able to debug the error:
"ERROR: Auth db directory path could not be created"
It was trying to create the .qgis2 folder on /.
Creating a symbolic link from /.qgis2 to /home/user/.qgis2 prevents the 
error, but not solve the problem.

I also tried to set/clear the master password, but without success.

So, my question is: how to configure QGIS Server to serve PostGIS 
layers? How to deal with authentication?

Thanks in advance,

J. Gustavo
-- 
Jorge Gustavo Rocha
Departamento de Informática
Universidade do Minho
4710-057 Braga
Tel: +351 253604480
Fax: +351 253604471
Móvel: +351 910333888
skype: nabocudnosor



More information about the Qgis-user mailing list