[Qgis-user] QGIS Server with Postgis layers

Jorge Gustavo Rocha jgr at di.uminho.pt
Mon Nov 30 16:24:44 PST 2015


Hi,

I was having trouble publishing projects with QGIS Server on a specific 
machine. I've cleaned everything related with QGIS and installed QGIS 
desktop + QGIS Server + QGIS Client.

On a fresh install, the QGIS project file has a <datasource> with the 
user='user' and password='user', and it works fine. My previous project 
.qgs had the user='user' but no password key.

Sorry for the noise. Regards,

J. Gustavo

Às 16:33 de 30-11-2015, Jorge Gustavo Rocha escreveu:
> 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

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