<div dir="ltr"><div><div><div><div>Hi all<br><br></div>I have installed QGIS Server in one server (called "map") and PostGreSQL on another (called "pg" ), both on Ubuntu Server 14.04<br></div>I would like to access to database only with PostGreSQL services, so in the map server, I did the following steps:<br><br></div>* Create a folder /etc/postgresql<br>* Create a file /etc/postgresql/pg_service.conf  with some credentials<br>* Install postgresql-client to be able to use psql<br></div><div>* Add a environment variable PGSYSCONFDIR  and export it (plus add it in /etc/environment ). Variable : PGSYSCONFDIR=/etc/postgresq'l<br></div><div>* Test via psql "service=myservice"  -> I can connect to the database and get data<br><br></div><div>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"<br><br></div><div>So I added the following line in the fcgid.conf file to explicitely tell Apache (and QGIS Server) to use this value.<br></div><div>FcgidInitialEnv PGSYSCONFDIR "/etc/postgresql"<br><br></div><div>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.<br><br></div><div>Has anyone some experience in setting up a Server with no postgresql installed locally, and use the pg_service.conf file with QGIS Server ?<br><br></div><div>Thanks a lot for any clue<br></div><div>Michaël<br> </div></div>