Re: [Qgis-user] QGIS server and pg_service.conf

2018-10-10 Thread Thomas Schüttenberg
Update:
in the apache configuration for a QGIS server 3.2 (on windows) a 
pg_service.conf must be set with: 
FcgidInitialEnv PGSERVICEFILE 
[server]\\dings\\bums\\pgconf\\pg_service.conf 
not with SetEnv ... (2.18)

This aspect has to be corrected in the documentation[1], if it is not os 
specific, I think.

[1] 
https://docs.qgis.org/testing/en/docs/training_manual/qgis_server/install.html

happy QGISing
Thomas


> Thomas Schüttenberg  hat am 9. Oktober 2018 um 15:23 
> geschrieben:
> 
> 
> Hi again,
> 
> in further tests - now with QGIS server 3.2.3 - the SetEnv PGSERVICEFILE 
> resp. PGSYSCONFDIR configuration of my httpd-vhosts.conf did not work as it 
> did in QGIS 2.18.24  (see below) :-(
> 
> I tried several notations of the file path an also put pg_service.conf on the 
> local machine. No effect. QGIS 3.2.3 Desktop is fine with the service file 
> connection.
> 
> NB: the authentication system has not been used, as supposed here 
> https://lists.osgeo.org/pipermail/qgis-user/2018-September/041021.html 
> 
> clueless (again)
> Thomas
> 
> > Thomas Schüttenberg  hat am 8. Oktober 2018 um 11:20 
> > geschrieben:
> > 
> > 
> > Hi!
> > Picking up my earlier thread on pg_service.conf in QGIS server 
> > [https://lists.osgeo.org/pipermail/qgis-user/2018-September/041014.html] I 
> > can gladly tell you that I figured it out!
> > 
> > As said, setting the environment variables on the operating system(s) was 
> > ok, but I missed to define it ALSO in the apache configuration 
> > (httpd-vhosts.conf), as it is stated in the documentation: 
> > https://docs.qgis.org/2.18/en/docs/user_manual/working_with_ogc/ogc_server_support.html#connection-to-service-file
> >  
> > https://docs.qgis.org/2.18/en/docs/training_manual/qgis_server/install.html 
> > 
> > After fiddeling with the UNC for the path to the service file (between 
> > unix/linux doc and windows machine) it both worked on win 7 64bit with 
> > SetEnv PGSERVICEFILE [server]\\dings\\bums\\pgconf\\pg_service.conf
> > or
> > SetEnv PGSYSCONFDIR [server]\\dings\\bums\\pgconf\\
> > 
> > (This tread was also very helpful 
> > http://osgeo-org.1560.x6.nabble.com/pg-services-on-Windows-td5284889.html )
> > 
> > happy QGISing!
> > Thomas
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS server and pg_service.conf

2018-10-09 Thread Thomas Schüttenberg
Hi again,

in further tests - now with QGIS server 3.2.3 - the SetEnv PGSERVICEFILE resp. 
PGSYSCONFDIR configuration of my httpd-vhosts.conf did not work as it did in 
QGIS 2.18.24  (see below) :-(

I tried several notations of the file path an also put pg_service.conf on the 
local machine. No effect. QGIS 3.2.3 Desktop is fine with the service file 
connection.

NB: the authentication system has not been used, as supposed here 
https://lists.osgeo.org/pipermail/qgis-user/2018-September/041021.html 

clueless (again)
Thomas

> Thomas Schüttenberg  hat am 8. Oktober 2018 um 11:20 
> geschrieben:
> 
> 
> Hi!
> Picking up my earlier thread on pg_service.conf in QGIS server 
> [https://lists.osgeo.org/pipermail/qgis-user/2018-September/041014.html] I 
> can gladly tell you that I figured it out!
> 
> As said, setting the environment variables on the operating system(s) was ok, 
> but I missed to define it ALSO in the apache configuration 
> (httpd-vhosts.conf), as it is stated in the documentation: 
> https://docs.qgis.org/2.18/en/docs/user_manual/working_with_ogc/ogc_server_support.html#connection-to-service-file
>  
> https://docs.qgis.org/2.18/en/docs/training_manual/qgis_server/install.html 
> 
> After fiddeling with the UNC for the path to the service file (between 
> unix/linux doc and windows machine) it both worked on win 7 64bit with 
> SetEnv PGSERVICEFILE [server]\\dings\\bums\\pgconf\\pg_service.conf
> or
> SetEnv PGSYSCONFDIR [server]\\dings\\bums\\pgconf\\
> 
> (This tread was also very helpful 
> http://osgeo-org.1560.x6.nabble.com/pg-services-on-Windows-td5284889.html )
> 
> happy QGISing!
> Thomas
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] QGIS server and pg_service.conf

2018-10-08 Thread Thomas Schüttenberg
Hi!
Picking up my earlier thread on pg_service.conf in QGIS server 
[https://lists.osgeo.org/pipermail/qgis-user/2018-September/041014.html] I can 
gladly tell you that I figured it out!

As said, setting the environment variables on the operating system(s) was ok, 
but I missed to define it ALSO in the apache configuration (httpd-vhosts.conf), 
as it is stated in the documentation: 
https://docs.qgis.org/2.18/en/docs/user_manual/working_with_ogc/ogc_server_support.html#connection-to-service-file
 
https://docs.qgis.org/2.18/en/docs/training_manual/qgis_server/install.html 

After fiddeling with the UNC for the path to the service file (between 
unix/linux doc and windows machine) it both worked on win 7 64bit with 
SetEnv PGSERVICEFILE [server]\\dings\\bums\\pgconf\\pg_service.conf
or
SetEnv PGSYSCONFDIR [server]\\dings\\bums\\pgconf\\

(This tread was also very helpful 
http://osgeo-org.1560.x6.nabble.com/pg-services-on-Windows-td5284889.html )

happy QGISing!
Thomas
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS server and pg_service.conf

2018-09-10 Thread Alessandro Pasotti
Hi,

sorry for the delay: I missed the thread


the QGIS auth system was designed to work with the server, this comment in
the code explains how to configure it, I'm not sure if this is documented
somewhere else, if not, we should add a paragraph in the docs:


  //   Initialize the authentication system

  //   creates or uses qgis-auth.db in ~/.qgis3/ or directory defined
by QGIS_AUTH_DB_DIR_PATH env variable

  //   set the master password as first line of file defined by
QGIS_AUTH_PASSWORD_FILE env variable

  //   (QGIS_AUTH_PASSWORD_FILE variable removed from environment
after accessing)



Hope this helps.



On Thu, Sep 6, 2018 at 8:34 PM Andreas Neumann  wrote:

> Hi Thomas,
>
> Does it work now?
>
> It might also be a different issue. It might be an authentication issue.
> If you used authentication manager and don't store the login and password
> in the QGIS project file, there may be issues. In that case you also have
> to do something (I don't know exactly what) to enable authentication
> manager on QGIS server to read the credentials. I also wonder how to handle
> such cases. For that reason, I still store the login name and password in
> the qgs project files, instead of using the authentication manager.
>
> If this is the case, maybe Alessandro can help?
>
> Greetings,
>
> Andreas
>
> Am 06.09.2018 um 15:32 schrieb Etienne Trimaille:
>
> Either use PGSERVICEFILE or put it /etc/postgresql-common/pg_service.conf.
> It's working well for me with QGIS 2.18.23.
>
> Le jeu. 6 sept. 2018 à 07:55, Jürgen E. Fischer  a écrit :
>
>> Hi Thomas,
>>
>> On Thu, 06. Sep 2018 at 13:44:40 +0200, Thomas Schüttenberg wrote:
>> > Yes, I did that. The environment variable PGSYSCONFDIR is set also on
>> the
>> > server machine, it points to the same connection file and it works:
>> QGIS on
>> > the server pc can load layers with this service parameter.
>>
>> PGSERVICEFILE?
>>
>>
>> Jürgen
>>
>> --
>> Jürgen E. Fischer   norBIT GmbH Tel.
>> +49-4931-918175-31
>> Dipl.-Inf. (FH) Rheinstraße 13  Fax.
>> +49-4931-918175-50
>> Software Engineer   D-26506 Norden
>> http://www.norbit.de
>> QGIS release manager (PSC)  GermanyIRC: jef on
>> FreeNode
>> ___
>> Qgis-user mailing list
>> Qgis-user@lists.osgeo.org
>> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
>
> ___
> Qgis-user mailing listqgis-u...@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
>
>
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



-- 
Alessandro Pasotti
w3:   www.itopen.it
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS server and pg_service.conf

2018-09-06 Thread Andreas Neumann

Hi Thomas,

Does it work now?

It might also be a different issue. It might be an authentication issue. 
If you used authentication manager and don't store the login and 
password in the QGIS project file, there may be issues. In that case you 
also have to do something (I don't know exactly what) to enable 
authentication manager on QGIS server to read the credentials. I also 
wonder how to handle such cases. For that reason, I still store the 
login name and password in the qgs project files, instead of using the 
authentication manager.


If this is the case, maybe Alessandro can help?

Greetings,

Andreas


Am 06.09.2018 um 15:32 schrieb Etienne Trimaille:
Either use PGSERVICEFILE or put it 
/etc/postgresql-common/pg_service.conf. It's working well for me with 
QGIS 2.18.23.


Le jeu. 6 sept. 2018 à 07:55, Jürgen E. Fischer > a écrit :


Hi Thomas,

On Thu, 06. Sep 2018 at 13:44:40 +0200, Thomas Schüttenberg wrote:
> Yes, I did that. The environment variable PGSYSCONFDIR is set
also on the
> server machine, it points to the same connection file and it
works: QGIS on
> the server pc can load layers with this service parameter.

PGSERVICEFILE?


Jürgen

-- 
Jürgen E. Fischer           norBIT GmbH             Tel.

+49-4931-918175-31
Dipl.-Inf. (FH)             Rheinstraße 13          Fax.
+49-4931-918175-50
Software Engineer           D-26506 Norden http://www.norbit.de
QGIS release manager (PSC)  Germany                    IRC: jef on
FreeNode
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org 
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user



___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user


___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS server and pg_service.conf

2018-09-06 Thread Etienne Trimaille
Either use PGSERVICEFILE or put it /etc/postgresql-common/pg_service.conf.
It's working well for me with QGIS 2.18.23.

Le jeu. 6 sept. 2018 à 07:55, Jürgen E. Fischer  a écrit :

> Hi Thomas,
>
> On Thu, 06. Sep 2018 at 13:44:40 +0200, Thomas Schüttenberg wrote:
> > Yes, I did that. The environment variable PGSYSCONFDIR is set also on the
> > server machine, it points to the same connection file and it works: QGIS
> on
> > the server pc can load layers with this service parameter.
>
> PGSERVICEFILE?
>
>
> Jürgen
>
> --
> Jürgen E. Fischer   norBIT GmbH Tel. +49-4931-918175-31
> Dipl.-Inf. (FH) Rheinstraße 13  Fax. +49-4931-918175-50
> Software Engineer   D-26506 Norden
> http://www.norbit.de
> QGIS release manager (PSC)  GermanyIRC: jef on FreeNode
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS server and pg_service.conf

2018-09-06 Thread Jürgen E . Fischer
Hi Thomas,

On Thu, 06. Sep 2018 at 13:44:40 +0200, Thomas Schüttenberg wrote:
> Yes, I did that. The environment variable PGSYSCONFDIR is set also on the
> server machine, it points to the same connection file and it works: QGIS on
> the server pc can load layers with this service parameter.

PGSERVICEFILE? 


Jürgen

-- 
Jürgen E. Fischer   norBIT GmbH Tel. +49-4931-918175-31
Dipl.-Inf. (FH) Rheinstraße 13  Fax. +49-4931-918175-50
Software Engineer   D-26506 Norden http://www.norbit.de
QGIS release manager (PSC)  GermanyIRC: jef on FreeNode


signature.asc
Description: PGP signature
norBIT Gesellschaft fuer Unternehmensberatung und Informationssysteme mbH
Rheinstrasse 13, 26506 Norden
GF: Jelto Buurman, HR: Amtsgericht Aurich HRB 100827
Datenschutzerklaerung: https://www.norbit.de/83/
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS server and pg_service.conf

2018-09-06 Thread Thomas Schüttenberg
Hi!

Yes, I did that. The environment variable PGSYSCONFDIR is set also on the 
server machine, it points to the same connection file and it works: QGIS on the 
server pc can load layers with this service parameter.

That's why I expected my (bundeled) QGIS server to do the same and use the pg 
service within the wms, but it gives only an empty wms, named like the .qgs, 
without the actual layers.
I'm using QGIS 2.18.23 here, maybe it's a bug?

Beste regards
Thomas


> Carlos López PSIG  hat am 6. September 2018 um 13:03 
> geschrieben:
> 
> 
> Hi,
> You should to define environment variables to use pg_service.conf in server
> too.
> Of course, the service should to use tha same name.
> 
> Test without define connection to database using "service", therefore write
> host/port/databse/user& password to confirm that the connection it's ok.
> 
> luck,
> 
> Best regards,
> 
> * *
> *PSIG*
> Implementació, gestió i formació SIG
> 
> *Carlos López Quintanilla*
> 
> www.psig.es
> carlos.lo...@psig.es
> +34 699.680.261
> 
> Nota legal: Este mensaje y cualquier archivo adjunto está destinado
> únicamente a la
> persona a quien se dirige y es confidencial. Si usted ha recibido este
> mensaje por
> error, por favor, comuníqueselo al remitente y bórrelo inmediatamente. La
> utilización ,
> revelación y/o reproducción del mensaje puede constituir un delito.
> 
> Protección de Datos: Le informamos que sus datos de contacto electrónico se
> hallan
> incorporados a un fichero titularidad de CARLOS LÓPEZ QUINTANILLA, al
> objeto de
> envío de información, respuesta a consultas y contactos genéricos.
> Puede ejercer los derechos de acceso, rectificación, cancelación y
> oposición que
> establece la LOPD en cualquier momento, mediante escrito, acompañado de
> copia de
> documento oficial que le identifique, dirigido a CARLOS LÓPEZ QUINTANILLA
> CL. P
> arellada, 8 E2 de Corbera de Llobregat, 08757-Barcelona.
> 
> También podrá oponerse a nuestros envíos de comunicaciones comerciales
> (Art.21.2
> de la LSSI) a través de la siguiente dirección de correo electrónico:
> ad...@psig.es
> 
> 
> 
> El jue., 6 sept. 2018 a las 12:37, Thomas Schüttenberg ()
> escribió:
> 
> > Hi there!
> >
> > I wonder if/how the QGIS server (2.18) is able to use PostgeSQL service
> > connection files [1].
> >
> > I have a project file with postgis layers, that are connected via the
> > service parameter (instead of hostname/port...). These are defined in
> > pg_service.conf and work.
> >
> > When I serve this project with QGIS server 2.18 as wms, connecting the wms
> > (in QGIS desktop) works, but it does not contain any layers.
> >
> > A WMS made from the same project and datasource but with full database
> > credentials works als usual.
> >
> > Thanks for any hint, maybe I just miss something.
> >
> > Cheers
> > Thomas
> > ___
> > Qgis-user mailing list
> > Qgis-user@lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Re: [Qgis-user] QGIS server and pg_service.conf

2018-09-06 Thread Carlos López PSIG
Hi,
You should to define environment variables to use pg_service.conf in server
too.
Of course, the service should to use tha same name.

Test without define connection to database using "service", therefore write
host/port/databse/user& password to confirm that the connection it's ok.

luck,

Best regards,

* *
*PSIG*
Implementació, gestió i formació SIG

*Carlos López Quintanilla*

www.psig.es
carlos.lo...@psig.es
+34 699.680.261

Nota legal: Este mensaje y cualquier archivo adjunto está destinado
únicamente a la
persona a quien se dirige y es confidencial. Si usted ha recibido este
mensaje por
error, por favor, comuníqueselo al remitente y bórrelo inmediatamente. La
utilización ,
revelación y/o reproducción del mensaje puede constituir un delito.

Protección de Datos: Le informamos que sus datos de contacto electrónico se
hallan
incorporados a un fichero titularidad de CARLOS LÓPEZ QUINTANILLA, al
objeto de
envío de información, respuesta a consultas y contactos genéricos.
Puede ejercer los derechos de acceso, rectificación, cancelación y
oposición que
establece la LOPD en cualquier momento, mediante escrito, acompañado de
copia de
documento oficial que le identifique, dirigido a CARLOS LÓPEZ QUINTANILLA
CL. P
arellada, 8 E2 de Corbera de Llobregat, 08757-Barcelona.

También podrá oponerse a nuestros envíos de comunicaciones comerciales
(Art.21.2
de la LSSI) a través de la siguiente dirección de correo electrónico:
ad...@psig.es



El jue., 6 sept. 2018 a las 12:37, Thomas Schüttenberg ()
escribió:

> Hi there!
>
> I wonder if/how the QGIS server (2.18) is able to use PostgeSQL service
> connection files [1].
>
> I have a project file with postgis layers, that are connected via the
> service parameter (instead of hostname/port...). These are defined in
> pg_service.conf and work.
>
> When I serve this project with QGIS server 2.18 as wms, connecting the wms
> (in QGIS desktop) works, but it does not contain any layers.
>
> A WMS made from the same project and datasource but with full database
> credentials works als usual.
>
> Thanks for any hint, maybe I just miss something.
>
> Cheers
> Thomas
> ___
> Qgis-user mailing list
> Qgis-user@lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

[Qgis-user] QGIS server and pg_service.conf

2018-09-06 Thread Thomas Schüttenberg
Hi there!

I wonder if/how the QGIS server (2.18) is able to use PostgeSQL service 
connection files [1]. 

I have a project file with postgis layers, that are connected via the service 
parameter (instead of hostname/port...). These are defined in pg_service.conf 
and work.

When I serve this project with QGIS server 2.18 as wms, connecting the wms (in 
QGIS desktop) works, but it does not contain any layers.

A WMS made from the same project and datasource but with full database 
credentials works als usual.

Thanks for any hint, maybe I just miss something.

Cheers
Thomas
___
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user