[Qgis-developer] QGIS Server - use PGSYSCONFDIR in a server with no postgresql installed

kimaidou kimaidou at gmail.com
Thu Nov 19 04:52:31 PST 2015


Thanks Andreas for your help.

I also think fcgid.conf is the "winner", but I will try your configuration
( move pg_service.conf to /etc/ and add the setenv in Apache env.conf ).
Could you please give me the result of

ls -lh /etc/pg_service.conf

command, so that I completely mimic your configuration ?

Cheers,
Michaël

2015-11-19 13:00 GMT+01:00 Neumann, Andreas <a.neumann at carto.net>:

> Hi Michaël,
>
> This works for me.
>
> My pg_service.conf file is at /etc/pg_service.conf
>
> And in the Apache configuration it is specified in two files:
>
> /etc/apache2/mods-enabled/env.conf :
>
> SetEnv PGSYSCONFDIR "/etc"
>
> and in
>
> /etc/apache2/mods-enabled/fcgid.conf
>
> FcgidInitialEnv PGSYSCONFDIR "/etc"
>
> I am not sure which one is really used or has precedence - I suspect it is
> the fcgid.conf file.
>
> Hope you get this working,
>
> Andreas
>
> On 2015-11-19 12:17, kimaidou wrote:
>
> Hi all
>
> I have installed QGIS Server in one server (called "map") and PostGreSQL
> on another (called "pg" ), both on Ubuntu Server 14.04
> I would like to access to database only with PostGreSQL services, so in
> the map server, I did the following steps:
>
> * Create a folder /etc/postgresql
> * Create a file /etc/postgresql/pg_service.conf  with some credentials
> * Install postgresql-client to be able to use psql
> * Add a environment variable PGSYSCONFDIR  and export it (plus add it in
> /etc/environment ). Variable : PGSYSCONFDIR=/etc/postgresq'l
> * Test via psql "service=myservice"  -> I can connect to the database and
> get data
>
> When I ask QGIS Server for the GetCapabilities, the layers configured with
> this service cannot be added. I get the error : "Service myservice not
> found"
>
> So I added the following line in the fcgid.conf file to explicitely tell
> Apache (and QGIS Server) to use this value.
> FcgidInitialEnv PGSYSCONFDIR "/etc/postgresql"
>
> But nothing works. I even tried to chmod and chown the service file and
> folder to let Apache user www-data to read it. I also tried with a quick
> and dirty chmod 777 , with no luck.
>
> Has anyone some experience in setting up a Server with no postgresql
> installed locally, and use the pg_service.conf file with QGIS Server ?
>
> Thanks a lot for any clue
> Michaël
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20151119/4dde500b/attachment-0001.html>


More information about the Qgis-developer mailing list